shopoflex-types 1.0.10 → 1.0.12

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.
@@ -1,3 +1,19 @@
1
+ export declare enum TemplateId {
2
+ TEMPLATE_1 = "template_1",
3
+ TEMPLATE_2 = "template_2",
4
+ TEMPLATE_3 = "template_3",
5
+ TEMPLATE_4 = "template_4",
6
+ TEMPLATE_5 = "template_5"
7
+ }
8
+ export declare enum OrderStatus {
9
+ Pending = "pending",
10
+ Cancelled = "cancelled",
11
+ Rejected = "rejected",
12
+ Refunded = "refunded",
13
+ Preparing = "preparing",
14
+ Delivering = "delivering",
15
+ Completed = "completed"
16
+ }
1
17
  export interface FileType {
2
18
  previewUrl?: string;
3
19
  type?: string;
@@ -8,111 +24,26 @@ export interface FileType {
8
24
  url?: string;
9
25
  vendorId?: string;
10
26
  }
11
- export declare enum TemplateId {
12
- TEMPLATE_1 = "template_1",
13
- TEMPLATE_2 = "template_2",
14
- TEMPLATE_3 = "template_3",
15
- TEMPLATE_4 = "template_4",
16
- TEMPLATE_5 = "template_5"
27
+ export interface ILatLng {
28
+ lat: number;
29
+ lng: number;
17
30
  }
18
- export interface Vendor {
19
- _id: string;
20
- name: {
21
- en: string;
22
- ar: string;
23
- };
24
- domains: string[];
25
- description: {
26
- en: string;
27
- ar: string;
28
- };
29
- logo: FileType;
30
- cover: FileType[];
31
- favicon: FileType;
32
- font: {
33
- en: any;
34
- ar: any;
35
- };
36
- colors: {
37
- primaryColor: string;
38
- textColor: string;
39
- bgColor: string;
40
- };
41
- countries: string[];
42
- currencies: string[];
43
- defaultCurrency: string;
44
- integrations: {
45
- loyaltyProgram: {
46
- active: boolean;
47
- started: boolean;
48
- };
49
- };
50
- expiryDate: string;
51
- defaultLanguage: string;
52
- acceptedLanguages: string[];
53
- numberOfDecimals: number;
54
- email: string;
55
- phone: string;
56
- currency: string;
57
- language: string;
58
- country: string;
59
- template: {
60
- id: TemplateId;
61
- name: {
62
- en: string;
63
- ar: string;
64
- };
65
- description: {
66
- en: string;
67
- ar: string;
68
- };
69
- link: string;
70
- image: string;
71
- isActive: boolean;
72
- };
73
- updateAt: Date;
74
- createdAt: Date;
75
- orderType: string[];
76
- socialLinks: string[];
77
- users: Array<unknown>;
78
- areas: Record<string, unknown>;
79
- payments: {
80
- Cash: {
81
- active: boolean;
82
- status: string;
83
- id: string;
84
- key: string | null;
85
- extra: string | null;
86
- name: {
87
- ar: string;
88
- en: string;
89
- };
90
- };
91
- posCard: {
92
- active: boolean;
93
- status: string;
94
- id: string;
95
- key: string | null;
96
- extra: string | null;
97
- name: {
98
- ar: string;
99
- en: string;
100
- };
101
- };
102
- payByLink: {
103
- active: boolean;
104
- status: string;
105
- id: string;
106
- key: string | null;
107
- extra: string | null;
108
- name: {
109
- ar: string;
110
- en: string;
111
- };
112
- };
31
+ export interface Address {
32
+ _id?: string;
33
+ id?: string;
34
+ location: {
35
+ lat: number;
36
+ lng: number;
113
37
  };
38
+ city?: string;
39
+ area?: string;
40
+ street?: string;
41
+ building?: string;
42
+ florr?: string;
43
+ country?: string;
44
+ details: string;
114
45
  }
115
- interface PriceModel {
46
+ export interface PriceModel {
116
47
  price: number;
117
48
  discountedPrice?: number;
118
49
  finalPrice?: number;
@@ -121,7 +52,7 @@ interface PriceModel {
121
52
  minQuantity?: number;
122
53
  unit?: string;
123
54
  }
124
- interface Dimensions {
55
+ export interface Dimensions {
125
56
  active: boolean;
126
57
  values?: {
127
58
  length: number | null;
@@ -130,17 +61,12 @@ interface Dimensions {
130
61
  weight: number | null;
131
62
  };
132
63
  }
133
- interface StockHandle {
64
+ export interface StockHandle {
134
65
  active: boolean;
135
66
  stockQuantity: number;
136
67
  ifOutOfStock: 'showOutOfStock' | 'allowOrdering' | 'hideFromStore';
137
68
  }
138
- interface StockHandle {
139
- active: boolean;
140
- stockQuantity: number;
141
- ifOutOfStock: 'showOutOfStock' | 'allowOrdering' | 'hideFromStore';
142
- }
143
- interface Label {
69
+ export interface Label {
144
70
  featured: boolean;
145
71
  mostSelling: {
146
72
  criteria: string;
@@ -152,10 +78,33 @@ interface Label {
152
78
  active: boolean;
153
79
  };
154
80
  }
155
- interface Specification {
81
+ export interface Specification {
156
82
  active: boolean;
157
83
  values: any[];
158
84
  }
85
+ export interface AddonType {
86
+ _id: string;
87
+ name: {
88
+ en: string;
89
+ ar: string;
90
+ };
91
+ price: number;
92
+ enableQuantity?: boolean;
93
+ stockHandle: StockHandle;
94
+ }
95
+ export interface Modifier {
96
+ name?: {
97
+ en?: string;
98
+ ar?: string;
99
+ };
100
+ type?: "checkbox" | "radio" | "select";
101
+ required?: boolean;
102
+ maxSelect?: number;
103
+ minSelect?: number;
104
+ active?: boolean;
105
+ options?: AddonType[] | string[];
106
+ addons?: AddonType[] | string[];
107
+ }
159
108
  export interface Category {
160
109
  _id: string;
161
110
  name: {
@@ -173,15 +122,6 @@ export interface Category {
173
122
  vendorId: string;
174
123
  createdAt: Date;
175
124
  }
176
- export interface CartState {
177
- items: CartItem[];
178
- subtotal: number;
179
- totalQuantity: number;
180
- discount: number;
181
- delivery: number;
182
- total: number;
183
- promoCode?: Discount;
184
- }
185
125
  export interface ProductType {
186
126
  _id: string;
187
127
  name: {
@@ -210,74 +150,9 @@ export interface ProductType {
210
150
  vendorId?: any;
211
151
  createdAt?: string;
212
152
  }
213
- interface StockHandle {
214
- active: boolean;
215
- stockQuantity: number;
216
- ifOutOfStock: 'showOutOfStock' | 'allowOrdering' | 'hideFromStore';
217
- }
218
- export interface Modifier {
219
- name?: {
220
- en?: string;
221
- ar?: string;
222
- };
223
- type?: "checkbox" | "radio" | "select";
224
- required?: boolean;
225
- maxSelect?: number;
226
- minSelect?: number;
227
- active?: boolean;
228
- options?: AddonType[] | string[];
229
- addons?: AddonType[] | string[];
230
- }
231
- export interface AddonType {
232
- _id: string;
233
- name: {
234
- en: string;
235
- ar: string;
236
- };
237
- price: number;
238
- enableQuantity?: boolean;
239
- stockHandle: StockHandle;
240
- }
241
- export interface PaymentDetails {
242
- method: string;
243
- status: string;
244
- transactionId?: string;
245
- }
246
- export interface DeliveryDetails {
247
- method: string;
248
- status?: string;
249
- estimatedDate?: Date;
250
- trackingNumber?: string;
251
- }
252
- export interface Customer {
253
- _id?: string;
254
- uid?: string;
255
- fullName?: string;
256
- email?: string;
257
- phone?: {
258
- full?: string;
259
- dial?: string;
260
- number?: string;
261
- };
262
- updatedAt?: Date | number;
263
- createdAt?: Date | number;
264
- addresses?: Address[];
265
- vendors?: string[];
266
- isAnonymos?: boolean;
267
- }
268
- export interface Address {
269
- _id?: string;
270
- location: {
271
- lat: number;
272
- lng: number;
273
- };
274
- city?: string;
275
- area?: string;
276
- street?: string;
277
- building?: string;
278
- florr?: string;
279
- country?: string;
280
- details: string;
153
+ export interface GroupedCategory {
154
+ categoryName: any;
155
+ products: ProductType[];
281
156
  }
282
157
  export interface sModifier {
283
158
  listName: string;
@@ -314,38 +189,35 @@ export interface Cart {
314
189
  delivery: number;
315
190
  total: number;
316
191
  }
192
+ export interface CartState {
193
+ items: CartItem[];
194
+ subtotal: number;
195
+ totalQuantity: number;
196
+ discount: number;
197
+ delivery: number;
198
+ total: number;
199
+ promoCode?: Discount;
200
+ }
317
201
  export interface CartModelType extends Cart {
318
202
  customer: Customer | any;
319
203
  vendorId: String | any;
320
204
  }
205
+ export interface PaymentDetails {
206
+ method: string;
207
+ status: string;
208
+ transactionId?: string;
209
+ }
210
+ export interface DeliveryDetails {
211
+ method: string;
212
+ status?: string;
213
+ estimatedDate?: Date;
214
+ trackingNumber?: string;
215
+ }
321
216
  export interface Shipping {
322
217
  method: string;
323
218
  cost?: number;
324
219
  trackingNumber?: string;
325
220
  }
326
- export interface Address {
327
- id: string;
328
- location: {
329
- lat: number;
330
- lng: number;
331
- };
332
- city?: string;
333
- area?: string;
334
- street?: string;
335
- building?: string;
336
- florr?: string;
337
- country?: string;
338
- details: string;
339
- }
340
- export declare enum OrderStatus {
341
- Pending = "pending",
342
- Cancelled = "cancelled",
343
- Rejected = "rejected",
344
- Refunded = "refunded",
345
- Preparing = "preparing",
346
- Delivering = "delivering",
347
- Completed = "completed"
348
- }
349
221
  export interface OrderType {
350
222
  _id?: string | any;
351
223
  customer?: Customer;
@@ -360,26 +232,27 @@ export interface OrderType {
360
232
  updatedAt?: Date;
361
233
  orderNumber?: any;
362
234
  }
363
- interface VendorAssociation {
235
+ export interface Customer {
236
+ _id?: string;
237
+ uid?: string;
238
+ fullName?: string;
239
+ email?: string;
240
+ phone?: {
241
+ full?: string;
242
+ dial?: string;
243
+ number?: string;
244
+ };
245
+ updatedAt?: Date | number;
246
+ createdAt?: Date | number;
247
+ addresses?: Address[];
248
+ vendors?: string[];
249
+ isAnonymos?: boolean;
250
+ }
251
+ export interface VendorAssociation {
364
252
  vendorId: string;
365
253
  role?: string;
366
254
  permissions?: string[];
367
255
  }
368
- export interface NotificationType {
369
- _id?: any;
370
- recipientId?: string;
371
- recipientType?: 'vendor' | 'customer';
372
- vendorId?: string;
373
- type?: 'new_order' | 'order_update' | 'stock_alert' | 'product_update' | 'system_update';
374
- title: string;
375
- message?: string;
376
- data?: any;
377
- read: boolean;
378
- readAt?: Date;
379
- priority?: 'low' | 'medium' | 'high';
380
- createdAt?: Date;
381
- updatedAt?: Date;
382
- }
383
256
  export interface IUser {
384
257
  _id?: any;
385
258
  uid?: string;
@@ -394,6 +267,23 @@ export interface IUser {
394
267
  updatedAt?: Date;
395
268
  fcmTokens?: string[];
396
269
  }
270
+ export interface CurrentUserType extends IUser {
271
+ vendors?: {
272
+ vendorId: string;
273
+ name: {
274
+ en: string;
275
+ ar: string;
276
+ };
277
+ logo: {
278
+ previewUrl: string;
279
+ };
280
+ description: {
281
+ en: string;
282
+ ar: string;
283
+ };
284
+ }[];
285
+ hasAccesstoVendor?: boolean;
286
+ }
397
287
  export type IRole = {
398
288
  _id?: string;
399
289
  name?: {
@@ -402,11 +292,7 @@ export type IRole = {
402
292
  };
403
293
  permissions?: string[];
404
294
  };
405
- interface ILatLng {
406
- lat: number;
407
- lng: number;
408
- }
409
- interface IZone {
295
+ export interface IZone {
410
296
  country: string;
411
297
  deliveryType: "distance" | "constant";
412
298
  deliveryRange: "radius" | "country";
@@ -416,17 +302,17 @@ interface IZone {
416
302
  center: ILatLng;
417
303
  markerPosition: ILatLng;
418
304
  }
419
- interface IDeliverySettings {
305
+ export interface IDeliverySettings {
420
306
  zones: IZone[];
421
307
  }
422
- interface IPickupSettings {
308
+ export interface IPickupSettings {
423
309
  enabled: boolean;
424
310
  instruction?: string;
425
311
  }
426
- interface IDineInSettings {
312
+ export interface IDineInSettings {
427
313
  enabled: boolean;
428
314
  }
429
- interface IBranchName {
315
+ export interface IBranchName {
430
316
  en: string;
431
317
  ar?: string;
432
318
  }
@@ -439,48 +325,92 @@ export interface IBranch {
439
325
  dineInSettings: IDineInSettings;
440
326
  createdAt?: Date;
441
327
  }
442
- export interface Address {
443
- id: string;
444
- location: {
445
- lat: number;
446
- lng: number;
328
+ export interface Vendor {
329
+ _id?: string;
330
+ name: {
331
+ en: string;
332
+ ar: string;
447
333
  };
448
- city?: string;
449
- area?: string;
450
- street?: string;
451
- building?: string;
452
- florr?: string;
453
- country?: string;
454
- details: string;
455
- }
456
- export interface SelectionsState {
457
- address?: Address;
458
- branch?: IBranch;
459
- orderType?: "delivery" | "pickup" | "dinein";
460
- paymentMethod?: "cash_on_delivery" | "card_on_delivery" | "wallet" | "credit_card";
461
- }
462
- export interface SelectionsState {
463
- address?: Address;
464
- branch?: IBranch;
465
- deliveryType?: "delivery" | "pickup" | "dineIn";
466
- paymentMethod?: "cash_on_delivery" | "card_on_delivery" | "wallet" | "credit_card";
467
- promoCode?: string;
468
- shippingMethod?: string;
469
- time?: number;
470
- validLocation?: boolean;
471
- }
472
- export interface GroupedCategory {
473
- categoryName: any;
474
- products: ProductType[];
475
- }
476
- export interface StoreState {
477
- branches?: IBranch[];
478
- groupedCategories?: {
479
- [key: string]: GroupedCategory;
334
+ domains: string[];
335
+ description: {
336
+ en: string;
337
+ ar: string;
338
+ };
339
+ logo: FileType;
340
+ cover: FileType[];
341
+ favicon: FileType;
342
+ font: {
343
+ en: any;
344
+ ar: any;
345
+ };
346
+ colors: {
347
+ primaryColor: string;
348
+ textColor: string;
349
+ bgColor: string;
350
+ };
351
+ currencies: string[];
352
+ expiryDate: string;
353
+ numberOfDecimals: number;
354
+ email: string;
355
+ phone: string;
356
+ currency: string;
357
+ language: string;
358
+ country: string;
359
+ template: {
360
+ id: TemplateId;
361
+ name: {
362
+ en: string;
363
+ ar: string;
364
+ };
365
+ description: {
366
+ en: string;
367
+ ar: string;
368
+ };
369
+ link: string;
370
+ image: string;
371
+ isActive: boolean;
372
+ };
373
+ updateAt: Date;
374
+ createdAt: Date;
375
+ orderType: string[];
376
+ socialLinks: string[];
377
+ users: Array<unknown>;
378
+ areas: Record<string, unknown>;
379
+ payments: {
380
+ Cash: {
381
+ active: boolean;
382
+ status: string;
383
+ id: string;
384
+ key: string | null;
385
+ extra: string | null;
386
+ name: {
387
+ ar: string;
388
+ en: string;
389
+ };
390
+ };
391
+ posCard: {
392
+ active: boolean;
393
+ status: string;
394
+ id: string;
395
+ key: string | null;
396
+ extra: string | null;
397
+ name: {
398
+ ar: string;
399
+ en: string;
400
+ };
401
+ };
402
+ payByLink: {
403
+ active: boolean;
404
+ status: string;
405
+ id: string;
406
+ key: string | null;
407
+ extra: string | null;
408
+ name: {
409
+ ar: string;
410
+ en: string;
411
+ };
412
+ };
480
413
  };
481
- allProducts?: ProductType[];
482
- allCategories?: Category[];
483
- loading?: boolean;
484
414
  }
485
415
  export interface Discount {
486
416
  _id: string;
@@ -503,21 +433,38 @@ export interface Discount {
503
433
  expiryDate?: Date;
504
434
  createdAt: Date;
505
435
  }
506
- export interface CurrentUserType extends IUser {
507
- vendors?: {
508
- vendorId: string;
509
- name: {
510
- en: string;
511
- ar: string;
512
- };
513
- logo: {
514
- previewUrl: string;
515
- };
516
- description: {
517
- en: string;
518
- ar: string;
519
- };
520
- }[];
521
- hasAccesstoVendor?: boolean;
436
+ export interface NotificationType {
437
+ _id?: any;
438
+ recipientId?: string;
439
+ recipientType?: 'vendor' | 'customer';
440
+ vendorId?: string;
441
+ type?: 'new_order' | 'order_update' | 'stock_alert' | 'product_update' | 'system_update';
442
+ title: string;
443
+ message?: string;
444
+ data?: any;
445
+ read: boolean;
446
+ readAt?: Date;
447
+ priority?: 'low' | 'medium' | 'high';
448
+ createdAt?: Date;
449
+ updatedAt?: Date;
450
+ }
451
+ export interface SelectionsState {
452
+ address?: Address;
453
+ branch?: IBranch;
454
+ orderType?: "delivery" | "pickup" | "dinein";
455
+ deliveryType?: "delivery" | "pickup" | "dineIn";
456
+ paymentMethod?: "cash_on_delivery" | "card_on_delivery" | "wallet" | "credit_card";
457
+ promoCode?: string;
458
+ shippingMethod?: string;
459
+ time?: number;
460
+ validLocation?: boolean;
461
+ }
462
+ export interface StoreState {
463
+ branches?: IBranch[];
464
+ groupedCategories?: {
465
+ [key: string]: GroupedCategory;
466
+ };
467
+ allProducts?: ProductType[];
468
+ allCategories?: Category[];
469
+ loading?: boolean;
522
470
  }
523
- export {};
@@ -1,4 +1,7 @@
1
1
  "use strict";
2
+ // =============================================================================
3
+ // ENUMS
4
+ // =============================================================================
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.OrderStatus = exports.TemplateId = void 0;
4
7
  var TemplateId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shopoflex-types",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "Shared TypeScript types for Shopoflex applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",