@fas-core/shared-types 1.0.46 → 1.0.48
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 +70 -20
- package/dist/index.d.ts +70 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -60,6 +60,20 @@ interface IPrice {
|
|
|
60
60
|
originalPrice: number;
|
|
61
61
|
discount: number;
|
|
62
62
|
}
|
|
63
|
+
interface ILinePricing {
|
|
64
|
+
quantity: number;
|
|
65
|
+
unitPrice: number;
|
|
66
|
+
totalAmount: number;
|
|
67
|
+
currencyCode: string;
|
|
68
|
+
}
|
|
69
|
+
interface ISummaryPricing {
|
|
70
|
+
subTotalAmount: number;
|
|
71
|
+
discountAmount: number;
|
|
72
|
+
taxAmount: number;
|
|
73
|
+
shippingAmount: number;
|
|
74
|
+
totalAmount: number;
|
|
75
|
+
currencyCode: string;
|
|
76
|
+
}
|
|
63
77
|
interface ITechSpec {
|
|
64
78
|
group?: string;
|
|
65
79
|
key: string;
|
|
@@ -211,11 +225,59 @@ interface IProductVariantFields {
|
|
|
211
225
|
status: boolean;
|
|
212
226
|
}
|
|
213
227
|
|
|
228
|
+
type VariantOptionMode = "OPTION_BACKED" | "MANUAL";
|
|
229
|
+
type ProductVariantType = "SINGLE" | "OPTION_BACKED" | "MANUAL";
|
|
230
|
+
interface IProductVariantOptionValue {
|
|
231
|
+
id?: string;
|
|
232
|
+
valueKey: string;
|
|
233
|
+
label: string;
|
|
234
|
+
sortOrder: number;
|
|
235
|
+
}
|
|
236
|
+
interface IProductVariantOptionGroup {
|
|
237
|
+
id?: string;
|
|
238
|
+
optionKey: string;
|
|
239
|
+
name: string;
|
|
240
|
+
sortOrder: number;
|
|
241
|
+
values: IProductVariantOptionValue[];
|
|
242
|
+
}
|
|
243
|
+
interface IProductVariantOptionMatrix {
|
|
244
|
+
groups: IProductVariantOptionGroup[];
|
|
245
|
+
optionSignatures: string[];
|
|
246
|
+
}
|
|
247
|
+
interface IVariantOptionSelection {
|
|
248
|
+
id?: string;
|
|
249
|
+
group?: string;
|
|
250
|
+
value?: string;
|
|
251
|
+
optionKey: string;
|
|
252
|
+
optionName: string;
|
|
253
|
+
valueKey: string;
|
|
254
|
+
valueLabel: string;
|
|
255
|
+
sortOrder: number;
|
|
256
|
+
}
|
|
257
|
+
interface IProductOptionGroup extends BaseEntity {
|
|
258
|
+
product: IProduct;
|
|
259
|
+
optionKey: string;
|
|
260
|
+
name: string;
|
|
261
|
+
sortOrder: number;
|
|
262
|
+
status: boolean;
|
|
263
|
+
}
|
|
264
|
+
interface IProductOptionValue extends BaseEntity {
|
|
265
|
+
product: IProduct;
|
|
266
|
+
group: IProductOptionGroup;
|
|
267
|
+
valueKey: string;
|
|
268
|
+
label: string;
|
|
269
|
+
sortOrder: number;
|
|
270
|
+
status: boolean;
|
|
271
|
+
}
|
|
272
|
+
|
|
214
273
|
interface IVariant extends BaseEntity, IProductVariantFields {
|
|
215
274
|
name: string;
|
|
216
275
|
sku: string;
|
|
217
276
|
slug: string;
|
|
218
277
|
product: IProduct;
|
|
278
|
+
optionValues: IVariantOptionSelection[];
|
|
279
|
+
optionSignature?: string;
|
|
280
|
+
variantOptionMode?: VariantOptionMode;
|
|
219
281
|
}
|
|
220
282
|
|
|
221
283
|
interface IProduct extends BaseEntity, IProductVariantFields {
|
|
@@ -223,6 +285,9 @@ interface IProduct extends BaseEntity, IProductVariantFields {
|
|
|
223
285
|
slug: string;
|
|
224
286
|
sku: string;
|
|
225
287
|
hasVariants: boolean;
|
|
288
|
+
variantType?: ProductVariantType;
|
|
289
|
+
variantOptions?: IProductVariantOptionGroup[];
|
|
290
|
+
variantOptionSignatures?: string[];
|
|
226
291
|
variants: IVariant[];
|
|
227
292
|
}
|
|
228
293
|
|
|
@@ -230,13 +295,7 @@ interface IOrderItem extends BaseEntity {
|
|
|
230
295
|
order: IOrder;
|
|
231
296
|
product: IProduct;
|
|
232
297
|
variant?: IVariant;
|
|
233
|
-
pricing:
|
|
234
|
-
unitPrice: number;
|
|
235
|
-
totalAmount: number;
|
|
236
|
-
};
|
|
237
|
-
quantity: number;
|
|
238
|
-
unitPrice: number;
|
|
239
|
-
totalAmount: number;
|
|
298
|
+
pricing: ILinePricing;
|
|
240
299
|
metaData: Metadata;
|
|
241
300
|
}
|
|
242
301
|
|
|
@@ -323,12 +382,10 @@ interface IOrder extends BaseEntity {
|
|
|
323
382
|
status: OrderStatusEnum;
|
|
324
383
|
paymentStatus: PaymentStatusEnum;
|
|
325
384
|
paymentMethod: PaymentMethodEnum;
|
|
326
|
-
subTotalAmount: number;
|
|
327
|
-
discountAmount: number;
|
|
328
|
-
totalAmount: number;
|
|
329
385
|
metaData: Metadata;
|
|
330
386
|
orderTransactions: IOrderTransaction[];
|
|
331
387
|
refundTransactions: IRefundTransaction[];
|
|
388
|
+
pricing: ISummaryPricing;
|
|
332
389
|
}
|
|
333
390
|
|
|
334
391
|
interface ICustomer extends BaseEntity {
|
|
@@ -481,12 +538,7 @@ interface ICartItem extends BaseEntity {
|
|
|
481
538
|
cart: ICart;
|
|
482
539
|
product: IProduct;
|
|
483
540
|
variant?: IVariant;
|
|
484
|
-
pricing:
|
|
485
|
-
unitPrice: number;
|
|
486
|
-
totalAmount: number;
|
|
487
|
-
};
|
|
488
|
-
quantity: number;
|
|
489
|
-
totalAmount: number;
|
|
541
|
+
pricing: ILinePricing;
|
|
490
542
|
metaData: Metadata;
|
|
491
543
|
}
|
|
492
544
|
|
|
@@ -497,9 +549,7 @@ interface ICart extends BaseEntity {
|
|
|
497
549
|
coupon?: ICoupon;
|
|
498
550
|
store: IStore;
|
|
499
551
|
metaData: Metadata;
|
|
500
|
-
|
|
501
|
-
discountAmount: number;
|
|
502
|
-
totalAmount: number;
|
|
552
|
+
pricing: ISummaryPricing;
|
|
503
553
|
}
|
|
504
554
|
|
|
505
|
-
export { ADMIN_ROLES, type ApiResponse, type BaseEntity, DiscountTypeEnum, type IAddonConfig, type IAddonGroup, 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 IKeyValue, type IMediaAsset, type IOrder, type IOrderItem, type IOrderTransaction, type IPrice, type IProduct, type IProductTechnicalSpec, type IProductTechnicalSpecTable, type IProductVariantFields, type IRefundTransaction, type IRelationships, type ISEOMetaData, type IShipping, type IState, type IStock, type IStore, type IStoreSettings, type ITechSpec, type ITechnicalSpecColumn, type ITechnicalSpecGroup, type ITransactionBase, type IVariant, type Metadata, ORDER_STATUS_VALUES, OrderStatusEnum, PAYMENT_METHOD_VALUES, PAYMENT_STATUS_VALUES, type Paginated, PaymentMethodEnum, PaymentStatusEnum, type PricingType, type SoftDeleteFilter, type StockStatus, TRANSACTION_TYPE_VALUES, TransactionTypeEnum, paymentMethodColorMap, paymentStatusColorMap, statusColors, typeColorMap };
|
|
555
|
+
export { ADMIN_ROLES, type ApiResponse, type BaseEntity, DiscountTypeEnum, type IAddonConfig, type IAddonGroup, 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 IKeyValue, type ILinePricing, type IMediaAsset, type IOrder, type IOrderItem, type IOrderTransaction, type IPrice, type IProduct, type IProductOptionGroup, type IProductOptionValue, type IProductTechnicalSpec, type IProductTechnicalSpecTable, type IProductVariantFields, type IProductVariantOptionGroup, type IProductVariantOptionMatrix, type IProductVariantOptionValue, type IRefundTransaction, type IRelationships, type ISEOMetaData, type IShipping, type IState, type IStock, type IStore, type IStoreSettings, type ISummaryPricing, type ITechSpec, type ITechnicalSpecColumn, type ITechnicalSpecGroup, type ITransactionBase, type IVariant, type IVariantOptionSelection, type Metadata, ORDER_STATUS_VALUES, OrderStatusEnum, PAYMENT_METHOD_VALUES, PAYMENT_STATUS_VALUES, type Paginated, PaymentMethodEnum, PaymentStatusEnum, type PricingType, type ProductVariantType, type SoftDeleteFilter, type StockStatus, TRANSACTION_TYPE_VALUES, TransactionTypeEnum, type VariantOptionMode, paymentMethodColorMap, paymentStatusColorMap, statusColors, typeColorMap };
|
package/dist/index.d.ts
CHANGED
|
@@ -60,6 +60,20 @@ interface IPrice {
|
|
|
60
60
|
originalPrice: number;
|
|
61
61
|
discount: number;
|
|
62
62
|
}
|
|
63
|
+
interface ILinePricing {
|
|
64
|
+
quantity: number;
|
|
65
|
+
unitPrice: number;
|
|
66
|
+
totalAmount: number;
|
|
67
|
+
currencyCode: string;
|
|
68
|
+
}
|
|
69
|
+
interface ISummaryPricing {
|
|
70
|
+
subTotalAmount: number;
|
|
71
|
+
discountAmount: number;
|
|
72
|
+
taxAmount: number;
|
|
73
|
+
shippingAmount: number;
|
|
74
|
+
totalAmount: number;
|
|
75
|
+
currencyCode: string;
|
|
76
|
+
}
|
|
63
77
|
interface ITechSpec {
|
|
64
78
|
group?: string;
|
|
65
79
|
key: string;
|
|
@@ -211,11 +225,59 @@ interface IProductVariantFields {
|
|
|
211
225
|
status: boolean;
|
|
212
226
|
}
|
|
213
227
|
|
|
228
|
+
type VariantOptionMode = "OPTION_BACKED" | "MANUAL";
|
|
229
|
+
type ProductVariantType = "SINGLE" | "OPTION_BACKED" | "MANUAL";
|
|
230
|
+
interface IProductVariantOptionValue {
|
|
231
|
+
id?: string;
|
|
232
|
+
valueKey: string;
|
|
233
|
+
label: string;
|
|
234
|
+
sortOrder: number;
|
|
235
|
+
}
|
|
236
|
+
interface IProductVariantOptionGroup {
|
|
237
|
+
id?: string;
|
|
238
|
+
optionKey: string;
|
|
239
|
+
name: string;
|
|
240
|
+
sortOrder: number;
|
|
241
|
+
values: IProductVariantOptionValue[];
|
|
242
|
+
}
|
|
243
|
+
interface IProductVariantOptionMatrix {
|
|
244
|
+
groups: IProductVariantOptionGroup[];
|
|
245
|
+
optionSignatures: string[];
|
|
246
|
+
}
|
|
247
|
+
interface IVariantOptionSelection {
|
|
248
|
+
id?: string;
|
|
249
|
+
group?: string;
|
|
250
|
+
value?: string;
|
|
251
|
+
optionKey: string;
|
|
252
|
+
optionName: string;
|
|
253
|
+
valueKey: string;
|
|
254
|
+
valueLabel: string;
|
|
255
|
+
sortOrder: number;
|
|
256
|
+
}
|
|
257
|
+
interface IProductOptionGroup extends BaseEntity {
|
|
258
|
+
product: IProduct;
|
|
259
|
+
optionKey: string;
|
|
260
|
+
name: string;
|
|
261
|
+
sortOrder: number;
|
|
262
|
+
status: boolean;
|
|
263
|
+
}
|
|
264
|
+
interface IProductOptionValue extends BaseEntity {
|
|
265
|
+
product: IProduct;
|
|
266
|
+
group: IProductOptionGroup;
|
|
267
|
+
valueKey: string;
|
|
268
|
+
label: string;
|
|
269
|
+
sortOrder: number;
|
|
270
|
+
status: boolean;
|
|
271
|
+
}
|
|
272
|
+
|
|
214
273
|
interface IVariant extends BaseEntity, IProductVariantFields {
|
|
215
274
|
name: string;
|
|
216
275
|
sku: string;
|
|
217
276
|
slug: string;
|
|
218
277
|
product: IProduct;
|
|
278
|
+
optionValues: IVariantOptionSelection[];
|
|
279
|
+
optionSignature?: string;
|
|
280
|
+
variantOptionMode?: VariantOptionMode;
|
|
219
281
|
}
|
|
220
282
|
|
|
221
283
|
interface IProduct extends BaseEntity, IProductVariantFields {
|
|
@@ -223,6 +285,9 @@ interface IProduct extends BaseEntity, IProductVariantFields {
|
|
|
223
285
|
slug: string;
|
|
224
286
|
sku: string;
|
|
225
287
|
hasVariants: boolean;
|
|
288
|
+
variantType?: ProductVariantType;
|
|
289
|
+
variantOptions?: IProductVariantOptionGroup[];
|
|
290
|
+
variantOptionSignatures?: string[];
|
|
226
291
|
variants: IVariant[];
|
|
227
292
|
}
|
|
228
293
|
|
|
@@ -230,13 +295,7 @@ interface IOrderItem extends BaseEntity {
|
|
|
230
295
|
order: IOrder;
|
|
231
296
|
product: IProduct;
|
|
232
297
|
variant?: IVariant;
|
|
233
|
-
pricing:
|
|
234
|
-
unitPrice: number;
|
|
235
|
-
totalAmount: number;
|
|
236
|
-
};
|
|
237
|
-
quantity: number;
|
|
238
|
-
unitPrice: number;
|
|
239
|
-
totalAmount: number;
|
|
298
|
+
pricing: ILinePricing;
|
|
240
299
|
metaData: Metadata;
|
|
241
300
|
}
|
|
242
301
|
|
|
@@ -323,12 +382,10 @@ interface IOrder extends BaseEntity {
|
|
|
323
382
|
status: OrderStatusEnum;
|
|
324
383
|
paymentStatus: PaymentStatusEnum;
|
|
325
384
|
paymentMethod: PaymentMethodEnum;
|
|
326
|
-
subTotalAmount: number;
|
|
327
|
-
discountAmount: number;
|
|
328
|
-
totalAmount: number;
|
|
329
385
|
metaData: Metadata;
|
|
330
386
|
orderTransactions: IOrderTransaction[];
|
|
331
387
|
refundTransactions: IRefundTransaction[];
|
|
388
|
+
pricing: ISummaryPricing;
|
|
332
389
|
}
|
|
333
390
|
|
|
334
391
|
interface ICustomer extends BaseEntity {
|
|
@@ -481,12 +538,7 @@ interface ICartItem extends BaseEntity {
|
|
|
481
538
|
cart: ICart;
|
|
482
539
|
product: IProduct;
|
|
483
540
|
variant?: IVariant;
|
|
484
|
-
pricing:
|
|
485
|
-
unitPrice: number;
|
|
486
|
-
totalAmount: number;
|
|
487
|
-
};
|
|
488
|
-
quantity: number;
|
|
489
|
-
totalAmount: number;
|
|
541
|
+
pricing: ILinePricing;
|
|
490
542
|
metaData: Metadata;
|
|
491
543
|
}
|
|
492
544
|
|
|
@@ -497,9 +549,7 @@ interface ICart extends BaseEntity {
|
|
|
497
549
|
coupon?: ICoupon;
|
|
498
550
|
store: IStore;
|
|
499
551
|
metaData: Metadata;
|
|
500
|
-
|
|
501
|
-
discountAmount: number;
|
|
502
|
-
totalAmount: number;
|
|
552
|
+
pricing: ISummaryPricing;
|
|
503
553
|
}
|
|
504
554
|
|
|
505
|
-
export { ADMIN_ROLES, type ApiResponse, type BaseEntity, DiscountTypeEnum, type IAddonConfig, type IAddonGroup, 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 IKeyValue, type IMediaAsset, type IOrder, type IOrderItem, type IOrderTransaction, type IPrice, type IProduct, type IProductTechnicalSpec, type IProductTechnicalSpecTable, type IProductVariantFields, type IRefundTransaction, type IRelationships, type ISEOMetaData, type IShipping, type IState, type IStock, type IStore, type IStoreSettings, type ITechSpec, type ITechnicalSpecColumn, type ITechnicalSpecGroup, type ITransactionBase, type IVariant, type Metadata, ORDER_STATUS_VALUES, OrderStatusEnum, PAYMENT_METHOD_VALUES, PAYMENT_STATUS_VALUES, type Paginated, PaymentMethodEnum, PaymentStatusEnum, type PricingType, type SoftDeleteFilter, type StockStatus, TRANSACTION_TYPE_VALUES, TransactionTypeEnum, paymentMethodColorMap, paymentStatusColorMap, statusColors, typeColorMap };
|
|
555
|
+
export { ADMIN_ROLES, type ApiResponse, type BaseEntity, DiscountTypeEnum, type IAddonConfig, type IAddonGroup, 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 IKeyValue, type ILinePricing, type IMediaAsset, type IOrder, type IOrderItem, type IOrderTransaction, type IPrice, type IProduct, type IProductOptionGroup, type IProductOptionValue, type IProductTechnicalSpec, type IProductTechnicalSpecTable, type IProductVariantFields, type IProductVariantOptionGroup, type IProductVariantOptionMatrix, type IProductVariantOptionValue, type IRefundTransaction, type IRelationships, type ISEOMetaData, type IShipping, type IState, type IStock, type IStore, type IStoreSettings, type ISummaryPricing, type ITechSpec, type ITechnicalSpecColumn, type ITechnicalSpecGroup, type ITransactionBase, type IVariant, type IVariantOptionSelection, type Metadata, ORDER_STATUS_VALUES, OrderStatusEnum, PAYMENT_METHOD_VALUES, PAYMENT_STATUS_VALUES, type Paginated, PaymentMethodEnum, PaymentStatusEnum, type PricingType, type ProductVariantType, type SoftDeleteFilter, type StockStatus, TRANSACTION_TYPE_VALUES, TransactionTypeEnum, type VariantOptionMode, paymentMethodColorMap, paymentStatusColorMap, statusColors, typeColorMap };
|
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 './productTechnicalSpec';\nexport * from './addonConfig';\nexport * from './variant';\nexport * from './productVariant';\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 customer: ICustomer;\n coupon: ICoupon;\n store: IStore;\n status: OrderStatusEnum;\n paymentStatus: PaymentStatusEnum;\n paymentMethod: PaymentMethodEnum;\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 './productVariantOptions';\nexport * from './productTechnicalSpec';\nexport * from './addonConfig';\nexport * from './variant';\nexport * from './productVariant';\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 { ISummaryPricing, 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 customer: ICustomer;\n coupon: ICoupon;\n store: IStore;\n status: OrderStatusEnum;\n paymentStatus: PaymentStatusEnum;\n paymentMethod: PaymentMethodEnum;\n metaData: Metadata;\n orderTransactions: IOrderTransaction[];\n refundTransactions: IRefundTransaction[];\n pricing: ISummaryPricing;\n}\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;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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ACpE,CAAC,kBAAkB,WAAW,GAAG;AAAA,EACjC,CAAC,kBAAkB,MAAM,GAAG;AAAA,EAC5B,CAAC,kBAAkB,MAAM,GAAG;AAAA,EAC5B,CAAC,kBAAkB,KAAK,GAAG;AAAA,EAC3B,CAAC,kBAAkB,SAAS,GAAG;AACnC;AAEO,IAAM,sBAAsB;AAAA,EAC/B,OAAO;AAAA,EACP,QAAQ;AACZ;AAIO,IAAM,0BAA0B,OAAO,OAAO,mBAAmB;AAEjE,IAAM,eAAoD;AAAA,EAC7D,CAAC,oBAAoB,KAAK,GAAG;AAAA,EAC7B,CAAC,oBAAoB,MAAM,GAAG;AAClC;","names":[]}
|
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\";\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 customer: ICustomer;\n coupon: ICoupon;\n store: IStore;\n status: OrderStatusEnum;\n paymentStatus: PaymentStatusEnum;\n paymentMethod: PaymentMethodEnum;\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 { ISummaryPricing, 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 customer: ICustomer;\n coupon: ICoupon;\n store: IStore;\n status: OrderStatusEnum;\n paymentStatus: PaymentStatusEnum;\n paymentMethod: PaymentMethodEnum;\n metaData: Metadata;\n orderTransactions: IOrderTransaction[];\n refundTransactions: IRefundTransaction[];\n pricing: ISummaryPricing;\n}\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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