@fas-core/shared-types 1.0.30 → 1.0.32
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 +29 -21
- package/dist/index.d.ts +29 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -39,6 +39,11 @@ interface SoftDeleteFilter {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
type Metadata = Record<string, unknown>;
|
|
42
|
+
interface IKeyValue {
|
|
43
|
+
key: string;
|
|
44
|
+
label?: string;
|
|
45
|
+
value: unknown;
|
|
46
|
+
}
|
|
42
47
|
interface ISEOMetaData {
|
|
43
48
|
title: string;
|
|
44
49
|
description: string;
|
|
@@ -142,11 +147,12 @@ interface ICoupon extends BaseEntity {
|
|
|
142
147
|
stores: IStore[];
|
|
143
148
|
}
|
|
144
149
|
|
|
145
|
-
interface
|
|
150
|
+
interface IBrand extends BaseEntity {
|
|
146
151
|
name: string;
|
|
147
|
-
sku: string;
|
|
148
152
|
slug: string;
|
|
149
|
-
|
|
153
|
+
description: string;
|
|
154
|
+
logo: string;
|
|
155
|
+
stores: IStore[];
|
|
150
156
|
status: boolean;
|
|
151
157
|
metaData: Metadata;
|
|
152
158
|
seoMetaData: ISEOMetaData;
|
|
@@ -165,22 +171,11 @@ interface ICategory extends BaseEntity {
|
|
|
165
171
|
subCategories?: ICategory[];
|
|
166
172
|
}
|
|
167
173
|
|
|
168
|
-
interface IBrand extends BaseEntity {
|
|
169
|
-
name: string;
|
|
170
|
-
slug: string;
|
|
171
|
-
description: string;
|
|
172
|
-
logo: string;
|
|
173
|
-
store: IStore;
|
|
174
|
-
status: boolean;
|
|
175
|
-
metaData: Metadata;
|
|
176
|
-
seoMetaData: ISEOMetaData;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
174
|
type StockStatus = "IN_STOCK" | "LOW_STOCK" | "OUT_OF_STOCK";
|
|
180
175
|
interface IStock extends BaseEntity {
|
|
181
176
|
sku: string;
|
|
182
177
|
product: IProduct;
|
|
183
|
-
variant
|
|
178
|
+
variant?: IVariant | null;
|
|
184
179
|
store: IStore;
|
|
185
180
|
quantity: number;
|
|
186
181
|
reserved: number;
|
|
@@ -189,17 +184,13 @@ interface IStock extends BaseEntity {
|
|
|
189
184
|
lowStockThreshold: number;
|
|
190
185
|
}
|
|
191
186
|
|
|
192
|
-
interface
|
|
193
|
-
name: string;
|
|
194
|
-
slug: string;
|
|
195
|
-
sku: string;
|
|
187
|
+
interface IProductVariantFields {
|
|
196
188
|
description: string;
|
|
197
189
|
price: IPrice;
|
|
198
190
|
quantity: number;
|
|
199
191
|
brand: IBrand;
|
|
200
192
|
store: IStore;
|
|
201
193
|
stock: IStock;
|
|
202
|
-
variants: IVariant[];
|
|
203
194
|
category: ICategory;
|
|
204
195
|
categories: ICategory[];
|
|
205
196
|
images: string[];
|
|
@@ -219,6 +210,23 @@ interface IProduct extends BaseEntity {
|
|
|
219
210
|
status: boolean;
|
|
220
211
|
}
|
|
221
212
|
|
|
213
|
+
interface IVariant extends BaseEntity, IProductVariantFields {
|
|
214
|
+
name: string;
|
|
215
|
+
sku: string;
|
|
216
|
+
slug: string;
|
|
217
|
+
product: IProduct;
|
|
218
|
+
variantAttributes: IKeyValue[];
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
interface IProduct extends BaseEntity, IProductVariantFields {
|
|
222
|
+
name: string;
|
|
223
|
+
slug: string;
|
|
224
|
+
sku: string;
|
|
225
|
+
hasVariants: boolean;
|
|
226
|
+
variantOptions: IKeyValue[];
|
|
227
|
+
variants: IVariant[];
|
|
228
|
+
}
|
|
229
|
+
|
|
222
230
|
interface IOrderItem extends BaseEntity {
|
|
223
231
|
order: IOrder;
|
|
224
232
|
product: IProduct;
|
|
@@ -428,4 +436,4 @@ interface ICart extends BaseEntity {
|
|
|
428
436
|
totalAmount: number;
|
|
429
437
|
}
|
|
430
438
|
|
|
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 };
|
|
439
|
+
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 IKeyValue, type IOrder, type IOrderItem, type IOrderTransaction, type IPrice, type IProduct, type IProductVariantFields, 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
|
@@ -39,6 +39,11 @@ interface SoftDeleteFilter {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
type Metadata = Record<string, unknown>;
|
|
42
|
+
interface IKeyValue {
|
|
43
|
+
key: string;
|
|
44
|
+
label?: string;
|
|
45
|
+
value: unknown;
|
|
46
|
+
}
|
|
42
47
|
interface ISEOMetaData {
|
|
43
48
|
title: string;
|
|
44
49
|
description: string;
|
|
@@ -142,11 +147,12 @@ interface ICoupon extends BaseEntity {
|
|
|
142
147
|
stores: IStore[];
|
|
143
148
|
}
|
|
144
149
|
|
|
145
|
-
interface
|
|
150
|
+
interface IBrand extends BaseEntity {
|
|
146
151
|
name: string;
|
|
147
|
-
sku: string;
|
|
148
152
|
slug: string;
|
|
149
|
-
|
|
153
|
+
description: string;
|
|
154
|
+
logo: string;
|
|
155
|
+
stores: IStore[];
|
|
150
156
|
status: boolean;
|
|
151
157
|
metaData: Metadata;
|
|
152
158
|
seoMetaData: ISEOMetaData;
|
|
@@ -165,22 +171,11 @@ interface ICategory extends BaseEntity {
|
|
|
165
171
|
subCategories?: ICategory[];
|
|
166
172
|
}
|
|
167
173
|
|
|
168
|
-
interface IBrand extends BaseEntity {
|
|
169
|
-
name: string;
|
|
170
|
-
slug: string;
|
|
171
|
-
description: string;
|
|
172
|
-
logo: string;
|
|
173
|
-
store: IStore;
|
|
174
|
-
status: boolean;
|
|
175
|
-
metaData: Metadata;
|
|
176
|
-
seoMetaData: ISEOMetaData;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
174
|
type StockStatus = "IN_STOCK" | "LOW_STOCK" | "OUT_OF_STOCK";
|
|
180
175
|
interface IStock extends BaseEntity {
|
|
181
176
|
sku: string;
|
|
182
177
|
product: IProduct;
|
|
183
|
-
variant
|
|
178
|
+
variant?: IVariant | null;
|
|
184
179
|
store: IStore;
|
|
185
180
|
quantity: number;
|
|
186
181
|
reserved: number;
|
|
@@ -189,17 +184,13 @@ interface IStock extends BaseEntity {
|
|
|
189
184
|
lowStockThreshold: number;
|
|
190
185
|
}
|
|
191
186
|
|
|
192
|
-
interface
|
|
193
|
-
name: string;
|
|
194
|
-
slug: string;
|
|
195
|
-
sku: string;
|
|
187
|
+
interface IProductVariantFields {
|
|
196
188
|
description: string;
|
|
197
189
|
price: IPrice;
|
|
198
190
|
quantity: number;
|
|
199
191
|
brand: IBrand;
|
|
200
192
|
store: IStore;
|
|
201
193
|
stock: IStock;
|
|
202
|
-
variants: IVariant[];
|
|
203
194
|
category: ICategory;
|
|
204
195
|
categories: ICategory[];
|
|
205
196
|
images: string[];
|
|
@@ -219,6 +210,23 @@ interface IProduct extends BaseEntity {
|
|
|
219
210
|
status: boolean;
|
|
220
211
|
}
|
|
221
212
|
|
|
213
|
+
interface IVariant extends BaseEntity, IProductVariantFields {
|
|
214
|
+
name: string;
|
|
215
|
+
sku: string;
|
|
216
|
+
slug: string;
|
|
217
|
+
product: IProduct;
|
|
218
|
+
variantAttributes: IKeyValue[];
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
interface IProduct extends BaseEntity, IProductVariantFields {
|
|
222
|
+
name: string;
|
|
223
|
+
slug: string;
|
|
224
|
+
sku: string;
|
|
225
|
+
hasVariants: boolean;
|
|
226
|
+
variantOptions: IKeyValue[];
|
|
227
|
+
variants: IVariant[];
|
|
228
|
+
}
|
|
229
|
+
|
|
222
230
|
interface IOrderItem extends BaseEntity {
|
|
223
231
|
order: IOrder;
|
|
224
232
|
product: IProduct;
|
|
@@ -428,4 +436,4 @@ interface ICart extends BaseEntity {
|
|
|
428
436
|
totalAmount: number;
|
|
429
437
|
}
|
|
430
438
|
|
|
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 };
|
|
439
|
+
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 IKeyValue, type IOrder, type IOrderItem, type IOrderTransaction, type IPrice, type IProduct, type IProductVariantFields, 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.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\";\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;AA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AkB,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":[]}
|
|
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 './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 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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