@eventista/ticketing-common 1.3.35-dev.1 → 1.3.36-dev.0
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/schemas/order/order.interfaces.d.ts +15 -0
- package/dist/schemas/promotions/promotions.interfaces.d.ts +17 -0
- package/dist/schemas/promotions/promotions.interfaces.js +6 -1
- package/dist/schemas/promotions/promotions.interfaces.js.map +1 -1
- package/dist/schemas/promotions/promotions.schema.d.ts +12 -1
- package/dist/schemas/promotions/promotions.schema.js +49 -0
- package/dist/schemas/promotions/promotions.schema.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -69,6 +69,21 @@ export interface IPromotionUsed {
|
|
|
69
69
|
discountPercent: number;
|
|
70
70
|
maxValue: number;
|
|
71
71
|
discountPercentInUSD: number;
|
|
72
|
+
type?: string;
|
|
73
|
+
useMaxUsage?: boolean;
|
|
74
|
+
maxValueInUSD?: number;
|
|
75
|
+
appliesTo?: string;
|
|
76
|
+
tickets?: string[];
|
|
77
|
+
minOrderAmount?: number;
|
|
78
|
+
minOrderAmountInUSD?: number;
|
|
79
|
+
maxValuePerOrder?: number;
|
|
80
|
+
maxValuePerOrderInUSD?: number;
|
|
81
|
+
discountType?: string;
|
|
82
|
+
amount?: number;
|
|
83
|
+
amountInUSD?: number;
|
|
84
|
+
discountAmount?: number;
|
|
85
|
+
discountAmountInUSD?: number;
|
|
86
|
+
committedAt?: Date | null;
|
|
72
87
|
}
|
|
73
88
|
export interface IOrder {
|
|
74
89
|
_id?: string;
|
|
@@ -7,11 +7,17 @@ export interface IPromotionDiscount {
|
|
|
7
7
|
percentInUSD: number;
|
|
8
8
|
maxValue: number;
|
|
9
9
|
maxValueInUSD: number;
|
|
10
|
+
amount?: number;
|
|
11
|
+
amountInUSD?: number;
|
|
10
12
|
}
|
|
11
13
|
export declare enum IPromotionType {
|
|
12
14
|
AUTO = "auto",
|
|
13
15
|
MANUALLY = "manually"
|
|
14
16
|
}
|
|
17
|
+
export declare enum IPromotionDiscountType {
|
|
18
|
+
PERCENT = "percent",
|
|
19
|
+
FIXED = "fixed"
|
|
20
|
+
}
|
|
15
21
|
export interface IPromotion {
|
|
16
22
|
_id?: string;
|
|
17
23
|
id?: string;
|
|
@@ -33,4 +39,15 @@ export interface IPromotion {
|
|
|
33
39
|
maxValuePerOrder: number;
|
|
34
40
|
maxValuePerOrderInUSD: number;
|
|
35
41
|
isPublic?: boolean;
|
|
42
|
+
name?: string;
|
|
43
|
+
discountType?: IPromotionDiscountType;
|
|
44
|
+
enabled?: boolean;
|
|
45
|
+
startAt?: Date | null;
|
|
46
|
+
endAt?: Date | null;
|
|
47
|
+
perUserLimit?: number;
|
|
48
|
+
usedCount?: number;
|
|
49
|
+
archivedAt?: Date | null;
|
|
50
|
+
tenantId?: string;
|
|
51
|
+
createdBy?: string;
|
|
52
|
+
updatedBy?: string;
|
|
36
53
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IPromotionType = exports.IPromotionAppliesTo = void 0;
|
|
3
|
+
exports.IPromotionDiscountType = exports.IPromotionType = exports.IPromotionAppliesTo = void 0;
|
|
4
4
|
var IPromotionAppliesTo;
|
|
5
5
|
(function (IPromotionAppliesTo) {
|
|
6
6
|
IPromotionAppliesTo["EVENT"] = "event";
|
|
@@ -11,4 +11,9 @@ var IPromotionType;
|
|
|
11
11
|
IPromotionType["AUTO"] = "auto";
|
|
12
12
|
IPromotionType["MANUALLY"] = "manually";
|
|
13
13
|
})(IPromotionType || (exports.IPromotionType = IPromotionType = {}));
|
|
14
|
+
var IPromotionDiscountType;
|
|
15
|
+
(function (IPromotionDiscountType) {
|
|
16
|
+
IPromotionDiscountType["PERCENT"] = "percent";
|
|
17
|
+
IPromotionDiscountType["FIXED"] = "fixed";
|
|
18
|
+
})(IPromotionDiscountType || (exports.IPromotionDiscountType = IPromotionDiscountType = {}));
|
|
14
19
|
//# sourceMappingURL=promotions.interfaces.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promotions.interfaces.js","sourceRoot":"","sources":["../../../src/schemas/promotions/promotions.interfaces.ts"],"names":[],"mappings":";;;AACA,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC3B,sCAAe,CAAA;IACf,wCAAiB,CAAA;AACrB,CAAC,EAHW,mBAAmB,mCAAnB,mBAAmB,QAG9B;
|
|
1
|
+
{"version":3,"file":"promotions.interfaces.js","sourceRoot":"","sources":["../../../src/schemas/promotions/promotions.interfaces.ts"],"names":[],"mappings":";;;AACA,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC3B,sCAAe,CAAA;IACf,wCAAiB,CAAA;AACrB,CAAC,EAHW,mBAAmB,mCAAnB,mBAAmB,QAG9B;AAaD,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,+BAAa,CAAA;IACb,uCAAqB,CAAA;AACzB,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAGD,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAC9B,6CAAmB,CAAA;IACnB,yCAAe,CAAA;AACnB,CAAC,EAHW,sBAAsB,sCAAtB,sBAAsB,QAGjC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HydratedDocument } from 'mongoose';
|
|
2
2
|
import { BaseDocument, BaseSchema } from '../index';
|
|
3
|
-
import { IPromotionAppliesTo, IPromotionDiscount, IPromotionType } from './promotions.interfaces';
|
|
3
|
+
import { IPromotionAppliesTo, IPromotionDiscount, IPromotionDiscountType, IPromotionType } from './promotions.interfaces';
|
|
4
4
|
export type PromotionDocument = HydratedDocument<Promotion> & BaseDocument;
|
|
5
5
|
export declare class Promotion extends BaseSchema {
|
|
6
6
|
eventId: string;
|
|
@@ -18,6 +18,17 @@ export declare class Promotion extends BaseSchema {
|
|
|
18
18
|
maxValuePerOrder: number;
|
|
19
19
|
maxValuePerOrderInUSD: number;
|
|
20
20
|
isPublic: boolean;
|
|
21
|
+
name: string;
|
|
22
|
+
discountType: IPromotionDiscountType;
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
startAt: Date | null;
|
|
25
|
+
endAt: Date | null;
|
|
26
|
+
perUserLimit: number;
|
|
27
|
+
usedCount: number;
|
|
28
|
+
archivedAt: Date | null;
|
|
29
|
+
tenantId: string;
|
|
30
|
+
createdBy: string;
|
|
31
|
+
updatedBy: string;
|
|
21
32
|
}
|
|
22
33
|
export declare const PromotionSchema: import("mongoose").Schema<Promotion, import("mongoose").Model<Promotion, any, any, any, import("mongoose").Document<unknown, any, Promotion, any> & Promotion & {
|
|
23
34
|
_id: import("mongoose").Types.ObjectId;
|
|
@@ -73,6 +73,8 @@ __decorate([
|
|
|
73
73
|
percentInUSD: { type: Number },
|
|
74
74
|
maxValue: { type: Number },
|
|
75
75
|
maxValueInUSD: { type: Number },
|
|
76
|
+
amount: { type: Number },
|
|
77
|
+
amountInUSD: { type: Number },
|
|
76
78
|
},
|
|
77
79
|
default: {},
|
|
78
80
|
_id: false,
|
|
@@ -112,6 +114,50 @@ __decorate([
|
|
|
112
114
|
}),
|
|
113
115
|
__metadata("design:type", Boolean)
|
|
114
116
|
], Promotion.prototype, "isPublic", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, mongoose_1.Prop)({ type: String, default: '' }),
|
|
119
|
+
__metadata("design:type", String)
|
|
120
|
+
], Promotion.prototype, "name", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
(0, mongoose_1.Prop)({ enum: Object.values(promotions_interfaces_1.IPromotionDiscountType), default: promotions_interfaces_1.IPromotionDiscountType.PERCENT }),
|
|
123
|
+
__metadata("design:type", String)
|
|
124
|
+
], Promotion.prototype, "discountType", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, mongoose_1.Prop)({ type: Boolean, default: false }),
|
|
127
|
+
__metadata("design:type", Boolean)
|
|
128
|
+
], Promotion.prototype, "enabled", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
(0, mongoose_1.Prop)({ type: Date, default: null }),
|
|
131
|
+
__metadata("design:type", Date)
|
|
132
|
+
], Promotion.prototype, "startAt", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, mongoose_1.Prop)({ type: Date, default: null }),
|
|
135
|
+
__metadata("design:type", Date)
|
|
136
|
+
], Promotion.prototype, "endAt", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
(0, mongoose_1.Prop)({ type: Number, default: 0 }),
|
|
139
|
+
__metadata("design:type", Number)
|
|
140
|
+
], Promotion.prototype, "perUserLimit", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
(0, mongoose_1.Prop)({ type: Number, default: 0 }),
|
|
143
|
+
__metadata("design:type", Number)
|
|
144
|
+
], Promotion.prototype, "usedCount", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, mongoose_1.Prop)({ type: Date, default: null }),
|
|
147
|
+
__metadata("design:type", Date)
|
|
148
|
+
], Promotion.prototype, "archivedAt", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
151
|
+
__metadata("design:type", String)
|
|
152
|
+
], Promotion.prototype, "tenantId", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
155
|
+
__metadata("design:type", String)
|
|
156
|
+
], Promotion.prototype, "createdBy", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
159
|
+
__metadata("design:type", String)
|
|
160
|
+
], Promotion.prototype, "updatedBy", void 0);
|
|
115
161
|
exports.Promotion = Promotion = __decorate([
|
|
116
162
|
(0, mongoose_1.Schema)({
|
|
117
163
|
collection: 'promotions',
|
|
@@ -122,4 +168,7 @@ exports.PromotionSchema = mongoose_1.SchemaFactory.createForClass(Promotion);
|
|
|
122
168
|
(0, index_1.addUpdateHooks)(exports.PromotionSchema);
|
|
123
169
|
(0, index_1.addSoftDeleteHooks)(exports.PromotionSchema);
|
|
124
170
|
exports.PromotionSchema.index({ eventId: 1, code: 1 });
|
|
171
|
+
exports.PromotionSchema.index({ eventId: 1, archivedAt: 1, createdAt: -1 });
|
|
172
|
+
exports.PromotionSchema.index({ enabled: 1, active: 1, startAt: 1 });
|
|
173
|
+
exports.PromotionSchema.index({ enabled: 1, active: 1, endAt: 1 });
|
|
125
174
|
//# sourceMappingURL=promotions.schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promotions.schema.js","sourceRoot":"","sources":["../../../src/schemas/promotions/promotions.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA+D;AAE/D,oCAA8G;AAC9G,
|
|
1
|
+
{"version":3,"file":"promotions.schema.js","sourceRoot":"","sources":["../../../src/schemas/promotions/promotions.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA+D;AAE/D,oCAA8G;AAC9G,mEAA0H;AAOnH,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,kBAAU;CA2HxC,CAAA;AA3HY,8BAAS;AAMlB;IAJC,IAAA,eAAI,EAAC;QACF,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,IAAI;KACd,CAAC;;0CACc;AAMhB;IAJC,IAAA,eAAI,EAAC;QACF,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,IAAI;KACd,CAAC;;uCACW;AAOb;IALC,IAAA,eAAI,EAAC;QACF,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,2CAAmB,CAAC;QACxC,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,2CAAmB,CAAC,KAAK;KACrC,CAAC;;4CAC6B;AAM/B;IAJC,IAAA,eAAI,EAAC;QACF,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,OAAO;KAChB,CAAC;;yCACc;AAMhB;IAJC,IAAA,eAAI,EAAC;QACF,IAAI,EAAE,MA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