@fas-core/shared-types 1.0.26 → 1.0.28
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 +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -325,6 +325,14 @@ declare const TransactionStatusEnum: {
|
|
|
325
325
|
readonly REFUNDED: "REFUNDED";
|
|
326
326
|
};
|
|
327
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
|
+
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
|
+
declare const typeColorMap: Record<TransactionTypeEnum, string>;
|
|
328
336
|
interface ITransactionBase extends BaseEntity {
|
|
329
337
|
order: IOrder;
|
|
330
338
|
currency: ICurrency;
|
|
@@ -344,7 +352,7 @@ interface IOrderTransaction extends ITransactionBase {
|
|
|
344
352
|
}
|
|
345
353
|
interface IRefundTransaction extends ITransactionBase {
|
|
346
354
|
type: typeof TransactionTypeEnum.REFUND;
|
|
347
|
-
|
|
355
|
+
originalTransaction?: ITransactionBase;
|
|
348
356
|
}
|
|
349
357
|
|
|
350
358
|
declare const OrderStatusEnum: {
|
|
@@ -401,4 +409,4 @@ interface ICart extends BaseEntity {
|
|
|
401
409
|
totalAmount: number;
|
|
402
410
|
}
|
|
403
411
|
|
|
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 };
|
|
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, TRANSACTION_STATUS_VALUES, TRANSACTION_TYPE_VALUES, TransactionStatusEnum, TransactionTypeEnum, statusColorMap, statusColors, typeColorMap };
|
package/dist/index.d.ts
CHANGED
|
@@ -325,6 +325,14 @@ declare const TransactionStatusEnum: {
|
|
|
325
325
|
readonly REFUNDED: "REFUNDED";
|
|
326
326
|
};
|
|
327
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
|
+
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
|
+
declare const typeColorMap: Record<TransactionTypeEnum, string>;
|
|
328
336
|
interface ITransactionBase extends BaseEntity {
|
|
329
337
|
order: IOrder;
|
|
330
338
|
currency: ICurrency;
|
|
@@ -344,7 +352,7 @@ interface IOrderTransaction extends ITransactionBase {
|
|
|
344
352
|
}
|
|
345
353
|
interface IRefundTransaction extends ITransactionBase {
|
|
346
354
|
type: typeof TransactionTypeEnum.REFUND;
|
|
347
|
-
|
|
355
|
+
originalTransaction?: ITransactionBase;
|
|
348
356
|
}
|
|
349
357
|
|
|
350
358
|
declare const OrderStatusEnum: {
|
|
@@ -401,4 +409,4 @@ interface ICart extends BaseEntity {
|
|
|
401
409
|
totalAmount: number;
|
|
402
410
|
}
|
|
403
411
|
|
|
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 };
|
|
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, TRANSACTION_STATUS_VALUES, TRANSACTION_TYPE_VALUES, TransactionStatusEnum, TransactionTypeEnum, statusColorMap, statusColors, typeColorMap };
|
package/dist/index.js
CHANGED
|
@@ -24,9 +24,13 @@ __export(index_exports, {
|
|
|
24
24
|
DiscountTypeEnum: () => DiscountTypeEnum,
|
|
25
25
|
ORDER_STATUS_VALUES: () => ORDER_STATUS_VALUES,
|
|
26
26
|
OrderStatusEnum: () => OrderStatusEnum,
|
|
27
|
+
TRANSACTION_STATUS_VALUES: () => TRANSACTION_STATUS_VALUES,
|
|
28
|
+
TRANSACTION_TYPE_VALUES: () => TRANSACTION_TYPE_VALUES,
|
|
27
29
|
TransactionStatusEnum: () => TransactionStatusEnum,
|
|
28
30
|
TransactionTypeEnum: () => TransactionTypeEnum,
|
|
29
|
-
|
|
31
|
+
statusColorMap: () => statusColorMap,
|
|
32
|
+
statusColors: () => statusColors,
|
|
33
|
+
typeColorMap: () => typeColorMap
|
|
30
34
|
});
|
|
31
35
|
module.exports = __toCommonJS(index_exports);
|
|
32
36
|
|
|
@@ -86,4 +90,18 @@ var TransactionStatusEnum = {
|
|
|
86
90
|
PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED",
|
|
87
91
|
REFUNDED: "REFUNDED"
|
|
88
92
|
};
|
|
93
|
+
var TRANSACTION_STATUS_VALUES = Object.values(TransactionStatusEnum);
|
|
94
|
+
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
|
+
var typeColorMap = {
|
|
104
|
+
[TransactionTypeEnum.ORDER]: "blue",
|
|
105
|
+
[TransactionTypeEnum.REFUND]: "purple"
|
|
106
|
+
};
|
|
89
107
|
//# 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","../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
|
|
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\n/** All valid transaction status string values. */\nexport const TRANSACTION_STATUS_VALUES = Object.values(TransactionStatusEnum);\n\n/** All valid transaction type string values. */\nexport const TRANSACTION_TYPE_VALUES = Object.values(TransactionTypeEnum);\n\n/** Ant Design tag color for each transaction status. */\nexport const statusColorMap: Record<TransactionStatusEnum, string> = {\n [TransactionStatusEnum.PENDING]: \"gold\",\n [TransactionStatusEnum.SUCCESS]: \"green\",\n [TransactionStatusEnum.FAILED]: \"red\",\n [TransactionStatusEnum.CANCELED]: \"volcano\",\n [TransactionStatusEnum.PARTIALLY_REFUNDED]: \"magenta\",\n [TransactionStatusEnum.REFUNDED]: \"orange\",\n};\n\n/** Ant Design tag color for each transaction type. */\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: 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 originalTransaction?: ITransactionBase;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;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;AAKO,IAAM,4BAA4B,OAAO,OAAO,qBAAqB;AAGrE,IAAM,0BAA0B,OAAO,OAAO,mBAAmB;AAGjE,IAAM,iBAAwD;AAAA,EACjE,CAAC,sBAAsB,OAAO,GAAG;AAAA,EACjC,CAAC,sBAAsB,OAAO,GAAG;AAAA,EACjC,CAAC,sBAAsB,MAAM,GAAG;AAAA,EAChC,CAAC,sBAAsB,QAAQ,GAAG;AAAA,EAClC,CAAC,sBAAsB,kBAAkB,GAAG;AAAA,EAC5C,CAAC,sBAAsB,QAAQ,GAAG;AACtC;AAGO,IAAM,eAAoD;AAAA,EAC7D,CAAC,oBAAoB,KAAK,GAAG;AAAA,EAC7B,CAAC,oBAAoB,MAAM,GAAG;AAClC;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -54,13 +54,31 @@ var TransactionStatusEnum = {
|
|
|
54
54
|
PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED",
|
|
55
55
|
REFUNDED: "REFUNDED"
|
|
56
56
|
};
|
|
57
|
+
var TRANSACTION_STATUS_VALUES = Object.values(TransactionStatusEnum);
|
|
58
|
+
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
|
+
var typeColorMap = {
|
|
68
|
+
[TransactionTypeEnum.ORDER]: "blue",
|
|
69
|
+
[TransactionTypeEnum.REFUND]: "purple"
|
|
70
|
+
};
|
|
57
71
|
export {
|
|
58
72
|
ADMIN_ROLES,
|
|
59
73
|
DiscountTypeEnum,
|
|
60
74
|
ORDER_STATUS_VALUES,
|
|
61
75
|
OrderStatusEnum,
|
|
76
|
+
TRANSACTION_STATUS_VALUES,
|
|
77
|
+
TRANSACTION_TYPE_VALUES,
|
|
62
78
|
TransactionStatusEnum,
|
|
63
79
|
TransactionTypeEnum,
|
|
64
|
-
|
|
80
|
+
statusColorMap,
|
|
81
|
+
statusColors,
|
|
82
|
+
typeColorMap
|
|
65
83
|
};
|
|
66
84
|
//# 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","../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
|
|
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\n/** All valid transaction status string values. */\nexport const TRANSACTION_STATUS_VALUES = Object.values(TransactionStatusEnum);\n\n/** All valid transaction type string values. */\nexport const TRANSACTION_TYPE_VALUES = Object.values(TransactionTypeEnum);\n\n/** Ant Design tag color for each transaction status. */\nexport const statusColorMap: Record<TransactionStatusEnum, string> = {\n [TransactionStatusEnum.PENDING]: \"gold\",\n [TransactionStatusEnum.SUCCESS]: \"green\",\n [TransactionStatusEnum.FAILED]: \"red\",\n [TransactionStatusEnum.CANCELED]: \"volcano\",\n [TransactionStatusEnum.PARTIALLY_REFUNDED]: \"magenta\",\n [TransactionStatusEnum.REFUNDED]: \"orange\",\n};\n\n/** Ant Design tag color for each transaction type. */\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: 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 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;;;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;AAKO,IAAM,4BAA4B,OAAO,OAAO,qBAAqB;AAGrE,IAAM,0BAA0B,OAAO,OAAO,mBAAmB;AAGjE,IAAM,iBAAwD;AAAA,EACjE,CAAC,sBAAsB,OAAO,GAAG;AAAA,EACjC,CAAC,sBAAsB,OAAO,GAAG;AAAA,EACjC,CAAC,sBAAsB,MAAM,GAAG;AAAA,EAChC,CAAC,sBAAsB,QAAQ,GAAG;AAAA,EAClC,CAAC,sBAAsB,kBAAkB,GAAG;AAAA,EAC5C,CAAC,sBAAsB,QAAQ,GAAG;AACtC;AAGO,IAAM,eAAoD;AAAA,EAC7D,CAAC,oBAAoB,KAAK,GAAG;AAAA,EAC7B,CAAC,oBAAoB,MAAM,GAAG;AAClC;","names":[]}
|
package/package.json
CHANGED