shopoflex-types 1.0.16 → 1.0.18
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 +30 -21
- package/dist/types/common.js +0 -3
- package/package.json +4 -1
package/dist/types/common.d.ts
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
import mongoose, { Document } from 'mongoose';
|
|
2
|
+
export interface Discount extends Document {
|
|
3
|
+
code?: string;
|
|
4
|
+
vendorId: mongoose.Types.ObjectId;
|
|
5
|
+
type: 'fixed' | 'percentage';
|
|
6
|
+
value: number;
|
|
7
|
+
maxDiscountAmount?: number;
|
|
8
|
+
isAutomatic: boolean;
|
|
9
|
+
status: 'active' | 'paused' | 'expired' | 'exhausted';
|
|
10
|
+
usageLimit?: number;
|
|
11
|
+
usageCount: number;
|
|
12
|
+
perUserLimit: number;
|
|
13
|
+
discountCategory: 'cart_total' | 'free_delivery' | 'category_discount' | 'product_discount';
|
|
14
|
+
minCartValue: number;
|
|
15
|
+
applicableProducts: mongoose.Types.ObjectId[];
|
|
16
|
+
excludedProducts: mongoose.Types.ObjectId[];
|
|
17
|
+
applicableCategories: mongoose.Types.ObjectId[];
|
|
18
|
+
excludedCategories: mongoose.Types.ObjectId[];
|
|
19
|
+
eligibleUsers: mongoose.Types.ObjectId[];
|
|
20
|
+
combinable: boolean;
|
|
21
|
+
firstTimeUsersOnly: boolean;
|
|
22
|
+
startDate: Date;
|
|
23
|
+
endDate?: Date;
|
|
24
|
+
description?: string;
|
|
25
|
+
createdBy?: mongoose.Types.ObjectId;
|
|
26
|
+
customerMessage?: string;
|
|
27
|
+
isValid(): boolean;
|
|
28
|
+
canUserUse(userId: mongoose.Types.ObjectId): boolean;
|
|
29
|
+
incrementUsage(): Promise<Discount>;
|
|
30
|
+
}
|
|
1
31
|
export declare enum TemplateId {
|
|
2
32
|
TEMPLATE_1 = "template_1",
|
|
3
33
|
TEMPLATE_2 = "template_2",
|
|
@@ -390,27 +420,6 @@ export interface Vendor {
|
|
|
390
420
|
};
|
|
391
421
|
};
|
|
392
422
|
}
|
|
393
|
-
export interface Discount {
|
|
394
|
-
_id: string;
|
|
395
|
-
code: string;
|
|
396
|
-
vendorId: string | any;
|
|
397
|
-
type: "fixed" | "percentage";
|
|
398
|
-
value: number;
|
|
399
|
-
isAutomatic: boolean;
|
|
400
|
-
usageLimit: number | null;
|
|
401
|
-
perUserLimit: number;
|
|
402
|
-
discountCategory: "cart_total" | "free_delivery";
|
|
403
|
-
minCartValue: number;
|
|
404
|
-
applicableProducts: string[];
|
|
405
|
-
applicableCategories: string[];
|
|
406
|
-
eligibleUsers: string[];
|
|
407
|
-
combinable: boolean;
|
|
408
|
-
firstTimeUsersOnly: boolean;
|
|
409
|
-
startDate: Date;
|
|
410
|
-
endDate?: Date;
|
|
411
|
-
expiryDate?: Date;
|
|
412
|
-
createdAt: Date;
|
|
413
|
-
}
|
|
414
423
|
export interface NotificationType {
|
|
415
424
|
_id?: any;
|
|
416
425
|
recipientId?: string;
|
package/dist/types/common.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// =============================================================================
|
|
3
|
-
// ENUMS
|
|
4
|
-
// =============================================================================
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.OrderStatus = exports.TemplateId = void 0;
|
|
7
4
|
var TemplateId;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shopoflex-types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "Shared TypeScript types for Shopoflex applications",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -22,5 +22,8 @@
|
|
|
22
22
|
],
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"typescript": "^5.8.3"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"mongoose": "^8.15.1"
|
|
25
28
|
}
|
|
26
29
|
}
|