@fas-core/shared-types 1.0.23 → 1.0.26
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 +42 -4
- package/dist/index.d.ts +42 -4
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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
|
+
order: IOrder;
|
|
330
|
+
currency: ICurrency;
|
|
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,19 +359,21 @@ declare const OrderStatusEnum: {
|
|
|
323
359
|
readonly PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED";
|
|
324
360
|
};
|
|
325
361
|
type OrderStatusEnum = (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum];
|
|
326
|
-
declare const ORDER_STATUS_VALUES: ("PENDING" | "
|
|
362
|
+
declare const ORDER_STATUS_VALUES: ("PENDING" | "FAILED" | "CANCELED" | "PARTIALLY_REFUNDED" | "REFUNDED" | "CONFIRMED" | "PROCESSING" | "SHIPPED" | "DELIVERED")[];
|
|
327
363
|
declare const statusColors: Record<OrderStatusEnum, string>;
|
|
328
364
|
interface IOrder extends BaseEntity {
|
|
329
365
|
orderId: string;
|
|
330
366
|
orderItems: IOrderItem[];
|
|
331
|
-
user
|
|
332
|
-
coupon
|
|
367
|
+
user: ICustomer;
|
|
368
|
+
coupon: ICoupon;
|
|
333
369
|
store: IStore;
|
|
334
370
|
status: OrderStatusEnum;
|
|
335
371
|
subTotalAmount: number;
|
|
336
372
|
discountAmount: number;
|
|
337
373
|
totalAmount: number;
|
|
338
374
|
metaData: Metadata;
|
|
375
|
+
orderTransactions: IOrderTransaction[];
|
|
376
|
+
refundTransactions: IRefundTransaction[];
|
|
339
377
|
}
|
|
340
378
|
|
|
341
379
|
interface ICartItem extends BaseEntity {
|
|
@@ -363,4 +401,4 @@ interface ICart extends BaseEntity {
|
|
|
363
401
|
totalAmount: number;
|
|
364
402
|
}
|
|
365
403
|
|
|
366
|
-
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, ORDER_STATUS_VALUES, OrderStatusEnum, type Paginated, type SoftDeleteFilter, type StockStatus, statusColors };
|
|
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
|
+
order: IOrder;
|
|
330
|
+
currency: ICurrency;
|
|
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,19 +359,21 @@ declare const OrderStatusEnum: {
|
|
|
323
359
|
readonly PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED";
|
|
324
360
|
};
|
|
325
361
|
type OrderStatusEnum = (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum];
|
|
326
|
-
declare const ORDER_STATUS_VALUES: ("PENDING" | "
|
|
362
|
+
declare const ORDER_STATUS_VALUES: ("PENDING" | "FAILED" | "CANCELED" | "PARTIALLY_REFUNDED" | "REFUNDED" | "CONFIRMED" | "PROCESSING" | "SHIPPED" | "DELIVERED")[];
|
|
327
363
|
declare const statusColors: Record<OrderStatusEnum, string>;
|
|
328
364
|
interface IOrder extends BaseEntity {
|
|
329
365
|
orderId: string;
|
|
330
366
|
orderItems: IOrderItem[];
|
|
331
|
-
user
|
|
332
|
-
coupon
|
|
367
|
+
user: ICustomer;
|
|
368
|
+
coupon: ICoupon;
|
|
333
369
|
store: IStore;
|
|
334
370
|
status: OrderStatusEnum;
|
|
335
371
|
subTotalAmount: number;
|
|
336
372
|
discountAmount: number;
|
|
337
373
|
totalAmount: number;
|
|
338
374
|
metaData: Metadata;
|
|
375
|
+
orderTransactions: IOrderTransaction[];
|
|
376
|
+
refundTransactions: IRefundTransaction[];
|
|
339
377
|
}
|
|
340
378
|
|
|
341
379
|
interface ICartItem extends BaseEntity {
|
|
@@ -363,4 +401,4 @@ interface ICart extends BaseEntity {
|
|
|
363
401
|
totalAmount: number;
|
|
364
402
|
}
|
|
365
403
|
|
|
366
|
-
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, ORDER_STATUS_VALUES, OrderStatusEnum, type Paginated, type SoftDeleteFilter, type StockStatus, statusColors };
|
|
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
|
@@ -24,6 +24,8 @@ __export(index_exports, {
|
|
|
24
24
|
DiscountTypeEnum: () => DiscountTypeEnum,
|
|
25
25
|
ORDER_STATUS_VALUES: () => ORDER_STATUS_VALUES,
|
|
26
26
|
OrderStatusEnum: () => OrderStatusEnum,
|
|
27
|
+
TransactionStatusEnum: () => TransactionStatusEnum,
|
|
28
|
+
TransactionTypeEnum: () => TransactionTypeEnum,
|
|
27
29
|
statusColors: () => statusColors
|
|
28
30
|
});
|
|
29
31
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -70,4 +72,18 @@ var statusColors = {
|
|
|
70
72
|
[OrderStatusEnum.REFUNDED]: "orange",
|
|
71
73
|
[OrderStatusEnum.PARTIALLY_REFUNDED]: "magenta"
|
|
72
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
|
+
};
|
|
73
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'
|
|
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\";\nimport type { IOrder } from \"../order\";\nimport type { ICurrency } from \"../currency\";\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 order: IOrder;\n currency: ICurrency;\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;;;AC7BO,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
|
@@ -40,11 +40,27 @@ var statusColors = {
|
|
|
40
40
|
[OrderStatusEnum.REFUNDED]: "orange",
|
|
41
41
|
[OrderStatusEnum.PARTIALLY_REFUNDED]: "magenta"
|
|
42
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
|
+
};
|
|
43
57
|
export {
|
|
44
58
|
ADMIN_ROLES,
|
|
45
59
|
DiscountTypeEnum,
|
|
46
60
|
ORDER_STATUS_VALUES,
|
|
47
61
|
OrderStatusEnum,
|
|
62
|
+
TransactionStatusEnum,
|
|
63
|
+
TransactionTypeEnum,
|
|
48
64
|
statusColors
|
|
49
65
|
};
|
|
50
66
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -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 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
|
|
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\";\nimport type { IOrder } from \"../order\";\nimport type { ICurrency } from \"../currency\";\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 order: IOrder;\n currency: ICurrency;\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;;;AC7BO,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