@fas-core/shared-types 1.0.22 → 1.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -311,6 +311,42 @@ interface IOrderItem extends BaseEntity {
311
311
  metaData: Metadata;
312
312
  }
313
313
 
314
+ declare const TransactionTypeEnum: {
315
+ readonly ORDER: "ORDER";
316
+ readonly REFUND: "REFUND";
317
+ };
318
+ type TransactionTypeEnum = (typeof TransactionTypeEnum)[keyof typeof TransactionTypeEnum];
319
+ declare const TransactionStatusEnum: {
320
+ readonly PENDING: "PENDING";
321
+ readonly SUCCESS: "SUCCESS";
322
+ readonly FAILED: "FAILED";
323
+ readonly CANCELED: "CANCELED";
324
+ readonly PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED";
325
+ readonly REFUNDED: "REFUNDED";
326
+ };
327
+ type TransactionStatusEnum = (typeof TransactionStatusEnum)[keyof typeof TransactionStatusEnum];
328
+ interface ITransactionBase extends BaseEntity {
329
+ orderId: string;
330
+ currencyId?: string;
331
+ transactionId: string;
332
+ amount: number;
333
+ status: TransactionStatusEnum;
334
+ paymentMethod?: string;
335
+ gatewayId?: string;
336
+ metaData?: Metadata;
337
+ comment?: string;
338
+ isPaymentLink?: boolean;
339
+ refundedAmount?: number;
340
+ proofFileId?: string;
341
+ }
342
+ interface IOrderTransaction extends ITransactionBase {
343
+ type: typeof TransactionTypeEnum.ORDER;
344
+ }
345
+ interface IRefundTransaction extends ITransactionBase {
346
+ type: typeof TransactionTypeEnum.REFUND;
347
+ originalTransactionId?: string;
348
+ }
349
+
314
350
  declare const OrderStatusEnum: {
315
351
  readonly PENDING: "PENDING";
316
352
  readonly CONFIRMED: "CONFIRMED";
@@ -323,17 +359,21 @@ declare const OrderStatusEnum: {
323
359
  readonly PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED";
324
360
  };
325
361
  type OrderStatusEnum = (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum];
362
+ declare const ORDER_STATUS_VALUES: ("PENDING" | "FAILED" | "CANCELED" | "PARTIALLY_REFUNDED" | "REFUNDED" | "CONFIRMED" | "PROCESSING" | "SHIPPED" | "DELIVERED")[];
363
+ declare const statusColors: Record<OrderStatusEnum, string>;
326
364
  interface IOrder extends BaseEntity {
327
365
  orderId: string;
328
366
  orderItems: IOrderItem[];
329
- user?: ICustomer;
330
- coupon?: ICoupon;
367
+ user: ICustomer;
368
+ coupon: ICoupon;
331
369
  store: IStore;
332
370
  status: OrderStatusEnum;
333
371
  subTotalAmount: number;
334
372
  discountAmount: number;
335
373
  totalAmount: number;
336
374
  metaData: Metadata;
375
+ orderTransactions: IOrderTransaction[];
376
+ refundTransactions: IRefundTransaction[];
337
377
  }
338
378
 
339
379
  interface ICartItem extends BaseEntity {
@@ -361,4 +401,4 @@ interface ICart extends BaseEntity {
361
401
  totalAmount: number;
362
402
  }
363
403
 
364
- export { ADMIN_ROLES, type ApiResponse, type BaseEntity, DiscountTypeEnum, type IAddress, type IAdmin, type IAdminCreate, type IAdminRoleType, type IAdminSafe, type IAdminUpdate, type IBrand, type ICart, type ICartItem, type ICategory, type ICompliance, type IContact, type IContent, type ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IDocumentation, type IOrder, type IOrderItem, type IPrice, type IProduct, type IRelationships, type ISEOMetaData, type IShipping, type IState, type IStock, type IStore, type IStoreSettings, type ITechSpec, type IVariant, type Metadata, OrderStatusEnum, type Paginated, type SoftDeleteFilter, type StockStatus };
404
+ export { ADMIN_ROLES, type ApiResponse, type BaseEntity, DiscountTypeEnum, type IAddress, type IAdmin, type IAdminCreate, type IAdminRoleType, type IAdminSafe, type IAdminUpdate, type IBrand, type ICart, type ICartItem, type ICategory, type ICompliance, type IContact, type IContent, type ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IDocumentation, type IOrder, type IOrderItem, type IOrderTransaction, type IPrice, type IProduct, type IRefundTransaction, type IRelationships, type ISEOMetaData, type IShipping, type IState, type IStock, type IStore, type IStoreSettings, type ITechSpec, type ITransactionBase, type IVariant, type Metadata, ORDER_STATUS_VALUES, OrderStatusEnum, type Paginated, type SoftDeleteFilter, type StockStatus, TransactionStatusEnum, TransactionTypeEnum, statusColors };
package/dist/index.d.ts CHANGED
@@ -311,6 +311,42 @@ interface IOrderItem extends BaseEntity {
311
311
  metaData: Metadata;
312
312
  }
313
313
 
314
+ declare const TransactionTypeEnum: {
315
+ readonly ORDER: "ORDER";
316
+ readonly REFUND: "REFUND";
317
+ };
318
+ type TransactionTypeEnum = (typeof TransactionTypeEnum)[keyof typeof TransactionTypeEnum];
319
+ declare const TransactionStatusEnum: {
320
+ readonly PENDING: "PENDING";
321
+ readonly SUCCESS: "SUCCESS";
322
+ readonly FAILED: "FAILED";
323
+ readonly CANCELED: "CANCELED";
324
+ readonly PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED";
325
+ readonly REFUNDED: "REFUNDED";
326
+ };
327
+ type TransactionStatusEnum = (typeof TransactionStatusEnum)[keyof typeof TransactionStatusEnum];
328
+ interface ITransactionBase extends BaseEntity {
329
+ orderId: string;
330
+ currencyId?: string;
331
+ transactionId: string;
332
+ amount: number;
333
+ status: TransactionStatusEnum;
334
+ paymentMethod?: string;
335
+ gatewayId?: string;
336
+ metaData?: Metadata;
337
+ comment?: string;
338
+ isPaymentLink?: boolean;
339
+ refundedAmount?: number;
340
+ proofFileId?: string;
341
+ }
342
+ interface IOrderTransaction extends ITransactionBase {
343
+ type: typeof TransactionTypeEnum.ORDER;
344
+ }
345
+ interface IRefundTransaction extends ITransactionBase {
346
+ type: typeof TransactionTypeEnum.REFUND;
347
+ originalTransactionId?: string;
348
+ }
349
+
314
350
  declare const OrderStatusEnum: {
315
351
  readonly PENDING: "PENDING";
316
352
  readonly CONFIRMED: "CONFIRMED";
@@ -323,17 +359,21 @@ declare const OrderStatusEnum: {
323
359
  readonly PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED";
324
360
  };
325
361
  type OrderStatusEnum = (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum];
362
+ declare const ORDER_STATUS_VALUES: ("PENDING" | "FAILED" | "CANCELED" | "PARTIALLY_REFUNDED" | "REFUNDED" | "CONFIRMED" | "PROCESSING" | "SHIPPED" | "DELIVERED")[];
363
+ declare const statusColors: Record<OrderStatusEnum, string>;
326
364
  interface IOrder extends BaseEntity {
327
365
  orderId: string;
328
366
  orderItems: IOrderItem[];
329
- user?: ICustomer;
330
- coupon?: ICoupon;
367
+ user: ICustomer;
368
+ coupon: ICoupon;
331
369
  store: IStore;
332
370
  status: OrderStatusEnum;
333
371
  subTotalAmount: number;
334
372
  discountAmount: number;
335
373
  totalAmount: number;
336
374
  metaData: Metadata;
375
+ orderTransactions: IOrderTransaction[];
376
+ refundTransactions: IRefundTransaction[];
337
377
  }
338
378
 
339
379
  interface ICartItem extends BaseEntity {
@@ -361,4 +401,4 @@ interface ICart extends BaseEntity {
361
401
  totalAmount: number;
362
402
  }
363
403
 
364
- export { ADMIN_ROLES, type ApiResponse, type BaseEntity, DiscountTypeEnum, type IAddress, type IAdmin, type IAdminCreate, type IAdminRoleType, type IAdminSafe, type IAdminUpdate, type IBrand, type ICart, type ICartItem, type ICategory, type ICompliance, type IContact, type IContent, type ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IDocumentation, type IOrder, type IOrderItem, type IPrice, type IProduct, type IRelationships, type ISEOMetaData, type IShipping, type IState, type IStock, type IStore, type IStoreSettings, type ITechSpec, type IVariant, type Metadata, OrderStatusEnum, type Paginated, type SoftDeleteFilter, type StockStatus };
404
+ export { ADMIN_ROLES, type ApiResponse, type BaseEntity, DiscountTypeEnum, type IAddress, type IAdmin, type IAdminCreate, type IAdminRoleType, type IAdminSafe, type IAdminUpdate, type IBrand, type ICart, type ICartItem, type ICategory, type ICompliance, type IContact, type IContent, type ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IDocumentation, type IOrder, type IOrderItem, type IOrderTransaction, type IPrice, type IProduct, type IRefundTransaction, type IRelationships, type ISEOMetaData, type IShipping, type IState, type IStock, type IStore, type IStoreSettings, type ITechSpec, type ITransactionBase, type IVariant, type Metadata, ORDER_STATUS_VALUES, OrderStatusEnum, type Paginated, type SoftDeleteFilter, type StockStatus, TransactionStatusEnum, TransactionTypeEnum, statusColors };
package/dist/index.js CHANGED
@@ -22,7 +22,11 @@ var index_exports = {};
22
22
  __export(index_exports, {
23
23
  ADMIN_ROLES: () => ADMIN_ROLES,
24
24
  DiscountTypeEnum: () => DiscountTypeEnum,
25
- OrderStatusEnum: () => OrderStatusEnum
25
+ ORDER_STATUS_VALUES: () => ORDER_STATUS_VALUES,
26
+ OrderStatusEnum: () => OrderStatusEnum,
27
+ TransactionStatusEnum: () => TransactionStatusEnum,
28
+ TransactionTypeEnum: () => TransactionTypeEnum,
29
+ statusColors: () => statusColors
26
30
  });
27
31
  module.exports = __toCommonJS(index_exports);
28
32
 
@@ -56,4 +60,30 @@ var OrderStatusEnum = {
56
60
  REFUNDED: "REFUNDED",
57
61
  PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED"
58
62
  };
63
+ var ORDER_STATUS_VALUES = Object.values(OrderStatusEnum);
64
+ var statusColors = {
65
+ [OrderStatusEnum.PENDING]: "gold",
66
+ [OrderStatusEnum.CONFIRMED]: "blue",
67
+ [OrderStatusEnum.PROCESSING]: "cyan",
68
+ [OrderStatusEnum.SHIPPED]: "purple",
69
+ [OrderStatusEnum.DELIVERED]: "green",
70
+ [OrderStatusEnum.CANCELED]: "volcano",
71
+ [OrderStatusEnum.FAILED]: "red",
72
+ [OrderStatusEnum.REFUNDED]: "orange",
73
+ [OrderStatusEnum.PARTIALLY_REFUNDED]: "magenta"
74
+ };
75
+
76
+ // src/transaction/interface.ts
77
+ var TransactionTypeEnum = {
78
+ ORDER: "ORDER",
79
+ REFUND: "REFUND"
80
+ };
81
+ var TransactionStatusEnum = {
82
+ PENDING: "PENDING",
83
+ SUCCESS: "SUCCESS",
84
+ FAILED: "FAILED",
85
+ CANCELED: "CANCELED",
86
+ PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED",
87
+ REFUNDED: "REFUNDED"
88
+ };
59
89
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/admin/interface.ts","../src/coupon/interface.ts","../src/order/interface.ts"],"sourcesContent":["export * from './address';\nexport * from './admin';\nexport * from './base';\nexport * from './common';\nexport * from './country';\nexport * from './customer';\nexport * from './state';\nexport * from './store';\nexport * from './currency';\nexport * from './contact';\nexport * from './coupon';\nexport * from './product';\nexport * from './variant';\nexport * from './order';\nexport * from './orderItem';\nexport * from './cart';\nexport * from './cartItem';\nexport * from './category';\nexport * from './brand';\nexport * from './stock';","import type { BaseEntity } from '../base/interface';\n\nexport type IAdminRoleType =\n | 'Admin'\n | 'Super Admin'\n | 'Cashier'\n | 'Manager'\n | 'CEO'\n | 'Driver'\n | 'Security Guard'\n | 'Accountant';\n\nexport const ADMIN_ROLES: IAdminRoleType[] = [\n 'Admin',\n 'Super Admin',\n 'Cashier',\n 'Manager',\n 'CEO',\n 'Driver',\n 'Security Guard',\n 'Accountant',\n];\n\nexport interface IAdmin extends BaseEntity {\n firstName: string;\n lastName: string;\n email: string;\n phoneNumber: string;\n status: boolean;\n password: string;\n role: IAdminRoleType;\n access_list: string[];\n joiningDate: Date;\n profileImage: string;\n lastLogin: Date;\n}\n\nexport type IAdminCreate = Omit<IAdmin, keyof BaseEntity>;\nexport type IAdminUpdate = Partial<IAdminCreate>;\nexport type IAdminSafe = Omit<IAdmin, 'password'>;\n","import type { BaseEntity } from \"../base\";\nimport type { IStore } from \"../store\";\n\nexport const DiscountTypeEnum = {\n PERCENTAGE: \"PERCENTAGE\",\n FIXED: \"FIXED\",\n} as const;\n\nexport type DiscountTypeEnum = (typeof DiscountTypeEnum)[keyof typeof DiscountTypeEnum];\n\nexport interface IDiscountType {\n type: DiscountTypeEnum;\n value: number;\n}\n\nexport interface ICoupon extends BaseEntity {\n title: string;\n couponCode: string;\n startTime: Date;\n endTime: Date;\n discountType: IDiscountType;\n minimumAmount: number;\n isPromotional: boolean;\n status: boolean;\n stores: IStore[];\n}\n","import type { BaseEntity } from \"../base\";\nimport type { Metadata } from \"../common\";\nimport type { ICoupon } from \"../coupon\";\nimport type { ICustomer } from \"../customer\";\nimport type { IOrderItem } from \"../orderItem\";\nimport type { IStore } from \"../store\";\n\nexport const OrderStatusEnum = {\n PENDING: \"PENDING\",\n CONFIRMED: \"CONFIRMED\",\n PROCESSING: \"PROCESSING\",\n SHIPPED: \"SHIPPED\",\n DELIVERED: \"DELIVERED\",\n CANCELED: \"CANCELED\",\n FAILED: \"FAILED\",\n REFUNDED: \"REFUNDED\",\n PARTIALLY_REFUNDED: \"PARTIALLY_REFUNDED\",\n} as const;\n\nexport type OrderStatusEnum = (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum];\n\nexport interface IOrder extends BaseEntity {\n orderId: string;\n orderItems: IOrderItem[];\n user?: ICustomer;\n coupon?: ICoupon;\n store: IStore;\n status: OrderStatusEnum;\n subTotalAmount: number;\n discountAmount: number;\n totalAmount: number;\n metaData: Metadata;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACYO,IAAM,cAAgC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;;;AClBO,IAAM,mBAAmB;AAAA,EAC5B,YAAY;AAAA,EACZ,OAAO;AACX;;;ACCO,IAAM,kBAAkB;AAAA,EAC3B,SAAS;AAAA,EACT,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,WAAW;AAAA,EACX,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,oBAAoB;AACxB;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/admin/interface.ts","../src/coupon/interface.ts","../src/order/interface.ts","../src/transaction/interface.ts"],"sourcesContent":["export * from './address';\nexport * from './admin';\nexport * from './base';\nexport * from './common';\nexport * from './country';\nexport * from './customer';\nexport * from './state';\nexport * from './store';\nexport * from './currency';\nexport * from './contact';\nexport * from './coupon';\nexport * from './product';\nexport * from './variant';\nexport * from './order';\nexport * from './orderItem';\nexport * from './cart';\nexport * from './cartItem';\nexport * from './category';\nexport * from './brand';\nexport * from './stock';\nexport * from './transaction';\n","import type { BaseEntity } from '../base/interface';\n\nexport type IAdminRoleType =\n | 'Admin'\n | 'Super Admin'\n | 'Cashier'\n | 'Manager'\n | 'CEO'\n | 'Driver'\n | 'Security Guard'\n | 'Accountant';\n\nexport const ADMIN_ROLES: IAdminRoleType[] = [\n 'Admin',\n 'Super Admin',\n 'Cashier',\n 'Manager',\n 'CEO',\n 'Driver',\n 'Security Guard',\n 'Accountant',\n];\n\nexport interface IAdmin extends BaseEntity {\n firstName: string;\n lastName: string;\n email: string;\n phoneNumber: string;\n status: boolean;\n password: string;\n role: IAdminRoleType;\n access_list: string[];\n joiningDate: Date;\n profileImage: string;\n lastLogin: Date;\n}\n\nexport type IAdminCreate = Omit<IAdmin, keyof BaseEntity>;\nexport type IAdminUpdate = Partial<IAdminCreate>;\nexport type IAdminSafe = Omit<IAdmin, 'password'>;\n","import type { BaseEntity } from \"../base\";\nimport type { IStore } from \"../store\";\n\nexport const DiscountTypeEnum = {\n PERCENTAGE: \"PERCENTAGE\",\n FIXED: \"FIXED\",\n} as const;\n\nexport type DiscountTypeEnum = (typeof DiscountTypeEnum)[keyof typeof DiscountTypeEnum];\n\nexport interface IDiscountType {\n type: DiscountTypeEnum;\n value: number;\n}\n\nexport interface ICoupon extends BaseEntity {\n title: string;\n couponCode: string;\n startTime: Date;\n endTime: Date;\n discountType: IDiscountType;\n minimumAmount: number;\n isPromotional: boolean;\n status: boolean;\n stores: IStore[];\n}\n","import type { BaseEntity } from \"../base\";\nimport type { Metadata } from \"../common\";\nimport type { ICoupon } from \"../coupon\";\nimport type { ICustomer } from \"../customer\";\nimport type { IOrderItem } from \"../orderItem\";\nimport type { IStore } from \"../store\";\nimport type { IOrderTransaction, IRefundTransaction } from \"../transaction\";\n\nexport const OrderStatusEnum = {\n PENDING: \"PENDING\",\n CONFIRMED: \"CONFIRMED\",\n PROCESSING: \"PROCESSING\",\n SHIPPED: \"SHIPPED\",\n DELIVERED: \"DELIVERED\",\n CANCELED: \"CANCELED\",\n FAILED: \"FAILED\",\n REFUNDED: \"REFUNDED\",\n PARTIALLY_REFUNDED: \"PARTIALLY_REFUNDED\",\n} as const;\n\nexport type OrderStatusEnum = (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum];\n\nexport const ORDER_STATUS_VALUES = Object.values(OrderStatusEnum);\n\nexport const statusColors: Record<OrderStatusEnum, string> = {\n [OrderStatusEnum.PENDING]: \"gold\",\n [OrderStatusEnum.CONFIRMED]: \"blue\",\n [OrderStatusEnum.PROCESSING]: \"cyan\",\n [OrderStatusEnum.SHIPPED]: \"purple\",\n [OrderStatusEnum.DELIVERED]: \"green\",\n [OrderStatusEnum.CANCELED]: \"volcano\",\n [OrderStatusEnum.FAILED]: \"red\",\n [OrderStatusEnum.REFUNDED]: \"orange\",\n [OrderStatusEnum.PARTIALLY_REFUNDED]: \"magenta\",\n};\n\nexport interface IOrder extends BaseEntity {\n orderId: string;\n orderItems: IOrderItem[];\n user: ICustomer;\n coupon: ICoupon;\n store: IStore;\n status: OrderStatusEnum;\n subTotalAmount: number;\n discountAmount: number;\n totalAmount: number;\n metaData: Metadata;\n orderTransactions: IOrderTransaction[];\n refundTransactions: IRefundTransaction[];\n}","import type { BaseEntity } from \"../base\";\nimport type { Metadata } from \"../common\";\n\nexport const TransactionTypeEnum = {\n ORDER: \"ORDER\",\n REFUND: \"REFUND\",\n} as const;\n\nexport type TransactionTypeEnum = (typeof TransactionTypeEnum)[keyof typeof TransactionTypeEnum];\n\nexport const TransactionStatusEnum = {\n PENDING: \"PENDING\",\n SUCCESS: \"SUCCESS\",\n FAILED: \"FAILED\",\n CANCELED: \"CANCELED\",\n PARTIALLY_REFUNDED: \"PARTIALLY_REFUNDED\",\n REFUNDED: \"REFUNDED\",\n} as const;\n\nexport type TransactionStatusEnum = (typeof TransactionStatusEnum)[keyof typeof TransactionStatusEnum];\n\nexport interface ITransactionBase extends BaseEntity {\n orderId: string;\n currencyId?: string;\n transactionId: string;\n amount: number;\n status: TransactionStatusEnum;\n paymentMethod?: string;\n gatewayId?: string;\n metaData?: Metadata;\n comment?: string;\n isPaymentLink?: boolean;\n refundedAmount?: number;\n proofFileId?: string;\n}\n\nexport interface IOrderTransaction extends ITransactionBase {\n type: typeof TransactionTypeEnum.ORDER;\n}\n\nexport interface IRefundTransaction extends ITransactionBase {\n type: typeof TransactionTypeEnum.REFUND;\n originalTransactionId?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACYO,IAAM,cAAgC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;;;AClBO,IAAM,mBAAmB;AAAA,EAC5B,YAAY;AAAA,EACZ,OAAO;AACX;;;ACEO,IAAM,kBAAkB;AAAA,EAC3B,SAAS;AAAA,EACT,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,WAAW;AAAA,EACX,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,oBAAoB;AACxB;AAIO,IAAM,sBAAsB,OAAO,OAAO,eAAe;AAEzD,IAAM,eAAgD;AAAA,EACzD,CAAC,gBAAgB,OAAO,GAAG;AAAA,EAC3B,CAAC,gBAAgB,SAAS,GAAG;AAAA,EAC7B,CAAC,gBAAgB,UAAU,GAAG;AAAA,EAC9B,CAAC,gBAAgB,OAAO,GAAG;AAAA,EAC3B,CAAC,gBAAgB,SAAS,GAAG;AAAA,EAC7B,CAAC,gBAAgB,QAAQ,GAAG;AAAA,EAC5B,CAAC,gBAAgB,MAAM,GAAG;AAAA,EAC1B,CAAC,gBAAgB,QAAQ,GAAG;AAAA,EAC5B,CAAC,gBAAgB,kBAAkB,GAAG;AAC1C;;;AC/BO,IAAM,sBAAsB;AAAA,EAC/B,OAAO;AAAA,EACP,QAAQ;AACZ;AAIO,IAAM,wBAAwB;AAAA,EACjC,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,UAAU;AACd;","names":[]}
package/dist/index.mjs CHANGED
@@ -28,9 +28,39 @@ var OrderStatusEnum = {
28
28
  REFUNDED: "REFUNDED",
29
29
  PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED"
30
30
  };
31
+ var ORDER_STATUS_VALUES = Object.values(OrderStatusEnum);
32
+ var statusColors = {
33
+ [OrderStatusEnum.PENDING]: "gold",
34
+ [OrderStatusEnum.CONFIRMED]: "blue",
35
+ [OrderStatusEnum.PROCESSING]: "cyan",
36
+ [OrderStatusEnum.SHIPPED]: "purple",
37
+ [OrderStatusEnum.DELIVERED]: "green",
38
+ [OrderStatusEnum.CANCELED]: "volcano",
39
+ [OrderStatusEnum.FAILED]: "red",
40
+ [OrderStatusEnum.REFUNDED]: "orange",
41
+ [OrderStatusEnum.PARTIALLY_REFUNDED]: "magenta"
42
+ };
43
+
44
+ // src/transaction/interface.ts
45
+ var TransactionTypeEnum = {
46
+ ORDER: "ORDER",
47
+ REFUND: "REFUND"
48
+ };
49
+ var TransactionStatusEnum = {
50
+ PENDING: "PENDING",
51
+ SUCCESS: "SUCCESS",
52
+ FAILED: "FAILED",
53
+ CANCELED: "CANCELED",
54
+ PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED",
55
+ REFUNDED: "REFUNDED"
56
+ };
31
57
  export {
32
58
  ADMIN_ROLES,
33
59
  DiscountTypeEnum,
34
- OrderStatusEnum
60
+ ORDER_STATUS_VALUES,
61
+ OrderStatusEnum,
62
+ TransactionStatusEnum,
63
+ TransactionTypeEnum,
64
+ statusColors
35
65
  };
36
66
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/admin/interface.ts","../src/coupon/interface.ts","../src/order/interface.ts"],"sourcesContent":["import type { BaseEntity } from '../base/interface';\n\nexport type IAdminRoleType =\n | 'Admin'\n | 'Super Admin'\n | 'Cashier'\n | 'Manager'\n | 'CEO'\n | 'Driver'\n | 'Security Guard'\n | 'Accountant';\n\nexport const ADMIN_ROLES: IAdminRoleType[] = [\n 'Admin',\n 'Super Admin',\n 'Cashier',\n 'Manager',\n 'CEO',\n 'Driver',\n 'Security Guard',\n 'Accountant',\n];\n\nexport interface IAdmin extends BaseEntity {\n firstName: string;\n lastName: string;\n email: string;\n phoneNumber: string;\n status: boolean;\n password: string;\n role: IAdminRoleType;\n access_list: string[];\n joiningDate: Date;\n profileImage: string;\n lastLogin: Date;\n}\n\nexport type IAdminCreate = Omit<IAdmin, keyof BaseEntity>;\nexport type IAdminUpdate = Partial<IAdminCreate>;\nexport type IAdminSafe = Omit<IAdmin, 'password'>;\n","import type { BaseEntity } from \"../base\";\nimport type { IStore } from \"../store\";\n\nexport const DiscountTypeEnum = {\n PERCENTAGE: \"PERCENTAGE\",\n FIXED: \"FIXED\",\n} as const;\n\nexport type DiscountTypeEnum = (typeof DiscountTypeEnum)[keyof typeof DiscountTypeEnum];\n\nexport interface IDiscountType {\n type: DiscountTypeEnum;\n value: number;\n}\n\nexport interface ICoupon extends BaseEntity {\n title: string;\n couponCode: string;\n startTime: Date;\n endTime: Date;\n discountType: IDiscountType;\n minimumAmount: number;\n isPromotional: boolean;\n status: boolean;\n stores: IStore[];\n}\n","import type { BaseEntity } from \"../base\";\nimport type { Metadata } from \"../common\";\nimport type { ICoupon } from \"../coupon\";\nimport type { ICustomer } from \"../customer\";\nimport type { IOrderItem } from \"../orderItem\";\nimport type { IStore } from \"../store\";\n\nexport const OrderStatusEnum = {\n PENDING: \"PENDING\",\n CONFIRMED: \"CONFIRMED\",\n PROCESSING: \"PROCESSING\",\n SHIPPED: \"SHIPPED\",\n DELIVERED: \"DELIVERED\",\n CANCELED: \"CANCELED\",\n FAILED: \"FAILED\",\n REFUNDED: \"REFUNDED\",\n PARTIALLY_REFUNDED: \"PARTIALLY_REFUNDED\",\n} as const;\n\nexport type OrderStatusEnum = (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum];\n\nexport interface IOrder extends BaseEntity {\n orderId: string;\n orderItems: IOrderItem[];\n user?: ICustomer;\n coupon?: ICoupon;\n store: IStore;\n status: OrderStatusEnum;\n subTotalAmount: number;\n discountAmount: number;\n totalAmount: number;\n metaData: Metadata;\n}\n"],"mappings":";AAYO,IAAM,cAAgC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;;;AClBO,IAAM,mBAAmB;AAAA,EAC5B,YAAY;AAAA,EACZ,OAAO;AACX;;;ACCO,IAAM,kBAAkB;AAAA,EAC3B,SAAS;AAAA,EACT,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,WAAW;AAAA,EACX,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,oBAAoB;AACxB;","names":[]}
1
+ {"version":3,"sources":["../src/admin/interface.ts","../src/coupon/interface.ts","../src/order/interface.ts","../src/transaction/interface.ts"],"sourcesContent":["import type { BaseEntity } from '../base/interface';\n\nexport type IAdminRoleType =\n | 'Admin'\n | 'Super Admin'\n | 'Cashier'\n | 'Manager'\n | 'CEO'\n | 'Driver'\n | 'Security Guard'\n | 'Accountant';\n\nexport const ADMIN_ROLES: IAdminRoleType[] = [\n 'Admin',\n 'Super Admin',\n 'Cashier',\n 'Manager',\n 'CEO',\n 'Driver',\n 'Security Guard',\n 'Accountant',\n];\n\nexport interface IAdmin extends BaseEntity {\n firstName: string;\n lastName: string;\n email: string;\n phoneNumber: string;\n status: boolean;\n password: string;\n role: IAdminRoleType;\n access_list: string[];\n joiningDate: Date;\n profileImage: string;\n lastLogin: Date;\n}\n\nexport type IAdminCreate = Omit<IAdmin, keyof BaseEntity>;\nexport type IAdminUpdate = Partial<IAdminCreate>;\nexport type IAdminSafe = Omit<IAdmin, 'password'>;\n","import type { BaseEntity } from \"../base\";\nimport type { IStore } from \"../store\";\n\nexport const DiscountTypeEnum = {\n PERCENTAGE: \"PERCENTAGE\",\n FIXED: \"FIXED\",\n} as const;\n\nexport type DiscountTypeEnum = (typeof DiscountTypeEnum)[keyof typeof DiscountTypeEnum];\n\nexport interface IDiscountType {\n type: DiscountTypeEnum;\n value: number;\n}\n\nexport interface ICoupon extends BaseEntity {\n title: string;\n couponCode: string;\n startTime: Date;\n endTime: Date;\n discountType: IDiscountType;\n minimumAmount: number;\n isPromotional: boolean;\n status: boolean;\n stores: IStore[];\n}\n","import type { BaseEntity } from \"../base\";\nimport type { Metadata } from \"../common\";\nimport type { ICoupon } from \"../coupon\";\nimport type { ICustomer } from \"../customer\";\nimport type { IOrderItem } from \"../orderItem\";\nimport type { IStore } from \"../store\";\nimport type { IOrderTransaction, IRefundTransaction } from \"../transaction\";\n\nexport const OrderStatusEnum = {\n PENDING: \"PENDING\",\n CONFIRMED: \"CONFIRMED\",\n PROCESSING: \"PROCESSING\",\n SHIPPED: \"SHIPPED\",\n DELIVERED: \"DELIVERED\",\n CANCELED: \"CANCELED\",\n FAILED: \"FAILED\",\n REFUNDED: \"REFUNDED\",\n PARTIALLY_REFUNDED: \"PARTIALLY_REFUNDED\",\n} as const;\n\nexport type OrderStatusEnum = (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum];\n\nexport const ORDER_STATUS_VALUES = Object.values(OrderStatusEnum);\n\nexport const statusColors: Record<OrderStatusEnum, string> = {\n [OrderStatusEnum.PENDING]: \"gold\",\n [OrderStatusEnum.CONFIRMED]: \"blue\",\n [OrderStatusEnum.PROCESSING]: \"cyan\",\n [OrderStatusEnum.SHIPPED]: \"purple\",\n [OrderStatusEnum.DELIVERED]: \"green\",\n [OrderStatusEnum.CANCELED]: \"volcano\",\n [OrderStatusEnum.FAILED]: \"red\",\n [OrderStatusEnum.REFUNDED]: \"orange\",\n [OrderStatusEnum.PARTIALLY_REFUNDED]: \"magenta\",\n};\n\nexport interface IOrder extends BaseEntity {\n orderId: string;\n orderItems: IOrderItem[];\n user: ICustomer;\n coupon: ICoupon;\n store: IStore;\n status: OrderStatusEnum;\n subTotalAmount: number;\n discountAmount: number;\n totalAmount: number;\n metaData: Metadata;\n orderTransactions: IOrderTransaction[];\n refundTransactions: IRefundTransaction[];\n}","import type { BaseEntity } from \"../base\";\nimport type { Metadata } from \"../common\";\n\nexport const TransactionTypeEnum = {\n ORDER: \"ORDER\",\n REFUND: \"REFUND\",\n} as const;\n\nexport type TransactionTypeEnum = (typeof TransactionTypeEnum)[keyof typeof TransactionTypeEnum];\n\nexport const TransactionStatusEnum = {\n PENDING: \"PENDING\",\n SUCCESS: \"SUCCESS\",\n FAILED: \"FAILED\",\n CANCELED: \"CANCELED\",\n PARTIALLY_REFUNDED: \"PARTIALLY_REFUNDED\",\n REFUNDED: \"REFUNDED\",\n} as const;\n\nexport type TransactionStatusEnum = (typeof TransactionStatusEnum)[keyof typeof TransactionStatusEnum];\n\nexport interface ITransactionBase extends BaseEntity {\n orderId: string;\n currencyId?: string;\n transactionId: string;\n amount: number;\n status: TransactionStatusEnum;\n paymentMethod?: string;\n gatewayId?: string;\n metaData?: Metadata;\n comment?: string;\n isPaymentLink?: boolean;\n refundedAmount?: number;\n proofFileId?: string;\n}\n\nexport interface IOrderTransaction extends ITransactionBase {\n type: typeof TransactionTypeEnum.ORDER;\n}\n\nexport interface IRefundTransaction extends ITransactionBase {\n type: typeof TransactionTypeEnum.REFUND;\n originalTransactionId?: string;\n}\n"],"mappings":";AAYO,IAAM,cAAgC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;;;AClBO,IAAM,mBAAmB;AAAA,EAC5B,YAAY;AAAA,EACZ,OAAO;AACX;;;ACEO,IAAM,kBAAkB;AAAA,EAC3B,SAAS;AAAA,EACT,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,WAAW;AAAA,EACX,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,oBAAoB;AACxB;AAIO,IAAM,sBAAsB,OAAO,OAAO,eAAe;AAEzD,IAAM,eAAgD;AAAA,EACzD,CAAC,gBAAgB,OAAO,GAAG;AAAA,EAC3B,CAAC,gBAAgB,SAAS,GAAG;AAAA,EAC7B,CAAC,gBAAgB,UAAU,GAAG;AAAA,EAC9B,CAAC,gBAAgB,OAAO,GAAG;AAAA,EAC3B,CAAC,gBAAgB,SAAS,GAAG;AAAA,EAC7B,CAAC,gBAAgB,QAAQ,GAAG;AAAA,EAC5B,CAAC,gBAAgB,MAAM,GAAG;AAAA,EAC1B,CAAC,gBAAgB,QAAQ,GAAG;AAAA,EAC5B,CAAC,gBAAgB,kBAAkB,GAAG;AAC1C;;;AC/BO,IAAM,sBAAsB;AAAA,EAC/B,OAAO;AAAA,EACP,QAAQ;AACZ;AAIO,IAAM,wBAAwB;AAAA,EACjC,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,UAAU;AACd;","names":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@fas-core/shared-types",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "FAS Core Shared Types - A collection of shared TypeScript types for the FAS Core SDK.",
5
5
  "author": "ibreakloops",
6
6
  "license": "UNLICENSED",
7
7
  "private": false,
8
- "main": "dist/index.cjs",
9
- "module": "dist/index.js",
8
+ "main": "dist/index.js",
9
+ "module": "dist/index.mjs",
10
10
  "types": "dist/index.d.ts",
11
11
  "files": [
12
12
  "dist"
@@ -14,8 +14,8 @@
14
14
  "exports": {
15
15
  ".": {
16
16
  "types": "./dist/index.d.ts",
17
- "import": "./dist/index.js",
18
- "require": "./dist/index.cjs"
17
+ "import": "./dist/index.mjs",
18
+ "require": "./dist/index.js"
19
19
  }
20
20
  },
21
21
  "scripts": {