Skip to content

Commit

Permalink
feat(type): ProductPrice
Browse files Browse the repository at this point in the history
Co-authored-by: S. Amir Mohammad Najafi <njfamirm@gmail.com>
  • Loading branch information
AliMD and njfamirm committed Feb 15, 2023
1 parent 4120038 commit 7fe7b32
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions core/type/src/customer-order-management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ export interface Product extends AlwatrDocumentObject {
image: Photo;
}

export interface ProductPrice extends AlwatrDocumentObject {
/**
* Product global unique id.
*/
id: string;

/**
* Product price in this list.
*/
price: number;
}

export interface Order extends AlwatrDocumentObject {
/**
* Order auto incremental unique id.
Expand Down Expand Up @@ -82,7 +94,13 @@ export interface Order extends AlwatrDocumentObject {

// -- child types --

export interface ProductPrice extends StringifyableRecord {
export interface OrderItem extends StringifyableRecord {
productId: string;
price: OrderItemPrice;
qty: number;
}

export interface OrderItemPrice extends StringifyableRecord {
/**
* Displayed price before discount
*/
Expand All @@ -94,12 +112,6 @@ export interface ProductPrice extends StringifyableRecord {
finalPrice: number;
}

export interface OrderItem extends StringifyableRecord {
productId: string;
price: ProductPrice;
qty: number;
}

export interface OrderDelivery extends StringifyableRecord {
recipientName: string;
recipientNationalCode: string;
Expand Down

0 comments on commit 7fe7b32

Please sign in to comment.