shopoflex-types 1.0.76 → 1.0.78
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/common.d.ts +44 -17
- package/package.json +3 -2
package/dist/common.d.ts
CHANGED
|
@@ -61,6 +61,22 @@ export interface Address {
|
|
|
61
61
|
country?: string;
|
|
62
62
|
details: string;
|
|
63
63
|
}
|
|
64
|
+
export interface PaymentMethod {
|
|
65
|
+
type: 'cash' | 'card' | 'knet' | 'bank_transfer' | 'wallet' | 'external_link' | 'crypto' | 'whish' | 'paypal' | 'gift_card';
|
|
66
|
+
}
|
|
67
|
+
export interface OrderStatus {
|
|
68
|
+
status: 'pending' | 'cancelled' | 'rejected' | 'refunded' | 'preparing' | 'delivering' | 'completed' | 'awaiting_payment';
|
|
69
|
+
}
|
|
70
|
+
export interface OrderTypeOptions {
|
|
71
|
+
type: 'delivery' | 'instore' | 'pickup';
|
|
72
|
+
}
|
|
73
|
+
export interface UnitType {
|
|
74
|
+
unit: 'piece' | 'kg' | 'g' | 'liter' | 'ml' | 'meter' | 'cm' | 'pack' | 'box' | 'bottle' | 'bag' | 'dozen' | 'sqm' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
|
75
|
+
}
|
|
76
|
+
export type PickType = OrderTypeOptions['type'];
|
|
77
|
+
export type PaymentMethodType = PaymentMethod['type'];
|
|
78
|
+
export type OrderStatusType = OrderStatus['status'];
|
|
79
|
+
export type UnitTypeValue = UnitType['unit'];
|
|
64
80
|
export interface PriceModel {
|
|
65
81
|
price: number;
|
|
66
82
|
discountedPrice?: number;
|
|
@@ -68,7 +84,7 @@ export interface PriceModel {
|
|
|
68
84
|
cost?: number;
|
|
69
85
|
allowDecimal?: boolean;
|
|
70
86
|
minQuantity?: number;
|
|
71
|
-
unit
|
|
87
|
+
unit: UnitTypeValue;
|
|
72
88
|
}
|
|
73
89
|
export interface Dimensions {
|
|
74
90
|
active: boolean;
|
|
@@ -176,7 +192,7 @@ export interface ProductType {
|
|
|
176
192
|
active: boolean;
|
|
177
193
|
values: any[];
|
|
178
194
|
};
|
|
179
|
-
|
|
195
|
+
availableFor?: [];
|
|
180
196
|
linkedProduct?: any;
|
|
181
197
|
createdAt?: Date;
|
|
182
198
|
updatedAt?: Date;
|
|
@@ -224,6 +240,7 @@ export interface CartItem {
|
|
|
224
240
|
categoriesIds: string[];
|
|
225
241
|
price: number;
|
|
226
242
|
quantity: number;
|
|
243
|
+
unit: UnitTypeValue;
|
|
227
244
|
name?: {
|
|
228
245
|
en?: string;
|
|
229
246
|
ar?: string;
|
|
@@ -235,6 +252,7 @@ export interface CartItem {
|
|
|
235
252
|
selectedVariant: VariantType | null;
|
|
236
253
|
finalPrice?: number;
|
|
237
254
|
files?: FileType[];
|
|
255
|
+
total?: number;
|
|
238
256
|
}
|
|
239
257
|
export interface Cart {
|
|
240
258
|
_id?: string;
|
|
@@ -244,6 +262,7 @@ export interface Cart {
|
|
|
244
262
|
discount: number;
|
|
245
263
|
delivery: number;
|
|
246
264
|
total: number;
|
|
265
|
+
totalsByUnit?: Record<UnitTypeValue, number>;
|
|
247
266
|
}
|
|
248
267
|
export interface CartState {
|
|
249
268
|
items: CartItem[];
|
|
@@ -253,6 +272,7 @@ export interface CartState {
|
|
|
253
272
|
delivery: number;
|
|
254
273
|
total: number;
|
|
255
274
|
promoCode?: Discount;
|
|
275
|
+
totalsByUnit?: Record<UnitTypeValue, number>;
|
|
256
276
|
}
|
|
257
277
|
export interface CartModelType extends Cart {
|
|
258
278
|
customer: Customer | any;
|
|
@@ -264,6 +284,14 @@ export interface CartModelType extends Cart {
|
|
|
264
284
|
discount: number;
|
|
265
285
|
delivery: number;
|
|
266
286
|
total: number;
|
|
287
|
+
totalsByUnit?: Record<UnitTypeValue, number>;
|
|
288
|
+
}
|
|
289
|
+
export interface UnitAnalytics {
|
|
290
|
+
unit: UnitTypeValue;
|
|
291
|
+
totalQuantity: number;
|
|
292
|
+
totalRevenue: number;
|
|
293
|
+
orderCount: number;
|
|
294
|
+
avgOrderValue: number;
|
|
267
295
|
}
|
|
268
296
|
export interface PaymentDetails {
|
|
269
297
|
method: string;
|
|
@@ -470,6 +498,20 @@ export interface Vendor {
|
|
|
470
498
|
};
|
|
471
499
|
};
|
|
472
500
|
};
|
|
501
|
+
subscription: {
|
|
502
|
+
planId: string | null;
|
|
503
|
+
planName: string;
|
|
504
|
+
status: 'trial' | 'active' | 'cancelled' | 'expired';
|
|
505
|
+
startDate: Date;
|
|
506
|
+
nextBillingDate: Date;
|
|
507
|
+
trialEndDate: Date;
|
|
508
|
+
autoRenewal: boolean;
|
|
509
|
+
};
|
|
510
|
+
usage: {
|
|
511
|
+
productsCount: number;
|
|
512
|
+
branchesCount: number;
|
|
513
|
+
usersCount: number;
|
|
514
|
+
};
|
|
473
515
|
}
|
|
474
516
|
export interface NotificationType {
|
|
475
517
|
_id?: any;
|
|
@@ -486,21 +528,6 @@ export interface NotificationType {
|
|
|
486
528
|
createdAt?: Date;
|
|
487
529
|
updatedAt?: Date;
|
|
488
530
|
}
|
|
489
|
-
export interface PaymentMethod {
|
|
490
|
-
type: 'cash' | 'card' | 'knet' | 'bank_transfer' | 'wallet' | 'external_link' | 'crypto' | 'whish' | 'paypal' | 'gift_card';
|
|
491
|
-
}
|
|
492
|
-
export interface OrderStatus {
|
|
493
|
-
status: 'pending' | 'cancelled' | 'rejected' | 'refunded' | 'preparing' | 'delivering' | 'completed' | 'awaiting_payment';
|
|
494
|
-
}
|
|
495
|
-
export interface OrderStatus {
|
|
496
|
-
status: 'pending' | 'cancelled' | 'rejected' | 'refunded' | 'preparing' | 'delivering' | 'completed' | 'awaiting_payment';
|
|
497
|
-
}
|
|
498
|
-
export interface OrderTypeOptions {
|
|
499
|
-
type: 'delivery' | 'instore' | 'pickup';
|
|
500
|
-
}
|
|
501
|
-
export type PickType = OrderTypeOptions['type'];
|
|
502
|
-
export type PaymentMethodType = PaymentMethod['type'];
|
|
503
|
-
export type OrderStatusType = OrderStatus['status'];
|
|
504
531
|
export interface SelectionsState {
|
|
505
532
|
address?: Address;
|
|
506
533
|
branch?: IBranch;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shopoflex-types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.78",
|
|
4
4
|
"description": "Shared TypeScript types for Shopoflex applications",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"typescript": "^5.8.3"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"mongoose": "^8.15.1"
|
|
30
|
+
"mongoose": "^8.15.1",
|
|
31
|
+
"shopoflex-types": "^1.0.76"
|
|
31
32
|
}
|
|
32
33
|
}
|