@fas-core/shared-types 1.0.28 → 1.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -20,67 +20,6 @@ interface ICountry extends BaseEntity {
20
20
  status: boolean;
21
21
  }
22
22
 
23
- interface ICustomer extends BaseEntity {
24
- firstName: string;
25
- lastName: string;
26
- profileImage: string;
27
- address: IAddress;
28
- email: string;
29
- phoneNumber: string;
30
- password?: string;
31
- status: boolean;
32
- lastLogin: Date;
33
- authProvider: "credentials" | "google" | "apple" | "facebook" | string | null;
34
- googleId: string;
35
- emailVerified?: boolean;
36
- hasPassword: boolean;
37
- allowedStores: Array<string | Types.ObjectId>;
38
- isStoreAdmin: boolean;
39
- }
40
-
41
- interface IState extends BaseEntity {
42
- country: ICountry;
43
- name: string;
44
- slug: string;
45
- isoCode: string;
46
- subdivision: string;
47
- status: boolean;
48
- }
49
-
50
- interface IAddress extends BaseEntity {
51
- addressLine1: string;
52
- addressLine2: string;
53
- city: string;
54
- zipCode: string;
55
- firstName: string;
56
- lastName: string;
57
- email: string;
58
- phoneNumber: string;
59
- defaultAddress: boolean;
60
- state: IState;
61
- country: ICountry;
62
- customer: ICustomer;
63
- }
64
-
65
- type IAdminRoleType = 'Admin' | 'Super Admin' | 'Cashier' | 'Manager' | 'CEO' | 'Driver' | 'Security Guard' | 'Accountant';
66
- declare const ADMIN_ROLES: IAdminRoleType[];
67
- interface IAdmin extends BaseEntity {
68
- firstName: string;
69
- lastName: string;
70
- email: string;
71
- phoneNumber: string;
72
- status: boolean;
73
- password: string;
74
- role: IAdminRoleType;
75
- access_list: string[];
76
- joiningDate: Date;
77
- profileImage: string;
78
- lastLogin: Date;
79
- }
80
- type IAdminCreate = Omit<IAdmin, keyof BaseEntity>;
81
- type IAdminUpdate = Partial<IAdminCreate>;
82
- type IAdminSafe = Omit<IAdmin, 'password'>;
83
-
84
23
  interface Paginated<T> {
85
24
  data: T[];
86
25
  total: number;
@@ -182,23 +121,6 @@ interface IStore extends BaseEntity {
182
121
  storeAdmins: Array<string | Types.ObjectId>;
183
122
  }
184
123
 
185
- interface IContact extends BaseEntity {
186
- firstName: string;
187
- lastName: string;
188
- companyName?: string;
189
- email: string;
190
- phone: string;
191
- category: "sales" | "support" | "orders" | "returns" | "parts" | "other";
192
- subject: string;
193
- message: string;
194
- status: 'new' | 'in-progress' | 'resolved' | 'closed';
195
- source: 'website' | 'email' | 'phone' | 'chat' | 'other';
196
- caseId: string;
197
- notes: string;
198
- store: IStore;
199
- resolvedAt?: Date;
200
- }
201
-
202
124
  declare const DiscountTypeEnum: {
203
125
  readonly PERCENTAGE: "PERCENTAGE";
204
126
  readonly FIXED: "FIXED";
@@ -311,35 +233,47 @@ interface IOrderItem extends BaseEntity {
311
233
  metaData: Metadata;
312
234
  }
313
235
 
236
+ declare const PaymentStatusEnum: {
237
+ readonly INITIATED: "INITIATED";
238
+ readonly PENDING: "PENDING";
239
+ readonly PROCESSING: "PROCESSING";
240
+ readonly FAILED: "FAILED";
241
+ readonly CANCELLED: "CANCELLED";
242
+ readonly PENDING_CAPTURE: "PENDING_CAPTURE";
243
+ readonly COMPLETED: "COMPLETED";
244
+ readonly VOIDED: "VOIDED";
245
+ readonly REDIRECTED_TO_GATEWAY: "REDIRECTED_TO_GATEWAY";
246
+ readonly UNKNOWN: "UNKNOWN";
247
+ readonly REFUNDED: "REFUNDED";
248
+ readonly PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED";
249
+ };
250
+ type PaymentStatusEnum = (typeof PaymentStatusEnum)[keyof typeof PaymentStatusEnum];
251
+ declare const PAYMENT_STATUS_VALUES: ("INITIATED" | "PENDING" | "PROCESSING" | "FAILED" | "CANCELLED" | "PENDING_CAPTURE" | "COMPLETED" | "VOIDED" | "REDIRECTED_TO_GATEWAY" | "UNKNOWN" | "REFUNDED" | "PARTIALLY_REFUNDED")[];
252
+ declare const paymentStatusColorMap: Record<PaymentStatusEnum, string>;
253
+ declare const PaymentMethodEnum: {
254
+ readonly CREDIT_CARD: "CREDIT_CARD";
255
+ readonly PAYPAL: "PAYPAL";
256
+ readonly STRIPE: "STRIPE";
257
+ readonly CHECK: "CHECK";
258
+ readonly APPLE_PAY: "APPLE_PAY";
259
+ };
260
+ type PaymentMethodEnum = (typeof PaymentMethodEnum)[keyof typeof PaymentMethodEnum];
261
+ declare const PAYMENT_METHOD_VALUES: ("CREDIT_CARD" | "PAYPAL" | "STRIPE" | "CHECK" | "APPLE_PAY")[];
262
+ declare const paymentMethodColorMap: Record<PaymentMethodEnum, string>;
314
263
  declare const TransactionTypeEnum: {
315
264
  readonly ORDER: "ORDER";
316
265
  readonly REFUND: "REFUND";
317
266
  };
318
267
  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
268
  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
269
  declare const typeColorMap: Record<TransactionTypeEnum, string>;
336
270
  interface ITransactionBase extends BaseEntity {
337
271
  order: IOrder;
338
272
  currency: ICurrency;
339
273
  transactionId: string;
340
274
  amount: number;
341
- status: TransactionStatusEnum;
342
- paymentMethod?: string;
275
+ status: PaymentStatusEnum;
276
+ paymentMethod: PaymentMethodEnum;
343
277
  gatewayId?: string;
344
278
  metaData?: Metadata;
345
279
  comment?: string;
@@ -356,6 +290,8 @@ interface IRefundTransaction extends ITransactionBase {
356
290
  }
357
291
 
358
292
  declare const OrderStatusEnum: {
293
+ readonly CREATED: "CREATED";
294
+ readonly RECEIVED: "RECEIVED";
359
295
  readonly PENDING: "PENDING";
360
296
  readonly CONFIRMED: "CONFIRMED";
361
297
  readonly PROCESSING: "PROCESSING";
@@ -365,17 +301,21 @@ declare const OrderStatusEnum: {
365
301
  readonly FAILED: "FAILED";
366
302
  readonly REFUNDED: "REFUNDED";
367
303
  readonly PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED";
304
+ readonly ARCHIVED: "ARCHIVED";
305
+ readonly RETURNED: "RETURNED";
368
306
  };
369
307
  type OrderStatusEnum = (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum];
370
- declare const ORDER_STATUS_VALUES: ("PENDING" | "FAILED" | "CANCELED" | "PARTIALLY_REFUNDED" | "REFUNDED" | "CONFIRMED" | "PROCESSING" | "SHIPPED" | "DELIVERED")[];
308
+ declare const ORDER_STATUS_VALUES: ("PENDING" | "PROCESSING" | "FAILED" | "REFUNDED" | "PARTIALLY_REFUNDED" | "CREATED" | "RECEIVED" | "CONFIRMED" | "SHIPPED" | "DELIVERED" | "CANCELED" | "ARCHIVED" | "RETURNED")[];
371
309
  declare const statusColors: Record<OrderStatusEnum, string>;
372
310
  interface IOrder extends BaseEntity {
373
311
  orderId: string;
374
312
  orderItems: IOrderItem[];
375
- user: ICustomer;
313
+ customer: ICustomer;
376
314
  coupon: ICoupon;
377
315
  store: IStore;
378
316
  status: OrderStatusEnum;
317
+ paymentStatus: PaymentStatusEnum;
318
+ paymentMethod: PaymentMethodEnum;
379
319
  subTotalAmount: number;
380
320
  discountAmount: number;
381
321
  totalAmount: number;
@@ -384,6 +324,85 @@ interface IOrder extends BaseEntity {
384
324
  refundTransactions: IRefundTransaction[];
385
325
  }
386
326
 
327
+ interface ICustomer extends BaseEntity {
328
+ firstName: string;
329
+ lastName: string;
330
+ profileImage: string;
331
+ address: IAddress;
332
+ email: string;
333
+ phoneNumber: string;
334
+ password?: string;
335
+ status: boolean;
336
+ lastLogin: Date;
337
+ authProvider: "credentials" | "google" | "apple" | "facebook" | string | null;
338
+ googleId: string;
339
+ emailVerified?: boolean;
340
+ hasPassword: boolean;
341
+ allowedStores: Array<string | Types.ObjectId>;
342
+ orders: IOrder[];
343
+ isStoreAdmin: boolean;
344
+ }
345
+
346
+ interface IState extends BaseEntity {
347
+ country: ICountry;
348
+ name: string;
349
+ slug: string;
350
+ isoCode: string;
351
+ subdivision: string;
352
+ status: boolean;
353
+ }
354
+
355
+ interface IAddress extends BaseEntity {
356
+ addressLine1: string;
357
+ addressLine2: string;
358
+ city: string;
359
+ zipCode: string;
360
+ firstName: string;
361
+ lastName: string;
362
+ email: string;
363
+ phoneNumber: string;
364
+ defaultAddress: boolean;
365
+ state: IState;
366
+ country: ICountry;
367
+ customer: ICustomer;
368
+ }
369
+
370
+ type IAdminRoleType = 'Admin' | 'Super Admin' | 'Cashier' | 'Manager' | 'CEO' | 'Driver' | 'Security Guard' | 'Accountant';
371
+ declare const ADMIN_ROLES: IAdminRoleType[];
372
+ interface IAdmin extends BaseEntity {
373
+ firstName: string;
374
+ lastName: string;
375
+ email: string;
376
+ phoneNumber: string;
377
+ status: boolean;
378
+ password: string;
379
+ role: IAdminRoleType;
380
+ access_list: string[];
381
+ joiningDate: Date;
382
+ profileImage: string;
383
+ lastLogin: Date;
384
+ }
385
+ type IAdminCreate = Omit<IAdmin, keyof BaseEntity>;
386
+ type IAdminUpdate = Partial<IAdminCreate>;
387
+ type IAdminSafe = Omit<IAdmin, 'password'>;
388
+
389
+ interface IContact extends BaseEntity {
390
+ firstName: string;
391
+ lastName: string;
392
+ companyName?: string;
393
+ email: string;
394
+ phone: string;
395
+ category: "sales" | "support" | "orders" | "returns" | "parts" | "other";
396
+ subject: string;
397
+ message: string;
398
+ status: 'new' | 'in-progress' | 'resolved' | 'closed';
399
+ source: 'website' | 'email' | 'phone' | 'chat' | 'other';
400
+ caseId: string;
401
+ notes: string;
402
+ store: IStore;
403
+ resolvedAt?: Date;
404
+ }
405
+
387
406
  interface ICartItem extends BaseEntity {
388
407
  cart: ICart;
389
408
  product: IProduct;
@@ -409,4 +428,4 @@ interface ICart extends BaseEntity {
409
428
  totalAmount: number;
410
429
  }
411
430
 
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 };
431
+ 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
@@ -20,67 +20,6 @@ interface ICountry extends BaseEntity {
20
20
  status: boolean;
21
21
  }
22
22
 
23
- interface ICustomer extends BaseEntity {
24
- firstName: string;
25
- lastName: string;
26
- profileImage: string;
27
- address: IAddress;
28
- email: string;
29
- phoneNumber: string;
30
- password?: string;
31
- status: boolean;
32
- lastLogin: Date;
33
- authProvider: "credentials" | "google" | "apple" | "facebook" | string | null;
34
- googleId: string;
35
- emailVerified?: boolean;
36
- hasPassword: boolean;
37
- allowedStores: Array<string | Types.ObjectId>;
38
- isStoreAdmin: boolean;
39
- }
40
-
41
- interface IState extends BaseEntity {
42
- country: ICountry;
43
- name: string;
44
- slug: string;
45
- isoCode: string;
46
- subdivision: string;
47
- status: boolean;
48
- }
49
-
50
- interface IAddress extends BaseEntity {
51
- addressLine1: string;
52
- addressLine2: string;
53
- city: string;
54
- zipCode: string;
55
- firstName: string;
56
- lastName: string;
57
- email: string;
58
- phoneNumber: string;
59
- defaultAddress: boolean;
60
- state: IState;
61
- country: ICountry;
62
- customer: ICustomer;
63
- }
64
-
65
- type IAdminRoleType = 'Admin' | 'Super Admin' | 'Cashier' | 'Manager' | 'CEO' | 'Driver' | 'Security Guard' | 'Accountant';
66
- declare const ADMIN_ROLES: IAdminRoleType[];
67
- interface IAdmin extends BaseEntity {
68
- firstName: string;
69
- lastName: string;
70
- email: string;
71
- phoneNumber: string;
72
- status: boolean;
73
- password: string;
74
- role: IAdminRoleType;
75
- access_list: string[];
76
- joiningDate: Date;
77
- profileImage: string;
78
- lastLogin: Date;
79
- }
80
- type IAdminCreate = Omit<IAdmin, keyof BaseEntity>;
81
- type IAdminUpdate = Partial<IAdminCreate>;
82
- type IAdminSafe = Omit<IAdmin, 'password'>;
83
-
84
23
  interface Paginated<T> {
85
24
  data: T[];
86
25
  total: number;
@@ -182,23 +121,6 @@ interface IStore extends BaseEntity {
182
121
  storeAdmins: Array<string | Types.ObjectId>;
183
122
  }
184
123
 
185
- interface IContact extends BaseEntity {
186
- firstName: string;
187
- lastName: string;
188
- companyName?: string;
189
- email: string;
190
- phone: string;
191
- category: "sales" | "support" | "orders" | "returns" | "parts" | "other";
192
- subject: string;
193
- message: string;
194
- status: 'new' | 'in-progress' | 'resolved' | 'closed';
195
- source: 'website' | 'email' | 'phone' | 'chat' | 'other';
196
- caseId: string;
197
- notes: string;
198
- store: IStore;
199
- resolvedAt?: Date;
200
- }
201
-
202
124
  declare const DiscountTypeEnum: {
203
125
  readonly PERCENTAGE: "PERCENTAGE";
204
126
  readonly FIXED: "FIXED";
@@ -311,35 +233,47 @@ interface IOrderItem extends BaseEntity {
311
233
  metaData: Metadata;
312
234
  }
313
235
 
236
+ declare const PaymentStatusEnum: {
237
+ readonly INITIATED: "INITIATED";
238
+ readonly PENDING: "PENDING";
239
+ readonly PROCESSING: "PROCESSING";
240
+ readonly FAILED: "FAILED";
241
+ readonly CANCELLED: "CANCELLED";
242
+ readonly PENDING_CAPTURE: "PENDING_CAPTURE";
243
+ readonly COMPLETED: "COMPLETED";
244
+ readonly VOIDED: "VOIDED";
245
+ readonly REDIRECTED_TO_GATEWAY: "REDIRECTED_TO_GATEWAY";
246
+ readonly UNKNOWN: "UNKNOWN";
247
+ readonly REFUNDED: "REFUNDED";
248
+ readonly PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED";
249
+ };
250
+ type PaymentStatusEnum = (typeof PaymentStatusEnum)[keyof typeof PaymentStatusEnum];
251
+ declare const PAYMENT_STATUS_VALUES: ("INITIATED" | "PENDING" | "PROCESSING" | "FAILED" | "CANCELLED" | "PENDING_CAPTURE" | "COMPLETED" | "VOIDED" | "REDIRECTED_TO_GATEWAY" | "UNKNOWN" | "REFUNDED" | "PARTIALLY_REFUNDED")[];
252
+ declare const paymentStatusColorMap: Record<PaymentStatusEnum, string>;
253
+ declare const PaymentMethodEnum: {
254
+ readonly CREDIT_CARD: "CREDIT_CARD";
255
+ readonly PAYPAL: "PAYPAL";
256
+ readonly STRIPE: "STRIPE";
257
+ readonly CHECK: "CHECK";
258
+ readonly APPLE_PAY: "APPLE_PAY";
259
+ };
260
+ type PaymentMethodEnum = (typeof PaymentMethodEnum)[keyof typeof PaymentMethodEnum];
261
+ declare const PAYMENT_METHOD_VALUES: ("CREDIT_CARD" | "PAYPAL" | "STRIPE" | "CHECK" | "APPLE_PAY")[];
262
+ declare const paymentMethodColorMap: Record<PaymentMethodEnum, string>;
314
263
  declare const TransactionTypeEnum: {
315
264
  readonly ORDER: "ORDER";
316
265
  readonly REFUND: "REFUND";
317
266
  };
318
267
  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
268
  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
269
  declare const typeColorMap: Record<TransactionTypeEnum, string>;
336
270
  interface ITransactionBase extends BaseEntity {
337
271
  order: IOrder;
338
272
  currency: ICurrency;
339
273
  transactionId: string;
340
274
  amount: number;
341
- status: TransactionStatusEnum;
342
- paymentMethod?: string;
275
+ status: PaymentStatusEnum;
276
+ paymentMethod: PaymentMethodEnum;
343
277
  gatewayId?: string;
344
278
  metaData?: Metadata;
345
279
  comment?: string;
@@ -356,6 +290,8 @@ interface IRefundTransaction extends ITransactionBase {
356
290
  }
357
291
 
358
292
  declare const OrderStatusEnum: {
293
+ readonly CREATED: "CREATED";
294
+ readonly RECEIVED: "RECEIVED";
359
295
  readonly PENDING: "PENDING";
360
296
  readonly CONFIRMED: "CONFIRMED";
361
297
  readonly PROCESSING: "PROCESSING";
@@ -365,17 +301,21 @@ declare const OrderStatusEnum: {
365
301
  readonly FAILED: "FAILED";
366
302
  readonly REFUNDED: "REFUNDED";
367
303
  readonly PARTIALLY_REFUNDED: "PARTIALLY_REFUNDED";
304
+ readonly ARCHIVED: "ARCHIVED";
305
+ readonly RETURNED: "RETURNED";
368
306
  };
369
307
  type OrderStatusEnum = (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum];
370
- declare const ORDER_STATUS_VALUES: ("PENDING" | "FAILED" | "CANCELED" | "PARTIALLY_REFUNDED" | "REFUNDED" | "CONFIRMED" | "PROCESSING" | "SHIPPED" | "DELIVERED")[];
308
+ declare const ORDER_STATUS_VALUES: ("PENDING" | "PROCESSING" | "FAILED" | "REFUNDED" | "PARTIALLY_REFUNDED" | "CREATED" | "RECEIVED" | "CONFIRMED" | "SHIPPED" | "DELIVERED" | "CANCELED" | "ARCHIVED" | "RETURNED")[];
371
309
  declare const statusColors: Record<OrderStatusEnum, string>;
372
310
  interface IOrder extends BaseEntity {
373
311
  orderId: string;
374
312
  orderItems: IOrderItem[];
375
- user: ICustomer;
313
+ customer: ICustomer;
376
314
  coupon: ICoupon;
377
315
  store: IStore;
378
316
  status: OrderStatusEnum;
317
+ paymentStatus: PaymentStatusEnum;
318
+ paymentMethod: PaymentMethodEnum;
379
319
  subTotalAmount: number;
380
320
  discountAmount: number;
381
321
  totalAmount: number;
@@ -384,6 +324,85 @@ interface IOrder extends BaseEntity {
384
324
  refundTransactions: IRefundTransaction[];
385
325
  }
386
326
 
327
+ interface ICustomer extends BaseEntity {
328
+ firstName: string;
329
+ lastName: string;
330
+ profileImage: string;
331
+ address: IAddress;
332
+ email: string;
333
+ phoneNumber: string;
334
+ password?: string;
335
+ status: boolean;
336
+ lastLogin: Date;
337
+ authProvider: "credentials" | "google" | "apple" | "facebook" | string | null;
338
+ googleId: string;
339
+ emailVerified?: boolean;
340
+ hasPassword: boolean;
341
+ allowedStores: Array<string | Types.ObjectId>;
342
+ orders: IOrder[];
343
+ isStoreAdmin: boolean;
344
+ }
345
+
346
+ interface IState extends BaseEntity {
347
+ country: ICountry;
348
+ name: string;
349
+ slug: string;
350
+ isoCode: string;
351
+ subdivision: string;
352
+ status: boolean;
353
+ }
354
+
355
+ interface IAddress extends BaseEntity {
356
+ addressLine1: string;
357
+ addressLine2: string;
358
+ city: string;
359
+ zipCode: string;
360
+ firstName: string;
361
+ lastName: string;
362
+ email: string;
363
+ phoneNumber: string;
364
+ defaultAddress: boolean;
365
+ state: IState;
366
+ country: ICountry;
367
+ customer: ICustomer;
368
+ }
369
+
370
+ type IAdminRoleType = 'Admin' | 'Super Admin' | 'Cashier' | 'Manager' | 'CEO' | 'Driver' | 'Security Guard' | 'Accountant';
371
+ declare const ADMIN_ROLES: IAdminRoleType[];
372
+ interface IAdmin extends BaseEntity {
373
+ firstName: string;
374
+ lastName: string;
375
+ email: string;
376
+ phoneNumber: string;
377
+ status: boolean;
378
+ password: string;
379
+ role: IAdminRoleType;
380
+ access_list: string[];
381
+ joiningDate: Date;
382
+ profileImage: string;
383
+ lastLogin: Date;
384
+ }
385
+ type IAdminCreate = Omit<IAdmin, keyof BaseEntity>;
386
+ type IAdminUpdate = Partial<IAdminCreate>;
387
+ type IAdminSafe = Omit<IAdmin, 'password'>;
388
+
389
+ interface IContact extends BaseEntity {
390
+ firstName: string;
391
+ lastName: string;
392
+ companyName?: string;
393
+ email: string;
394
+ phone: string;
395
+ category: "sales" | "support" | "orders" | "returns" | "parts" | "other";
396
+ subject: string;
397
+ message: string;
398
+ status: 'new' | 'in-progress' | 'resolved' | 'closed';
399
+ source: 'website' | 'email' | 'phone' | 'chat' | 'other';
400
+ caseId: string;
401
+ notes: string;
402
+ store: IStore;
403
+ resolvedAt?: Date;
404
+ }
405
+
387
406
  interface ICartItem extends BaseEntity {
388
407
  cart: ICart;
389
408
  product: IProduct;
@@ -409,4 +428,4 @@ interface ICart extends BaseEntity {
409
428
  totalAmount: number;
410
429
  }
411
430
 
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 };
431
+ 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
- TRANSACTION_STATUS_VALUES: () => TRANSACTION_STATUS_VALUES,
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
- statusColorMap: () => statusColorMap,
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];\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":[]}
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 customer: 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}\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;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,oBAAoB;AAAA,EAC7B,WAAW;AAAA,EACX,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,uBAAuB;AAAA,EACvB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,oBAAoB;AACxB;AAGO,IAAM,wBAAwB,OAAO,OAAO,iBAAiB;AAE7D,IAAM,wBAA2D;AAAA,EACpE,CAAC,kBAAkB,SAAS,GAAG;AAAA,EAC/B,CAAC,kBAAkB,OAAO,GAAG;AAAA,EAC7B,CAAC,kBAAkB,UAAU,GAAG;AAAA,EAChC,CAAC,kBAAkB,MAAM,GAAG;AAAA,EAC5B,CAAC,kBAAkB,SAAS,GAAG;AAAA,EAC/B,CAAC,kBAAkB,eAAe,GAAG;AAAA,EACrC,CAAC,kBAAkB,SAAS,GAAG;AAAA,EAC/B,CAAC,kBAAkB,MAAM,GAAG;AAAA,EAC5B,CAAC,kBAAkB,qBAAqB,GAAG;AAAA,EAC3C,CAAC,kBAAkB,OAAO,GAAG;AAAA,EAC7B,CAAC,kBAAkB,QAAQ,GAAG;AAAA,EAC9B,CAAC,kBAAkB,kBAAkB,GAAG;AAC5C;AAEO,IAAM,oBAAoB;AAAA,EAC7B,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AACf;AAGO,IAAM,wBAAwB,OAAO,OAAO,iBAAiB;AAE7D,IAAM,wBAA2D;AAAA,EACpE,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 CHANGED
@@ -18,6 +18,8 @@ var DiscountTypeEnum = {
18
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
- TRANSACTION_STATUS_VALUES,
111
+ PAYMENT_METHOD_VALUES,
112
+ PAYMENT_STATUS_VALUES,
113
+ PaymentMethodEnum,
114
+ PaymentStatusEnum,
77
115
  TRANSACTION_TYPE_VALUES,
78
- TransactionStatusEnum,
79
116
  TransactionTypeEnum,
80
- statusColorMap,
117
+ paymentMethodColorMap,
118
+ paymentStatusColorMap,
81
119
  statusColors,
82
120
  typeColorMap
83
121
  };
@@ -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\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":[]}
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 subTotalAmount: number;\n discountAmount: number;\n totalAmount: number;\n metaData: Metadata;\n orderTransactions: IOrderTransaction[];\n refundTransactions: IRefundTransaction[];\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":"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","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fas-core/shared-types",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "description": "FAS Core Shared Types - A collection of shared TypeScript types for the FAS Core SDK.",
5
5
  "author": "ibreakloops",
6
6
  "license": "UNLICENSED",