@lyxa.ai/core 1.4.140 → 1.4.142
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.
|
@@ -24,6 +24,14 @@ export declare class TournamentMatch {
|
|
|
24
24
|
winnerId: Types.ObjectId | null;
|
|
25
25
|
startingDate: Date;
|
|
26
26
|
endDate?: Date;
|
|
27
|
+
matchEnded: boolean;
|
|
28
|
+
matchStatus?: string;
|
|
29
|
+
notificationFlags: Map<string, boolean>;
|
|
30
|
+
}
|
|
31
|
+
export declare class ScheduledNotificationConfig {
|
|
32
|
+
type: string;
|
|
33
|
+
durationMins: number;
|
|
34
|
+
target: string;
|
|
27
35
|
}
|
|
28
36
|
export declare class TournamentReward {
|
|
29
37
|
type: TournamentRewardType;
|
|
@@ -33,8 +41,7 @@ export declare class TournamentCouponReward extends TournamentReward {
|
|
|
33
41
|
percentage: number;
|
|
34
42
|
maxDiscountPerOrder: number | null;
|
|
35
43
|
}
|
|
36
|
-
export declare class
|
|
37
|
-
tag: string;
|
|
44
|
+
export declare class NotificationMessage {
|
|
38
45
|
title: string;
|
|
39
46
|
body: string;
|
|
40
47
|
}
|
|
@@ -47,5 +54,6 @@ export declare class Tournament extends TimeStamps {
|
|
|
47
54
|
teams: TournamentTeam[];
|
|
48
55
|
matches: TournamentMatch[];
|
|
49
56
|
reward?: TournamentReward;
|
|
50
|
-
notificationTemplates:
|
|
57
|
+
notificationTemplates: Map<string, NotificationMessage>;
|
|
58
|
+
scheduledNotifications: ScheduledNotificationConfig[];
|
|
51
59
|
}
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Tournament = exports.
|
|
12
|
+
exports.Tournament = exports.NotificationMessage = exports.TournamentCouponReward = exports.TournamentReward = exports.ScheduledNotificationConfig = exports.TournamentMatch = exports.TournamentMatchTeam = exports.TournamentTeam = exports.MatchScore = void 0;
|
|
13
13
|
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
14
|
const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
15
15
|
const mongoose_1 = require("mongoose");
|
|
@@ -68,6 +68,9 @@ class TournamentMatch {
|
|
|
68
68
|
winnerId;
|
|
69
69
|
startingDate;
|
|
70
70
|
endDate;
|
|
71
|
+
matchEnded;
|
|
72
|
+
matchStatus;
|
|
73
|
+
notificationFlags;
|
|
71
74
|
}
|
|
72
75
|
exports.TournamentMatch = TournamentMatch;
|
|
73
76
|
__decorate([
|
|
@@ -106,6 +109,36 @@ __decorate([
|
|
|
106
109
|
(0, typegoose_1.prop)({ type: Date }),
|
|
107
110
|
__metadata("design:type", Date)
|
|
108
111
|
], TournamentMatch.prototype, "endDate", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
114
|
+
__metadata("design:type", Boolean)
|
|
115
|
+
], TournamentMatch.prototype, "matchEnded", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, typegoose_1.prop)({ type: String }),
|
|
118
|
+
__metadata("design:type", String)
|
|
119
|
+
], TournamentMatch.prototype, "matchStatus", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, typegoose_1.prop)({ type: () => Boolean }),
|
|
122
|
+
__metadata("design:type", Map)
|
|
123
|
+
], TournamentMatch.prototype, "notificationFlags", void 0);
|
|
124
|
+
class ScheduledNotificationConfig {
|
|
125
|
+
type;
|
|
126
|
+
durationMins;
|
|
127
|
+
target;
|
|
128
|
+
}
|
|
129
|
+
exports.ScheduledNotificationConfig = ScheduledNotificationConfig;
|
|
130
|
+
__decorate([
|
|
131
|
+
(0, typegoose_1.prop)({ required: true, type: String }),
|
|
132
|
+
__metadata("design:type", String)
|
|
133
|
+
], ScheduledNotificationConfig.prototype, "type", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
(0, typegoose_1.prop)({ required: true, type: Number }),
|
|
136
|
+
__metadata("design:type", Number)
|
|
137
|
+
], ScheduledNotificationConfig.prototype, "durationMins", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
(0, typegoose_1.prop)({ required: true, type: String }),
|
|
140
|
+
__metadata("design:type", String)
|
|
141
|
+
], ScheduledNotificationConfig.prototype, "target", void 0);
|
|
109
142
|
let TournamentReward = class TournamentReward {
|
|
110
143
|
type;
|
|
111
144
|
};
|
|
@@ -135,24 +168,19 @@ __decorate([
|
|
|
135
168
|
(0, typegoose_1.prop)({ type: Number, default: null }),
|
|
136
169
|
__metadata("design:type", Object)
|
|
137
170
|
], TournamentCouponReward.prototype, "maxDiscountPerOrder", void 0);
|
|
138
|
-
class
|
|
139
|
-
tag;
|
|
171
|
+
class NotificationMessage {
|
|
140
172
|
title;
|
|
141
173
|
body;
|
|
142
174
|
}
|
|
143
|
-
exports.
|
|
175
|
+
exports.NotificationMessage = NotificationMessage;
|
|
144
176
|
__decorate([
|
|
145
177
|
(0, typegoose_1.prop)({ required: true, type: String }),
|
|
146
178
|
__metadata("design:type", String)
|
|
147
|
-
],
|
|
179
|
+
], NotificationMessage.prototype, "title", void 0);
|
|
148
180
|
__decorate([
|
|
149
181
|
(0, typegoose_1.prop)({ required: true, type: String }),
|
|
150
182
|
__metadata("design:type", String)
|
|
151
|
-
],
|
|
152
|
-
__decorate([
|
|
153
|
-
(0, typegoose_1.prop)({ required: true, type: String }),
|
|
154
|
-
__metadata("design:type", String)
|
|
155
|
-
], TournamentNotificationTemplate.prototype, "body", void 0);
|
|
183
|
+
], NotificationMessage.prototype, "body", void 0);
|
|
156
184
|
let Tournament = class Tournament extends defaultClasses_1.TimeStamps {
|
|
157
185
|
name;
|
|
158
186
|
tag;
|
|
@@ -163,6 +191,7 @@ let Tournament = class Tournament extends defaultClasses_1.TimeStamps {
|
|
|
163
191
|
matches;
|
|
164
192
|
reward;
|
|
165
193
|
notificationTemplates;
|
|
194
|
+
scheduledNotifications;
|
|
166
195
|
};
|
|
167
196
|
exports.Tournament = Tournament;
|
|
168
197
|
__decorate([
|
|
@@ -201,9 +230,13 @@ __decorate([
|
|
|
201
230
|
__metadata("design:type", TournamentReward)
|
|
202
231
|
], Tournament.prototype, "reward", void 0);
|
|
203
232
|
__decorate([
|
|
204
|
-
(0, typegoose_1.prop)({ type: () =>
|
|
205
|
-
__metadata("design:type",
|
|
233
|
+
(0, typegoose_1.prop)({ type: () => NotificationMessage }),
|
|
234
|
+
__metadata("design:type", Map)
|
|
206
235
|
], Tournament.prototype, "notificationTemplates", void 0);
|
|
236
|
+
__decorate([
|
|
237
|
+
(0, typegoose_1.prop)({ type: () => [ScheduledNotificationConfig], default: [], _id: false }),
|
|
238
|
+
__metadata("design:type", Array)
|
|
239
|
+
], Tournament.prototype, "scheduledNotifications", void 0);
|
|
207
240
|
exports.Tournament = Tournament = __decorate([
|
|
208
241
|
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'tournaments', timestamps: true } })
|
|
209
242
|
], Tournament);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tournament.model.js","sourceRoot":"/","sources":["libraries/mongo/models/tournament.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AACrE,uCAAiC;AACjC,kDAAuE;AAEvE,MAAa,UAAU;IAEf,KAAK,CAAiB;IAGtB,KAAK,CAAiB;CAC7B;AAND,gCAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;yCACT;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;yCACT;AAG9B,MAAa,cAAc;IAEnB,GAAG,CAAkB;IAGrB,IAAI,CAAU;IAGd,OAAO,CAAU;CACx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AAI,EAAE,CAAC;8BACpB,IAAI;2CAAC;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;0CACtC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;yCACpB;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;2CAClB;AAM5B;IAJN,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,GAAG,EAAE,CAAC,gBAAgB;QAC5B,cAAc,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,2BAAoB,CAAC,MAAM,EAAE,CAAC;KAC5F,CAAC;8BACc,gBAAgB;0CAAC;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,mBAAmB,EAAE,CAAC;8BACX,GAAG;yDAA8B;AAGzD;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,2BAA2B,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;;0DACf;qBAhClD,UAAU;IADtB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;GACpE,UAAU,CAiCtB","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Types } from 'mongoose';\nimport { Status, TournamentRewardType } from '../../../utilities/enum';\n\nexport class MatchScore {\n\t@prop({ type: Number, default: null })\n\tpublic team1!: number | null;\n\n\t@prop({ type: Number, default: null })\n\tpublic team2!: number | null;\n}\n\nexport class TournamentTeam {\n\t@prop({ type: Types.ObjectId, default: () => new Types.ObjectId() })\n\tpublic _id!: Types.ObjectId;\n\n\t@prop({ required: true, type: String, trim: true })\n\tpublic name!: string;\n\n\t@prop({ type: String })\n\tpublic picture?: string;\n}\n\nexport class TournamentMatchTeam {\n\t@prop({ required: true, type: Types.ObjectId })\n\tpublic teamId!: Types.ObjectId;\n\n\t@prop({ required: true, type: String, trim: true })\n\tpublic name!: string;\n}\n\nexport class TournamentMatch {\n\t@prop({ type: Types.ObjectId, default: () => new Types.ObjectId() })\n\tpublic _id!: Types.ObjectId;\n\n\t@prop({ type: String, trim: true })\n\tpublic additionalTag?: string;\n\n\t@prop({ required: true, type: String, trim: true })\n\tpublic stage!: string;\n\n\t@prop({ required: true, type: () => TournamentMatchTeam, _id: false })\n\tpublic team1!: TournamentMatchTeam;\n\n\t@prop({ required: true, type: () => TournamentMatchTeam, _id: false })\n\tpublic team2!: TournamentMatchTeam;\n\n\t@prop({ type: () => MatchScore, _id: false, default: () => ({}) })\n\tpublic score!: MatchScore;\n\n\t@prop({ type: Types.ObjectId, default: null })\n\tpublic winnerId!: Types.ObjectId | null;\n\n\t@prop({ required: true, type: Date })\n\tpublic startingDate!: Date;\n\n\t@prop({ type: Date })\n\tpublic endDate?: Date;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic matchEnded!: boolean;\n\n\t@prop({ type: String })\n\tpublic matchStatus?: string; // suspended, ongoing, etc\n\n\t@prop({ type: () => Boolean })\n\tpublic notificationFlags!: Map<string, boolean>;\n}\n\nexport class ScheduledNotificationConfig {\n\t@prop({ required: true, type: String })\n\tpublic type!: string;\n\n\t@prop({ required: true, type: Number })\n\tpublic durationMins!: number;\n\n\t@prop({ required: true, type: String })\n\tpublic target!: string;\n}\n\n@modelOptions({ schemaOptions: { discriminatorKey: 'type', _id: false } })\nexport class TournamentReward {\n\t@prop({ required: true, type: String, enum: TournamentRewardType })\n\tpublic type!: TournamentRewardType;\n}\n\nexport class TournamentCouponReward extends TournamentReward {\n\t@prop({ required: true, type: String, trim: true })\n\tpublic couponNamePrefix!: string;\n\n\t@prop({ required: true, type: Number })\n\tpublic percentage!: number;\n\n\t@prop({ type: Number, default: null })\n\tpublic maxDiscountPerOrder!: number | null;\n}\n\nexport class NotificationMessage {\n\t@prop({ required: true, type: String })\n\tpublic title!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic body!: string;\n}\n\n@modelOptions({ schemaOptions: { collection: 'tournaments', timestamps: true } })\nexport class Tournament extends TimeStamps {\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String, trim: true })\n\tpublic tag!: string;\n\n\t@prop({ required: true, type: Date })\n\tpublic startDate!: Date;\n\n\t@prop({ required: true, type: Date })\n\tpublic endDate!: Date;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ type: () => [TournamentTeam], default: [] })\n\tpublic teams!: TournamentTeam[];\n\n\t@prop({ type: () => [TournamentMatch], default: [] })\n\tpublic matches!: TournamentMatch[];\n\n\t@prop({\n\t\ttype: () => TournamentReward,\n\t\tdiscriminators: () => [{ type: TournamentCouponReward, value: TournamentRewardType.COUPON }],\n\t})\n\tpublic reward?: TournamentReward;\n\n\t@prop({ type: () => NotificationMessage })\n\tpublic notificationTemplates!: Map<string, NotificationMessage>;\n\n\t@prop({ type: () => [ScheduledNotificationConfig], default: [], _id: false })\n\tpublic scheduledNotifications!: ScheduledNotificationConfig[];\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED