@fas-core/shared-types 1.0.28 → 1.0.29
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 +37 -19
- package/dist/index.d.ts +37 -19
- package/dist/index.js +60 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +60 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -311,35 +311,47 @@ interface IOrderItem extends BaseEntity {
|
|
|
311
311
|
metaData: Metadata;
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
+
declare const PaymentStatusEnum: {
|
|
315
|
+
readonly INITIATED: "INITIATED";
|
|
316
|
+
readonly PENDING: "PENDING";
|
|
317
|
+
readonly PROCESSING: "PROCESSING";
|
|
318
|
+
readonly FAILED: "FAILED";
|
|
319
|
+
readonly CANCELLED: "CANCELLED";
|
|
320
|
+
readonly PENDING_CAPTURE: "PENDING_CAPTURE";
|
|
321
|
+
readonly COMPLETED: "COMPLETED";
|
|
322
|
+
readonly VOIDED: "VOIDED";
|
|
323
|
+
readonly REDIRECTED_TO_GATEWAY: "REDIRECTED_TO_GATEWAY";
|
|
324
|
+
readonly UNKNOWN: "UNKNOWN";
|
|
325
|
+
readonly REFUNDED: "REFUNDED";
|
|
326
|
+
readonly PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED";
|
|
327
|
+
};
|
|
328
|
+
type PaymentStatusEnum = (typeof PaymentStatusEnum)[keyof typeof PaymentStatusEnum];
|
|
329
|
+
declare const PAYMENT_STATUS_VALUES: ("INITIATED" | "PENDING" | "PROCESSING" | "FAILED" | "CANCELLED" | "PENDING_CAPTURE" | "COMPLETED" | "VOIDED" | "REDIRECTED_TO_GATEWAY" | "UNKNOWN" | "REFUNDED" | "PARTIALLY_REFUNDED")[];
|
|
330
|
+
declare const paymentStatusColorMap: Record<PaymentStatusEnum, string>;
|
|
331
|
+
declare const PaymentMethodEnum: {
|
|
332
|
+
readonly CREDIT_CARD: "CREDIT_CARD";
|
|
333
|
+
readonly PAYPAL: "PAYPAL";
|
|
334
|
+
readonly STRIPE: "STRIPE";
|
|
335
|
+
readonly CHECK: "CHECK";
|
|
336
|
+
readonly APPLE_PAY: "APPLE_PAY";
|
|
337
|
+
};
|
|
338
|
+
type PaymentMethodEnum = (typeof PaymentMethodEnum)[keyof typeof PaymentMethodEnum];
|
|
339
|
+
declare const PAYMENT_METHOD_VALUES: ("CREDIT_CARD" | "PAYPAL" | "STRIPE" | "CHECK" | "APPLE_PAY")[];
|
|
340
|
+
declare const paymentMethodColorMap: Record<PaymentMethodEnum, string>;
|
|
314
341
|
declare const TransactionTypeEnum: {
|
|
315
342
|
readonly ORDER: "ORDER";
|
|
316
343
|
readonly REFUND: "REFUND";
|
|
317
344
|
};
|
|
318
345
|
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
|
-
/** All valid transaction status string values. */
|
|
329
|
-
declare const TRANSACTION_STATUS_VALUES: ("PENDING" | "SUCCESS" | "FAILED" | "CANCELED" | "PARTIALLY_REFUNDED" | "REFUNDED")[];
|
|
330
|
-
/** All valid transaction type string values. */
|
|
331
346
|
declare const TRANSACTION_TYPE_VALUES: ("ORDER" | "REFUND")[];
|
|
332
|
-
/** Ant Design tag color for each transaction status. */
|
|
333
|
-
declare const statusColorMap: Record<TransactionStatusEnum, string>;
|
|
334
|
-
/** Ant Design tag color for each transaction type. */
|
|
335
347
|
declare const typeColorMap: Record<TransactionTypeEnum, string>;
|
|
336
348
|
interface ITransactionBase extends BaseEntity {
|
|
337
349
|
order: IOrder;
|
|
338
350
|
currency: ICurrency;
|
|
339
351
|
transactionId: string;
|
|
340
352
|
amount: number;
|
|
341
|
-
status:
|
|
342
|
-
paymentMethod
|
|
353
|
+
status: PaymentStatusEnum;
|
|
354
|
+
paymentMethod: PaymentMethodEnum;
|
|
343
355
|
gatewayId?: string;
|
|
344
356
|
metaData?: Metadata;
|
|
345
357
|
comment?: string;
|
|
@@ -356,6 +368,8 @@ interface IRefundTransaction extends ITransactionBase {
|
|
|
356
368
|
}
|
|
357
369
|
|
|
358
370
|
declare const OrderStatusEnum: {
|
|
371
|
+
readonly CREATED: "CREATED";
|
|
372
|
+
readonly RECEIVED: "RECEIVED";
|
|
359
373
|
readonly PENDING: "PENDING";
|
|
360
374
|
readonly CONFIRMED: "CONFIRMED";
|
|
361
375
|
readonly PROCESSING: "PROCESSING";
|
|
@@ -365,9 +379,11 @@ declare const OrderStatusEnum: {
|
|
|
365
379
|
readonly FAILED: "FAILED";
|
|
366
380
|
readonly REFUNDED: "REFUNDED";
|
|
367
381
|
readonly PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED";
|
|
382
|
+
readonly ARCHIVED: "ARCHIVED";
|
|
383
|
+
readonly RETURNED: "RETURNED";
|
|
368
384
|
};
|
|
369
385
|
type OrderStatusEnum = (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum];
|
|
370
|
-
declare const ORDER_STATUS_VALUES: ("PENDING" | "FAILED" | "
|
|
386
|
+
declare const ORDER_STATUS_VALUES: ("PENDING" | "PROCESSING" | "FAILED" | "REFUNDED" | "PARTIALLY_REFUNDED" | "CREATED" | "RECEIVED" | "CONFIRMED" | "SHIPPED" | "DELIVERED" | "CANCELED" | "ARCHIVED" | "RETURNED")[];
|
|
371
387
|
declare const statusColors: Record<OrderStatusEnum, string>;
|
|
372
388
|
interface IOrder extends BaseEntity {
|
|
373
389
|
orderId: string;
|
|
@@ -376,6 +392,8 @@ interface IOrder extends BaseEntity {
|
|
|
376
392
|
coupon: ICoupon;
|
|
377
393
|
store: IStore;
|
|
378
394
|
status: OrderStatusEnum;
|
|
395
|
+
paymentStatus: PaymentStatusEnum;
|
|
396
|
+
paymentMethod: PaymentMethodEnum;
|
|
379
397
|
subTotalAmount: number;
|
|
380
398
|
discountAmount: number;
|
|
381
399
|
totalAmount: number;
|
|
@@ -409,4 +427,4 @@ interface ICart extends BaseEntity {
|
|
|
409
427
|
totalAmount: number;
|
|
410
428
|
}
|
|
411
429
|
|
|
412
|
-
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,
|
|
430
|
+
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, PAYMENT_METHOD_VALUES, PAYMENT_STATUS_VALUES, type Paginated, PaymentMethodEnum, PaymentStatusEnum, type SoftDeleteFilter, type StockStatus, TRANSACTION_TYPE_VALUES, TransactionTypeEnum, paymentMethodColorMap, paymentStatusColorMap, statusColors, typeColorMap };
|
package/dist/index.d.ts
CHANGED
|
@@ -311,35 +311,47 @@ interface IOrderItem extends BaseEntity {
|
|
|
311
311
|
metaData: Metadata;
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
+
declare const PaymentStatusEnum: {
|
|
315
|
+
readonly INITIATED: "INITIATED";
|
|
316
|
+
readonly PENDING: "PENDING";
|
|
317
|
+
readonly PROCESSING: "PROCESSING";
|
|
318
|
+
readonly FAILED: "FAILED";
|
|
319
|
+
readonly CANCELLED: "CANCELLED";
|
|
320
|
+
readonly PENDING_CAPTURE: "PENDING_CAPTURE";
|
|
321
|
+
readonly COMPLETED: "COMPLETED";
|
|
322
|
+
readonly VOIDED: "VOIDED";
|
|
323
|
+
readonly REDIRECTED_TO_GATEWAY: "REDIRECTED_TO_GATEWAY";
|
|
324
|
+
readonly UNKNOWN: "UNKNOWN";
|
|
325
|
+
readonly REFUNDED: "REFUNDED";
|
|
326
|
+
readonly PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED";
|
|
327
|
+
};
|
|
328
|
+
type PaymentStatusEnum = (typeof PaymentStatusEnum)[keyof typeof PaymentStatusEnum];
|
|
329
|
+
declare const PAYMENT_STATUS_VALUES: ("INITIATED" | "PENDING" | "PROCESSING" | "FAILED" | "CANCELLED" | "PENDING_CAPTURE" | "COMPLETED" | "VOIDED" | "REDIRECTED_TO_GATEWAY" | "UNKNOWN" | "REFUNDED" | "PARTIALLY_REFUNDED")[];
|
|
330
|
+
declare const paymentStatusColorMap: Record<PaymentStatusEnum, string>;
|
|
331
|
+
declare const PaymentMethodEnum: {
|
|
332
|
+
readonly CREDIT_CARD: "CREDIT_CARD";
|
|
333
|
+
readonly PAYPAL: "PAYPAL";
|
|
334
|
+
readonly STRIPE: "STRIPE";
|
|
335
|
+
readonly CHECK: "CHECK";
|
|
336
|
+
readonly APPLE_PAY: "APPLE_PAY";
|
|
337
|
+
};
|
|
338
|
+
type PaymentMethodEnum = (typeof PaymentMethodEnum)[keyof typeof PaymentMethodEnum];
|
|
339
|
+
declare const PAYMENT_METHOD_VALUES: ("CREDIT_CARD" | "PAYPAL" | "STRIPE" | "CHECK" | "APPLE_PAY")[];
|
|
340
|
+
declare const paymentMethodColorMap: Record<PaymentMethodEnum, string>;
|
|
314
341
|
declare const TransactionTypeEnum: {
|
|
315
342
|
readonly ORDER: "ORDER";
|
|
316
343
|
readonly REFUND: "REFUND";
|
|
317
344
|
};
|
|
318
345
|
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
|
-
/** All valid transaction status string values. */
|
|
329
|
-
declare const TRANSACTION_STATUS_VALUES: ("PENDING" | "SUCCESS" | "FAILED" | "CANCELED" | "PARTIALLY_REFUNDED" | "REFUNDED")[];
|
|
330
|
-
/** All valid transaction type string values. */
|
|
331
346
|
declare const TRANSACTION_TYPE_VALUES: ("ORDER" | "REFUND")[];
|
|
332
|
-
/** Ant Design tag color for each transaction status. */
|
|
333
|
-
declare const statusColorMap: Record<TransactionStatusEnum, string>;
|
|
334
|
-
/** Ant Design tag color for each transaction type. */
|
|
335
347
|
declare const typeColorMap: Record<TransactionTypeEnum, string>;
|
|
336
348
|
interface ITransactionBase extends BaseEntity {
|
|
337
349
|
order: IOrder;
|
|
338
350
|
currency: ICurrency;
|
|
339
351
|
transactionId: string;
|
|
340
352
|
amount: number;
|
|
341
|
-
status:
|
|
342
|
-
paymentMethod
|
|
353
|
+
status: PaymentStatusEnum;
|
|
354
|
+
paymentMethod: PaymentMethodEnum;
|
|
343
355
|
gatewayId?: string;
|
|
344
356
|
metaData?: Metadata;
|
|
345
357
|
comment?: string;
|
|
@@ -356,6 +368,8 @@ interface IRefundTransaction extends ITransactionBase {
|
|
|
356
368
|
}
|
|
357
369
|
|
|
358
370
|
declare const OrderStatusEnum: {
|
|
371
|
+
readonly CREATED: "CREATED";
|
|
372
|
+
readonly RECEIVED: "RECEIVED";
|
|
359
373
|
readonly PENDING: "PENDING";
|
|
360
374
|
readonly CONFIRMED: "CONFIRMED";
|
|
361
375
|
readonly PROCESSING: "PROCESSING";
|
|
@@ -365,9 +379,11 @@ declare const OrderStatusEnum: {
|
|
|
365
379
|
readonly FAILED: "FAILED";
|
|
366
380
|
readonly REFUNDED: "REFUNDED";
|
|
367
381
|
readonly PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED";
|
|
382
|
+
readonly ARCHIVED: "ARCHIVED";
|
|
383
|
+
readonly RETURNED: "RETURNED";
|
|
368
384
|
};
|
|
369
385
|
type OrderStatusEnum = (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum];
|
|
370
|
-
declare const ORDER_STATUS_VALUES: ("PENDING" | "FAILED" | "
|
|
386
|
+
declare const ORDER_STATUS_VALUES: ("PENDING" | "PROCESSING" | "FAILED" | "REFUNDED" | "PARTIALLY_REFUNDED" | "CREATED" | "RECEIVED" | "CONFIRMED" | "SHIPPED" | "DELIVERED" | "CANCELED" | "ARCHIVED" | "RETURNED")[];
|
|
371
387
|
declare const statusColors: Record<OrderStatusEnum, string>;
|
|
372
388
|
interface IOrder extends BaseEntity {
|
|
373
389
|
orderId: string;
|
|
@@ -376,6 +392,8 @@ interface IOrder extends BaseEntity {
|
|
|
376
392
|
coupon: ICoupon;
|
|
377
393
|
store: IStore;
|
|
378
394
|
status: OrderStatusEnum;
|
|
395
|
+
paymentStatus: PaymentStatusEnum;
|
|
396
|
+
paymentMethod: PaymentMethodEnum;
|
|
379
397
|
subTotalAmount: number;
|
|
380
398
|
discountAmount: number;
|
|
381
399
|
totalAmount: number;
|
|
@@ -409,4 +427,4 @@ interface ICart extends BaseEntity {
|
|
|
409
427
|
totalAmount: number;
|
|
410
428
|
}
|
|
411
429
|
|
|
412
|
-
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,
|
|
430
|
+
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, PAYMENT_METHOD_VALUES, PAYMENT_STATUS_VALUES, type Paginated, PaymentMethodEnum, PaymentStatusEnum, type SoftDeleteFilter, type StockStatus, TRANSACTION_TYPE_VALUES, TransactionTypeEnum, paymentMethodColorMap, paymentStatusColorMap, statusColors, typeColorMap };
|
package/dist/index.js
CHANGED
|
@@ -24,11 +24,14 @@ __export(index_exports, {
|
|
|
24
24
|
DiscountTypeEnum: () => DiscountTypeEnum,
|
|
25
25
|
ORDER_STATUS_VALUES: () => ORDER_STATUS_VALUES,
|
|
26
26
|
OrderStatusEnum: () => OrderStatusEnum,
|
|
27
|
-
|
|
27
|
+
PAYMENT_METHOD_VALUES: () => PAYMENT_METHOD_VALUES,
|
|
28
|
+
PAYMENT_STATUS_VALUES: () => PAYMENT_STATUS_VALUES,
|
|
29
|
+
PaymentMethodEnum: () => PaymentMethodEnum,
|
|
30
|
+
PaymentStatusEnum: () => PaymentStatusEnum,
|
|
28
31
|
TRANSACTION_TYPE_VALUES: () => TRANSACTION_TYPE_VALUES,
|
|
29
|
-
TransactionStatusEnum: () => TransactionStatusEnum,
|
|
30
32
|
TransactionTypeEnum: () => TransactionTypeEnum,
|
|
31
|
-
|
|
33
|
+
paymentMethodColorMap: () => paymentMethodColorMap,
|
|
34
|
+
paymentStatusColorMap: () => paymentStatusColorMap,
|
|
32
35
|
statusColors: () => statusColors,
|
|
33
36
|
typeColorMap: () => typeColorMap
|
|
34
37
|
});
|
|
@@ -54,6 +57,8 @@ var DiscountTypeEnum = {
|
|
|
54
57
|
|
|
55
58
|
// src/order/interface.ts
|
|
56
59
|
var OrderStatusEnum = {
|
|
60
|
+
CREATED: "CREATED",
|
|
61
|
+
RECEIVED: "RECEIVED",
|
|
57
62
|
PENDING: "PENDING",
|
|
58
63
|
CONFIRMED: "CONFIRMED",
|
|
59
64
|
PROCESSING: "PROCESSING",
|
|
@@ -62,10 +67,14 @@ var OrderStatusEnum = {
|
|
|
62
67
|
CANCELED: "CANCELED",
|
|
63
68
|
FAILED: "FAILED",
|
|
64
69
|
REFUNDED: "REFUNDED",
|
|
65
|
-
PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED"
|
|
70
|
+
PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED",
|
|
71
|
+
ARCHIVED: "ARCHIVED",
|
|
72
|
+
RETURNED: "RETURNED"
|
|
66
73
|
};
|
|
67
74
|
var ORDER_STATUS_VALUES = Object.values(OrderStatusEnum);
|
|
68
75
|
var statusColors = {
|
|
76
|
+
[OrderStatusEnum.CREATED]: "default",
|
|
77
|
+
[OrderStatusEnum.RECEIVED]: "cyan",
|
|
69
78
|
[OrderStatusEnum.PENDING]: "gold",
|
|
70
79
|
[OrderStatusEnum.CONFIRMED]: "blue",
|
|
71
80
|
[OrderStatusEnum.PROCESSING]: "cyan",
|
|
@@ -74,32 +83,61 @@ var statusColors = {
|
|
|
74
83
|
[OrderStatusEnum.CANCELED]: "volcano",
|
|
75
84
|
[OrderStatusEnum.FAILED]: "red",
|
|
76
85
|
[OrderStatusEnum.REFUNDED]: "orange",
|
|
77
|
-
[OrderStatusEnum.PARTIALLY_REFUNDED]: "magenta"
|
|
86
|
+
[OrderStatusEnum.PARTIALLY_REFUNDED]: "magenta",
|
|
87
|
+
[OrderStatusEnum.ARCHIVED]: "gray",
|
|
88
|
+
[OrderStatusEnum.RETURNED]: "purple"
|
|
78
89
|
};
|
|
79
90
|
|
|
80
91
|
// src/transaction/interface.ts
|
|
92
|
+
var PaymentStatusEnum = {
|
|
93
|
+
INITIATED: "INITIATED",
|
|
94
|
+
PENDING: "PENDING",
|
|
95
|
+
PROCESSING: "PROCESSING",
|
|
96
|
+
FAILED: "FAILED",
|
|
97
|
+
CANCELLED: "CANCELLED",
|
|
98
|
+
PENDING_CAPTURE: "PENDING_CAPTURE",
|
|
99
|
+
COMPLETED: "COMPLETED",
|
|
100
|
+
VOIDED: "VOIDED",
|
|
101
|
+
REDIRECTED_TO_GATEWAY: "REDIRECTED_TO_GATEWAY",
|
|
102
|
+
UNKNOWN: "UNKNOWN",
|
|
103
|
+
REFUNDED: "REFUNDED",
|
|
104
|
+
PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED"
|
|
105
|
+
};
|
|
106
|
+
var PAYMENT_STATUS_VALUES = Object.values(PaymentStatusEnum);
|
|
107
|
+
var paymentStatusColorMap = {
|
|
108
|
+
[PaymentStatusEnum.INITIATED]: "default",
|
|
109
|
+
[PaymentStatusEnum.PENDING]: "gold",
|
|
110
|
+
[PaymentStatusEnum.PROCESSING]: "cyan",
|
|
111
|
+
[PaymentStatusEnum.FAILED]: "red",
|
|
112
|
+
[PaymentStatusEnum.CANCELLED]: "volcano",
|
|
113
|
+
[PaymentStatusEnum.PENDING_CAPTURE]: "blue",
|
|
114
|
+
[PaymentStatusEnum.COMPLETED]: "green",
|
|
115
|
+
[PaymentStatusEnum.VOIDED]: "magenta",
|
|
116
|
+
[PaymentStatusEnum.REDIRECTED_TO_GATEWAY]: "purple",
|
|
117
|
+
[PaymentStatusEnum.UNKNOWN]: "gray",
|
|
118
|
+
[PaymentStatusEnum.REFUNDED]: "orange",
|
|
119
|
+
[PaymentStatusEnum.PARTIALLY_REFUNDED]: "magenta"
|
|
120
|
+
};
|
|
121
|
+
var PaymentMethodEnum = {
|
|
122
|
+
CREDIT_CARD: "CREDIT_CARD",
|
|
123
|
+
PAYPAL: "PAYPAL",
|
|
124
|
+
STRIPE: "STRIPE",
|
|
125
|
+
CHECK: "CHECK",
|
|
126
|
+
APPLE_PAY: "APPLE_PAY"
|
|
127
|
+
};
|
|
128
|
+
var PAYMENT_METHOD_VALUES = Object.values(PaymentMethodEnum);
|
|
129
|
+
var paymentMethodColorMap = {
|
|
130
|
+
[PaymentMethodEnum.CREDIT_CARD]: "blue",
|
|
131
|
+
[PaymentMethodEnum.PAYPAL]: "geekblue",
|
|
132
|
+
[PaymentMethodEnum.STRIPE]: "purple",
|
|
133
|
+
[PaymentMethodEnum.CHECK]: "orange",
|
|
134
|
+
[PaymentMethodEnum.APPLE_PAY]: "black"
|
|
135
|
+
};
|
|
81
136
|
var TransactionTypeEnum = {
|
|
82
137
|
ORDER: "ORDER",
|
|
83
138
|
REFUND: "REFUND"
|
|
84
139
|
};
|
|
85
|
-
var TransactionStatusEnum = {
|
|
86
|
-
PENDING: "PENDING",
|
|
87
|
-
SUCCESS: "SUCCESS",
|
|
88
|
-
FAILED: "FAILED",
|
|
89
|
-
CANCELED: "CANCELED",
|
|
90
|
-
PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED",
|
|
91
|
-
REFUNDED: "REFUNDED"
|
|
92
|
-
};
|
|
93
|
-
var TRANSACTION_STATUS_VALUES = Object.values(TransactionStatusEnum);
|
|
94
140
|
var TRANSACTION_TYPE_VALUES = Object.values(TransactionTypeEnum);
|
|
95
|
-
var statusColorMap = {
|
|
96
|
-
[TransactionStatusEnum.PENDING]: "gold",
|
|
97
|
-
[TransactionStatusEnum.SUCCESS]: "green",
|
|
98
|
-
[TransactionStatusEnum.FAILED]: "red",
|
|
99
|
-
[TransactionStatusEnum.CANCELED]: "volcano",
|
|
100
|
-
[TransactionStatusEnum.PARTIALLY_REFUNDED]: "magenta",
|
|
101
|
-
[TransactionStatusEnum.REFUNDED]: "orange"
|
|
102
|
-
};
|
|
103
141
|
var typeColorMap = {
|
|
104
142
|
[TransactionTypeEnum.ORDER]: "blue",
|
|
105
143
|
[TransactionTypeEnum.REFUND]: "purple"
|
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","../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];\
|
|
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\";\nimport type { PaymentMethodEnum, PaymentStatusEnum } from \"../transaction\";\n\nexport const OrderStatusEnum = {\n CREATED: \"CREATED\",\n RECEIVED: \"RECEIVED\",\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 ARCHIVED: \"ARCHIVED\",\n RETURNED: \"RETURNED\",\n} as const;\n\nexport type OrderStatusEnum = (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum];\nexport const ORDER_STATUS_VALUES = Object.values(OrderStatusEnum);\n\nexport const statusColors: Record<OrderStatusEnum, string> = {\n [OrderStatusEnum.CREATED]: \"default\",\n [OrderStatusEnum.RECEIVED]: \"cyan\",\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 [OrderStatusEnum.ARCHIVED]: \"gray\",\n [OrderStatusEnum.RETURNED]: \"purple\",\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 paymentStatus: PaymentStatusEnum;\n paymentMethod: PaymentMethodEnum;\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 PaymentStatusEnum = {\n INITIATED: 'INITIATED',\n PENDING: 'PENDING',\n PROCESSING: 'PROCESSING',\n FAILED: 'FAILED',\n CANCELLED: 'CANCELLED',\n PENDING_CAPTURE: 'PENDING_CAPTURE',\n COMPLETED: 'COMPLETED',\n VOIDED: 'VOIDED',\n REDIRECTED_TO_GATEWAY: 'REDIRECTED_TO_GATEWAY',\n UNKNOWN: 'UNKNOWN',\n REFUNDED: 'REFUNDED',\n PARTIALLY_REFUNDED: 'PARTIALLY_REFUNDED',\n} as const;\n\nexport type PaymentStatusEnum = (typeof PaymentStatusEnum)[keyof typeof PaymentStatusEnum];\nexport const PAYMENT_STATUS_VALUES = Object.values(PaymentStatusEnum);\n\nexport const paymentStatusColorMap: Record<PaymentStatusEnum, string> = {\n [PaymentStatusEnum.INITIATED]: 'default',\n [PaymentStatusEnum.PENDING]: 'gold',\n [PaymentStatusEnum.PROCESSING]: 'cyan',\n [PaymentStatusEnum.FAILED]: 'red',\n [PaymentStatusEnum.CANCELLED]: 'volcano',\n [PaymentStatusEnum.PENDING_CAPTURE]: 'blue',\n [PaymentStatusEnum.COMPLETED]: 'green',\n [PaymentStatusEnum.VOIDED]: 'magenta',\n [PaymentStatusEnum.REDIRECTED_TO_GATEWAY]: 'purple',\n [PaymentStatusEnum.UNKNOWN]: 'gray',\n [PaymentStatusEnum.REFUNDED]: 'orange',\n [PaymentStatusEnum.PARTIALLY_REFUNDED]: 'magenta',\n};\n\nexport const PaymentMethodEnum = {\n CREDIT_CARD: 'CREDIT_CARD',\n PAYPAL: 'PAYPAL',\n STRIPE: 'STRIPE',\n CHECK: 'CHECK',\n APPLE_PAY: 'APPLE_PAY',\n} as const;\n\nexport type PaymentMethodEnum = (typeof PaymentMethodEnum)[keyof typeof PaymentMethodEnum];\nexport const PAYMENT_METHOD_VALUES = Object.values(PaymentMethodEnum);\n\nexport const paymentMethodColorMap: Record<PaymentMethodEnum, string> = {\n [PaymentMethodEnum.CREDIT_CARD]: 'blue',\n [PaymentMethodEnum.PAYPAL]: 'geekblue',\n [PaymentMethodEnum.STRIPE]: 'purple',\n [PaymentMethodEnum.CHECK]: 'orange',\n [PaymentMethodEnum.APPLE_PAY]: 'black',\n};\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 TRANSACTION_TYPE_VALUES = Object.values(TransactionTypeEnum);\n\nexport const typeColorMap: Record<TransactionTypeEnum, string> = {\n [TransactionTypeEnum.ORDER]: \"blue\",\n [TransactionTypeEnum.REFUND]: \"purple\",\n};\n\nexport interface ITransactionBase extends BaseEntity {\n order: IOrder;\n currency: ICurrency;\n transactionId: string;\n amount: number;\n status: PaymentStatusEnum;\n paymentMethod: PaymentMethodEnum;\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 originalTransaction?: ITransactionBase;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACYO,IAAM,cAAgC;A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
18
|
|
|
19
19
|
// src/order/interface.ts
|
|
20
20
|
var OrderStatusEnum = {
|
|
21
|
+
CREATED: "CREATED",
|
|
22
|
+
RECEIVED: "RECEIVED",
|
|
21
23
|
PENDING: "PENDING",
|
|
22
24
|
CONFIRMED: "CONFIRMED",
|
|
23
25
|
PROCESSING: "PROCESSING",
|
|
@@ -26,10 +28,14 @@ var OrderStatusEnum = {
|
|
|
26
28
|
CANCELED: "CANCELED",
|
|
27
29
|
FAILED: "FAILED",
|
|
28
30
|
REFUNDED: "REFUNDED",
|
|
29
|
-
PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED"
|
|
31
|
+
PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED",
|
|
32
|
+
ARCHIVED: "ARCHIVED",
|
|
33
|
+
RETURNED: "RETURNED"
|
|
30
34
|
};
|
|
31
35
|
var ORDER_STATUS_VALUES = Object.values(OrderStatusEnum);
|
|
32
36
|
var statusColors = {
|
|
37
|
+
[OrderStatusEnum.CREATED]: "default",
|
|
38
|
+
[OrderStatusEnum.RECEIVED]: "cyan",
|
|
33
39
|
[OrderStatusEnum.PENDING]: "gold",
|
|
34
40
|
[OrderStatusEnum.CONFIRMED]: "blue",
|
|
35
41
|
[OrderStatusEnum.PROCESSING]: "cyan",
|
|
@@ -38,32 +44,61 @@ var statusColors = {
|
|
|
38
44
|
[OrderStatusEnum.CANCELED]: "volcano",
|
|
39
45
|
[OrderStatusEnum.FAILED]: "red",
|
|
40
46
|
[OrderStatusEnum.REFUNDED]: "orange",
|
|
41
|
-
[OrderStatusEnum.PARTIALLY_REFUNDED]: "magenta"
|
|
47
|
+
[OrderStatusEnum.PARTIALLY_REFUNDED]: "magenta",
|
|
48
|
+
[OrderStatusEnum.ARCHIVED]: "gray",
|
|
49
|
+
[OrderStatusEnum.RETURNED]: "purple"
|
|
42
50
|
};
|
|
43
51
|
|
|
44
52
|
// src/transaction/interface.ts
|
|
53
|
+
var PaymentStatusEnum = {
|
|
54
|
+
INITIATED: "INITIATED",
|
|
55
|
+
PENDING: "PENDING",
|
|
56
|
+
PROCESSING: "PROCESSING",
|
|
57
|
+
FAILED: "FAILED",
|
|
58
|
+
CANCELLED: "CANCELLED",
|
|
59
|
+
PENDING_CAPTURE: "PENDING_CAPTURE",
|
|
60
|
+
COMPLETED: "COMPLETED",
|
|
61
|
+
VOIDED: "VOIDED",
|
|
62
|
+
REDIRECTED_TO_GATEWAY: "REDIRECTED_TO_GATEWAY",
|
|
63
|
+
UNKNOWN: "UNKNOWN",
|
|
64
|
+
REFUNDED: "REFUNDED",
|
|
65
|
+
PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED"
|
|
66
|
+
};
|
|
67
|
+
var PAYMENT_STATUS_VALUES = Object.values(PaymentStatusEnum);
|
|
68
|
+
var paymentStatusColorMap = {
|
|
69
|
+
[PaymentStatusEnum.INITIATED]: "default",
|
|
70
|
+
[PaymentStatusEnum.PENDING]: "gold",
|
|
71
|
+
[PaymentStatusEnum.PROCESSING]: "cyan",
|
|
72
|
+
[PaymentStatusEnum.FAILED]: "red",
|
|
73
|
+
[PaymentStatusEnum.CANCELLED]: "volcano",
|
|
74
|
+
[PaymentStatusEnum.PENDING_CAPTURE]: "blue",
|
|
75
|
+
[PaymentStatusEnum.COMPLETED]: "green",
|
|
76
|
+
[PaymentStatusEnum.VOIDED]: "magenta",
|
|
77
|
+
[PaymentStatusEnum.REDIRECTED_TO_GATEWAY]: "purple",
|
|
78
|
+
[PaymentStatusEnum.UNKNOWN]: "gray",
|
|
79
|
+
[PaymentStatusEnum.REFUNDED]: "orange",
|
|
80
|
+
[PaymentStatusEnum.PARTIALLY_REFUNDED]: "magenta"
|
|
81
|
+
};
|
|
82
|
+
var PaymentMethodEnum = {
|
|
83
|
+
CREDIT_CARD: "CREDIT_CARD",
|
|
84
|
+
PAYPAL: "PAYPAL",
|
|
85
|
+
STRIPE: "STRIPE",
|
|
86
|
+
CHECK: "CHECK",
|
|
87
|
+
APPLE_PAY: "APPLE_PAY"
|
|
88
|
+
};
|
|
89
|
+
var PAYMENT_METHOD_VALUES = Object.values(PaymentMethodEnum);
|
|
90
|
+
var paymentMethodColorMap = {
|
|
91
|
+
[PaymentMethodEnum.CREDIT_CARD]: "blue",
|
|
92
|
+
[PaymentMethodEnum.PAYPAL]: "geekblue",
|
|
93
|
+
[PaymentMethodEnum.STRIPE]: "purple",
|
|
94
|
+
[PaymentMethodEnum.CHECK]: "orange",
|
|
95
|
+
[PaymentMethodEnum.APPLE_PAY]: "black"
|
|
96
|
+
};
|
|
45
97
|
var TransactionTypeEnum = {
|
|
46
98
|
ORDER: "ORDER",
|
|
47
99
|
REFUND: "REFUND"
|
|
48
100
|
};
|
|
49
|
-
var TransactionStatusEnum = {
|
|
50
|
-
PENDING: "PENDING",
|
|
51
|
-
SUCCESS: "SUCCESS",
|
|
52
|
-
FAILED: "FAILED",
|
|
53
|
-
CANCELED: "CANCELED",
|
|
54
|
-
PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED",
|
|
55
|
-
REFUNDED: "REFUNDED"
|
|
56
|
-
};
|
|
57
|
-
var TRANSACTION_STATUS_VALUES = Object.values(TransactionStatusEnum);
|
|
58
101
|
var TRANSACTION_TYPE_VALUES = Object.values(TransactionTypeEnum);
|
|
59
|
-
var statusColorMap = {
|
|
60
|
-
[TransactionStatusEnum.PENDING]: "gold",
|
|
61
|
-
[TransactionStatusEnum.SUCCESS]: "green",
|
|
62
|
-
[TransactionStatusEnum.FAILED]: "red",
|
|
63
|
-
[TransactionStatusEnum.CANCELED]: "volcano",
|
|
64
|
-
[TransactionStatusEnum.PARTIALLY_REFUNDED]: "magenta",
|
|
65
|
-
[TransactionStatusEnum.REFUNDED]: "orange"
|
|
66
|
-
};
|
|
67
102
|
var typeColorMap = {
|
|
68
103
|
[TransactionTypeEnum.ORDER]: "blue",
|
|
69
104
|
[TransactionTypeEnum.REFUND]: "purple"
|
|
@@ -73,11 +108,14 @@ export {
|
|
|
73
108
|
DiscountTypeEnum,
|
|
74
109
|
ORDER_STATUS_VALUES,
|
|
75
110
|
OrderStatusEnum,
|
|
76
|
-
|
|
111
|
+
PAYMENT_METHOD_VALUES,
|
|
112
|
+
PAYMENT_STATUS_VALUES,
|
|
113
|
+
PaymentMethodEnum,
|
|
114
|
+
PaymentStatusEnum,
|
|
77
115
|
TRANSACTION_TYPE_VALUES,
|
|
78
|
-
TransactionStatusEnum,
|
|
79
116
|
TransactionTypeEnum,
|
|
80
|
-
|
|
117
|
+
paymentMethodColorMap,
|
|
118
|
+
paymentStatusColorMap,
|
|
81
119
|
statusColors,
|
|
82
120
|
typeColorMap
|
|
83
121
|
};
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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];\
|
|
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\";\nimport type { PaymentMethodEnum, PaymentStatusEnum } from \"../transaction\";\n\nexport const OrderStatusEnum = {\n CREATED: \"CREATED\",\n RECEIVED: \"RECEIVED\",\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 ARCHIVED: \"ARCHIVED\",\n RETURNED: \"RETURNED\",\n} as const;\n\nexport type OrderStatusEnum = (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum];\nexport const ORDER_STATUS_VALUES = Object.values(OrderStatusEnum);\n\nexport const statusColors: Record<OrderStatusEnum, string> = {\n [OrderStatusEnum.CREATED]: \"default\",\n [OrderStatusEnum.RECEIVED]: \"cyan\",\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 [OrderStatusEnum.ARCHIVED]: \"gray\",\n [OrderStatusEnum.RETURNED]: \"purple\",\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 paymentStatus: PaymentStatusEnum;\n paymentMethod: PaymentMethodEnum;\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 PaymentStatusEnum = {\n INITIATED: 'INITIATED',\n PENDING: 'PENDING',\n PROCESSING: 'PROCESSING',\n FAILED: 'FAILED',\n CANCELLED: 'CANCELLED',\n PENDING_CAPTURE: 'PENDING_CAPTURE',\n COMPLETED: 'COMPLETED',\n VOIDED: 'VOIDED',\n REDIRECTED_TO_GATEWAY: 'REDIRECTED_TO_GATEWAY',\n UNKNOWN: 'UNKNOWN',\n REFUNDED: 'REFUNDED',\n PARTIALLY_REFUNDED: 'PARTIALLY_REFUNDED',\n} as const;\n\nexport type PaymentStatusEnum = (typeof PaymentStatusEnum)[keyof typeof PaymentStatusEnum];\nexport const PAYMENT_STATUS_VALUES = Object.values(PaymentStatusEnum);\n\nexport const paymentStatusColorMap: Record<PaymentStatusEnum, string> = {\n [PaymentStatusEnum.INITIATED]: 'default',\n [PaymentStatusEnum.PENDING]: 'gold',\n [PaymentStatusEnum.PROCESSING]: 'cyan',\n [PaymentStatusEnum.FAILED]: 'red',\n [PaymentStatusEnum.CANCELLED]: 'volcano',\n [PaymentStatusEnum.PENDING_CAPTURE]: 'blue',\n [PaymentStatusEnum.COMPLETED]: 'green',\n [PaymentStatusEnum.VOIDED]: 'magenta',\n [PaymentStatusEnum.REDIRECTED_TO_GATEWAY]: 'purple',\n [PaymentStatusEnum.UNKNOWN]: 'gray',\n [PaymentStatusEnum.REFUNDED]: 'orange',\n [PaymentStatusEnum.PARTIALLY_REFUNDED]: 'magenta',\n};\n\nexport const PaymentMethodEnum = {\n CREDIT_CARD: 'CREDIT_CARD',\n PAYPAL: 'PAYPAL',\n STRIPE: 'STRIPE',\n CHECK: 'CHECK',\n APPLE_PAY: 'APPLE_PAY',\n} as const;\n\nexport type PaymentMethodEnum = (typeof PaymentMethodEnum)[keyof typeof PaymentMethodEnum];\nexport const PAYMENT_METHOD_VALUES = Object.values(PaymentMethodEnum);\n\nexport const paymentMethodColorMap: Record<PaymentMethodEnum, string> = {\n [PaymentMethodEnum.CREDIT_CARD]: 'blue',\n [PaymentMethodEnum.PAYPAL]: 'geekblue',\n [PaymentMethodEnum.STRIPE]: 'purple',\n [PaymentMethodEnum.CHECK]: 'orange',\n [PaymentMethodEnum.APPLE_PAY]: 'black',\n};\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 TRANSACTION_TYPE_VALUES = Object.values(TransactionTypeEnum);\n\nexport const typeColorMap: Record<TransactionTypeEnum, string> = {\n [TransactionTypeEnum.ORDER]: \"blue\",\n [TransactionTypeEnum.REFUND]: \"purple\",\n};\n\nexport interface ITransactionBase extends BaseEntity {\n order: IOrder;\n currency: ICurrency;\n transactionId: string;\n amount: number;\n status: PaymentStatusEnum;\n paymentMethod: PaymentMethodEnum;\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 originalTransaction?: ITransactionBase;\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;;;ACGO,IAAM,kBAAkB;AAAA,EAC3B,SAAS;AAAA,EACT,UAAU;AAAA,EACV,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;AAAA,EACpB,UAAU;AAAA,EACV,UAAU;AACd;AAGO,IAAM,sBAAsB,OAAO,OAAO,eAAe;AAEzD,IAAM,eAAgD;AAAA,EACzD,CAAC,gBAAgB,OAAO,GAAG;AAAA,EAC3B,CAAC,gBAAgB,QAAQ,GAAG;AAAA,EAC5B,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;AAAA,EACtC,CAAC,gBAAgB,QAAQ,GAAG;AAAA,EAC5B,CAAC,gBAAgB,QAAQ,GAAG;AAChC;;;ACrCO,IAAM,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