shopoflex-types 1.0.23 → 1.0.25
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/types/common.d.ts +14 -12
- package/package.json +3 -2
package/dist/types/common.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import mongoose
|
|
2
|
-
export interface Discount
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
export interface Discount {
|
|
3
|
+
_id?: mongoose.Types.ObjectId;
|
|
3
4
|
code?: string;
|
|
4
5
|
vendorId: mongoose.Types.ObjectId;
|
|
5
|
-
type:
|
|
6
|
+
type: "fixed" | "percentage";
|
|
6
7
|
value: number;
|
|
7
8
|
maxDiscountAmount?: number;
|
|
8
9
|
isAutomatic: boolean;
|
|
9
|
-
status:
|
|
10
|
+
status: "active" | "paused" | "expired" | "exhausted";
|
|
10
11
|
usageLimit?: number;
|
|
11
12
|
usageCount: number;
|
|
12
13
|
perUserLimit: number;
|
|
13
|
-
discountCategory:
|
|
14
|
+
discountCategory: "cart_total" | "free_delivery" | "category_discount" | "product_discount";
|
|
14
15
|
minCartValue: number;
|
|
15
16
|
applicableProducts: mongoose.Types.ObjectId[];
|
|
16
17
|
excludedProducts: mongoose.Types.ObjectId[];
|
|
@@ -24,9 +25,6 @@ export interface Discount extends Document {
|
|
|
24
25
|
description?: string;
|
|
25
26
|
createdBy?: mongoose.Types.ObjectId;
|
|
26
27
|
customerMessage?: string;
|
|
27
|
-
isValid(): boolean;
|
|
28
|
-
canUserUse(userId: mongoose.Types.ObjectId): boolean;
|
|
29
|
-
incrementUsage(): Promise<Discount>;
|
|
30
28
|
}
|
|
31
29
|
export declare enum TemplateId {
|
|
32
30
|
TEMPLATE_1 = "template_1",
|
|
@@ -120,6 +118,7 @@ export interface AddonType {
|
|
|
120
118
|
price: number;
|
|
121
119
|
enableQuantity?: boolean;
|
|
122
120
|
stockHandle: StockHandle;
|
|
121
|
+
files?: FileType[];
|
|
123
122
|
}
|
|
124
123
|
export interface Modifier {
|
|
125
124
|
name?: {
|
|
@@ -133,6 +132,7 @@ export interface Modifier {
|
|
|
133
132
|
active?: boolean;
|
|
134
133
|
options?: AddonType[] | string[];
|
|
135
134
|
addons?: AddonType[] | string[];
|
|
135
|
+
files?: FileType[];
|
|
136
136
|
}
|
|
137
137
|
export interface Category {
|
|
138
138
|
_id: string;
|
|
@@ -150,6 +150,7 @@ export interface Category {
|
|
|
150
150
|
isActive: boolean;
|
|
151
151
|
vendorId: string | any;
|
|
152
152
|
createdAt: Date;
|
|
153
|
+
files?: FileType[];
|
|
153
154
|
}
|
|
154
155
|
export interface ProductType {
|
|
155
156
|
_id: string;
|
|
@@ -207,7 +208,7 @@ export interface CartItem {
|
|
|
207
208
|
overallTotal?: number;
|
|
208
209
|
};
|
|
209
210
|
finalPrice?: number;
|
|
210
|
-
|
|
211
|
+
files?: FileType[];
|
|
211
212
|
}
|
|
212
213
|
export interface Cart {
|
|
213
214
|
_id?: string;
|
|
@@ -291,6 +292,7 @@ export interface Customer {
|
|
|
291
292
|
addresses?: Address[];
|
|
292
293
|
vendors?: string[];
|
|
293
294
|
isAnonymos?: boolean;
|
|
295
|
+
files?: FileType[];
|
|
294
296
|
}
|
|
295
297
|
export interface VendorAssociation {
|
|
296
298
|
vendorId: string;
|
|
@@ -310,6 +312,7 @@ export interface IUser {
|
|
|
310
312
|
createdAt?: Date;
|
|
311
313
|
updatedAt?: Date;
|
|
312
314
|
fcmTokens?: string[];
|
|
315
|
+
files?: FileType[];
|
|
313
316
|
}
|
|
314
317
|
export interface CurrentUserType extends IUser {
|
|
315
318
|
vendors?: {
|
|
@@ -318,9 +321,7 @@ export interface CurrentUserType extends IUser {
|
|
|
318
321
|
en: string;
|
|
319
322
|
ar: string;
|
|
320
323
|
};
|
|
321
|
-
logo
|
|
322
|
-
previewUrl: string;
|
|
323
|
-
};
|
|
324
|
+
logo?: FileType[];
|
|
324
325
|
description: {
|
|
325
326
|
en: string;
|
|
326
327
|
ar: string;
|
|
@@ -526,4 +527,5 @@ export interface IBranch {
|
|
|
526
527
|
dineInSettings?: IDineInSettings;
|
|
527
528
|
createdAt?: Date;
|
|
528
529
|
updatedAt?: Date;
|
|
530
|
+
files?: FileType[];
|
|
529
531
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shopoflex-types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.25",
|
|
4
4
|
"description": "Shared TypeScript types for Shopoflex applications",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "tsc",
|
|
12
12
|
"watch": "tsc --watch",
|
|
13
|
-
"prepublishOnly": "npm run build"
|
|
13
|
+
"prepublishOnly": "npm run build",
|
|
14
|
+
"deploy": "npm run build && npm publish"
|
|
14
15
|
},
|
|
15
16
|
"publishConfig": {
|
|
16
17
|
"access": "public"
|