-
User
- 도메인 예시
id: number; name: string; email: string; password: string; createdAt: Date; updatedAt: Date; deletedAt?: Date;
- 기능
- 유저를 생성 할 수 있다.
- 유저의 이름을 업데이트 할 수 있다.
- 비밀번호는 8자리 이상 문자열 + 숫자로 구성되어야 한다.
- 이메일은 이메일형식(xxx@cc.cc)으로 구성되어야 한다.
- 유저는 회원탈퇴를 할 수 있다. 회원탈퇴시 password를 받아 검증하며 soft delete이다(deletedAt에 탈퇴날짜가 들어감)
- 유저를 조회할 수 있다. (이름, 이메일, deleted여부로 필터가 가능해야 한다)
-
Merchandise
- 도메인 예시
id: number; name: string; stock: number; price: number; //상품 원가 createdAt: Date; updateAt: Date;
- 기능
- 상품을 생성 할 수 있다.
- 상품의 이름, 가격을 수정 할 수 있다.
- 재고를 변경 할 수 있다.
- 이름으로 상품을 검색 할 수 있다.
-
Shop
- 도메인 예시
id: number; title: string; contents: string; isActivated: boolean; shopHasMerchanidises: ShopHasMerchandise[]; event: Event; createdAt: Date updateAt: Date
- 기능
- 매대를 생성 할 수 있다.
- 매대의 제목은 1글자 이상이여야 한다.
- 매대의 제목, 내용을 수정 할 수 있다.
- 매대를 조회할 수 있다 (title, isActivated로 필터가 가능해야한다).
- 매대를 비활성화시에 연결된 shopHasMerchandise가 전부 비활성화 되어야 한다.
-
ShopHasMerchandise
- 도메인 예시
id: number; price: number; //실제 판매 가격 merchandise: Merchandise; shop: Shop; isMain: boolean; //Shop 목록에 표시될 메인 상품 여부 isActivated: boolean; //상품 활성화 여부 createdAt: Date; updateAt: Date;
- 기능
- 매대에 상품 연결을 생성 할 수 있다.
- 해당 매대에 메인 상품은 1개만 설정 할 수 있다.
- 매대에 연결된 상품의 가격을 수정 할 수 있다.
- 상품 활성화 여부를 수정 할 수 있다.
- 활성화 되어있지 않은 shop에 연결된 상품은 활성화 할 수 없다
-
Event
- 도메인 예시
id: number; type: EventType = '정률할인이벤트' | '정액할인이벤트' | 'n+1이벤트' value: number; //정액,정률 이벤트시 적용되는 값, n+1이벤트에 적용되는 기본값, ex) 2 + 1 이벤트일시 value는 2가 된다 startDate: Date; endDate: Date; isActivated: boolean; shop: Shop; createdAt: Date; updatedAt: Date;
- 기능
- 이벤트를 조회 할 수 있다 (모든 이벤트에 대해서)
- 이벤트를 생성 할 수 있다.
- 이벤트를 활성화 하려면 매대가 활성화 되어 있어야 한다, 활성화 하려는 시점은 startDate와 endDate의 사이 시점이어야 한다
- 정률할인이벤트는 0 ~ 100사이의 할인률을 갖는다
- 정액할인이벤트의 값은 매대에 연결된 가장 싼 가격의 상품의 가격보다 클 수 없다
- 한번 생성된 이벤트의 종류, 가격은 수정 할 수 없다
-
Order, OrderedMerchandise
- 도메인 예시
Order { id: number; totalPrice: number; //총 가격 (할인 전 원가) saledTotalPrice: number; //실제 총 가격 (할인 후 가격) orderedMerchandises: OrderedMerchandise[] status: OrderStatusType = '결제전' | '배송준비중' | '배송중' | '배송완료' | '취소' | '환불됨' address1: string; address2: string; user: User; createdAt: Date; updatedAt: Date; } OrderedMerchandise { id: number; price: number; //할인 전 가격 saledPrice: number; //할인 후 가격 count: number; event: Event; shopHasMerchandise: ShopHasMerchandise; createdAt: Date; updatedAt: Date; }
- 기능
- 주문을 생성 할 수 있다 → 최초 생성시 상태는 결제전상태
- 결제가 완료되면 상태는 배송준비중이 된다
- 배송중 상태로 변경시에 Merchandise가 가지고 있는 재고는 차감된다
- 배송이 완료되면 배송완료로 상태를 변경 할 수 있다.
- 배송준비중, 배송중일때에만 주문을 환불 할 수 있다. 배송중일때 환불시 재고는 다시 원복 된다.
- 결제전 상태에서만 주문을 취소할 수 있다
- 주문을 조회 할 수 있다. (상태, 유저의 email로 필터가 가능하다)
-
Notifications
You must be signed in to change notification settings - Fork 1
dleo9307/mikro-orm-test
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published