@lyxa.ai/core 1.4.152 → 1.4.153

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.
@@ -4,6 +4,7 @@ import { Types } from 'mongoose';
4
4
  import { User } from './user.model';
5
5
  import { MatchScore, Tournament } from './tournament.model';
6
6
  import { Coupon } from './coupon.model';
7
+ import { TournamentParticipantStatus } from '../../../utilities/enum';
7
8
  export declare class TournamentPredictionEntry {
8
9
  _id: Types.ObjectId;
9
10
  matchId: Types.ObjectId;
@@ -16,6 +17,6 @@ export declare class TournamentParticipant extends TimeStamps {
16
17
  userId: Ref<User>;
17
18
  tournamentId: Ref<Tournament>;
18
19
  teamId?: Types.ObjectId;
19
- status?: string;
20
+ status?: TournamentParticipantStatus;
20
21
  predictions: TournamentPredictionEntry[];
21
22
  }
@@ -16,6 +16,7 @@ const mongoose_1 = require("mongoose");
16
16
  const user_model_1 = require("./user.model");
17
17
  const tournament_model_1 = require("./tournament.model");
18
18
  const coupon_model_1 = require("./coupon.model");
19
+ const enum_1 = require("../../../utilities/enum");
19
20
  class TournamentPredictionEntry {
20
21
  _id;
21
22
  matchId;
@@ -70,7 +71,7 @@ __decorate([
70
71
  __metadata("design:type", mongoose_1.Types.ObjectId)
71
72
  ], TournamentParticipant.prototype, "teamId", void 0);
72
73
  __decorate([
73
- (0, typegoose_1.prop)({ type: String }),
74
+ (0, typegoose_1.prop)({ type: String, enum: enum_1.TournamentParticipantStatus }),
74
75
  __metadata("design:type", String)
75
76
  ], TournamentParticipant.prototype, "status", void 0);
76
77
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"tournament-participant.model.js","sourceRoot":"/","sources":["libraries/mongo/models/tournament-participant.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,uCAAiC;AACjC,6CAAoC;AACpC,yDAA4D;AAC5D,iDAAwC;AAExC,MAAa,yBAAyB;IAE9B,GAAG,CAAkB;IAG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gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,6BAAU,EAAE,CAAC;;2DACV;AAG/B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,gBAAK,CAAC,QAAQ,EAAE,CAAC;8BACf,gBAAK,CAAC,QAAQ;qDAAC;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDACA;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,yBAAyB,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;0DACd;gCAdrC,qBAAqB;IADjC,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,wBAAwB,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;GAC/E,qBAAqB,CAejC","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Types } from 'mongoose';\nimport { User } from './user.model';\nimport { MatchScore, Tournament } from './tournament.model';\nimport { Coupon } from './coupon.model';\n\nexport class TournamentPredictionEntry {\n\t@prop({ type: Types.ObjectId, default: () => new Types.ObjectId() })\n\tpublic _id!: Types.ObjectId;\n\n\t@prop({ required: true, type: Types.ObjectId })\n\tpublic matchId!: Types.ObjectId;\n\n\t@prop({ required: true, type: () => MatchScore, _id: false })\n\tpublic score!: MatchScore;\n\n\t@prop({ required: true, type: Date })\n\tpublic predictionTime!: Date;\n\n\t@prop({ type: Boolean, default: null })\n\tpublic succeeded!: boolean | null;\n\n\t@prop({ ref: () => Coupon })\n\tpublic coupon?: Ref<Coupon>;\n}\n\n@modelOptions({ schemaOptions: { collection: 'tournamentParticipants', timestamps: true } })\nexport class TournamentParticipant extends TimeStamps {\n\t@prop({ required: true, ref: () => User })\n\tpublic userId!: Ref<User>;\n\n\t@prop({ required: true, ref: () => Tournament })\n\tpublic tournamentId!: Ref<Tournament>;\n\n\t@prop({ type: Types.ObjectId })\n\tpublic teamId?: Types.ObjectId;\n\n\t@prop({ type: String })\n\tpublic status?: string;\n\n\t@prop({ type: () => [TournamentPredictionEntry], default: [] })\n\tpublic predictions!: TournamentPredictionEntry[];\n}\n"]}
1
+ {"version":3,"file":"tournament-participant.model.js","sourceRoot":"/","sources":["libraries/mongo/models/tournament-participant.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,uCAAiC;AACjC,6CAAoC;AACpC,yDAA4D;AAC5D,iDAAwC;AACxC,kDAAsE;AAEtE,MAAa,yBAAyB;IAE9B,GAAG,CAAkB;IAGrB,OAAO,CAAkB;IAGzB,KAAK,CAAc;IAGnB,cAAc,CAAQ;IAGtB,SAAS,CAAkB;IAG3B,MAAM,CAAe;CAC5B;AAlBD,8DAkBC;AAhBO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,gBAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,gBAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;8BACvD,gBAAK,CAAC,QAAQ;sDAAC;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAK,CAAC,QAAQ,EAAE,CAAC;8BAC9B,gBAAK,CAAC,QAAQ;0DAAC;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,6BAAU,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;8BAC9C,6BAAU;wDAAC;AAGnB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACb,IAAI;iEAAC;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;4DACL;AAG3B;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,CAAC;;yDACA;AAItB,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,2BAAU;IAE7C,MAAM,CAAa;IAGnB,YAAY,CAAmB;IAG/B,MAAM,CAAkB;IAGxB,MAAM,CAA+B;IAGrC,WAAW,CAA+B;CACjD,CAAA;AAfY,sDAAqB;AAE1B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;qDAChB;AAGnB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,6BAAU,EAAE,CAAC;;2DACV;AAG/B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,gBAAK,CAAC,QAAQ,EAAE,CAAC;8BACf,gBAAK,CAAC,QAAQ;qDAAC;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kCAA2B,EAAE,CAAC;;qDACd;AAGrC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,yBAAyB,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;0DACd;gCAdrC,qBAAqB;IADjC,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,wBAAwB,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;GAC/E,qBAAqB,CAejC","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Types } from 'mongoose';\nimport { User } from './user.model';\nimport { MatchScore, Tournament } from './tournament.model';\nimport { Coupon } from './coupon.model';\nimport { TournamentParticipantStatus } from '../../../utilities/enum';\n\nexport class TournamentPredictionEntry {\n\t@prop({ type: Types.ObjectId, default: () => new Types.ObjectId() })\n\tpublic _id!: Types.ObjectId;\n\n\t@prop({ required: true, type: Types.ObjectId })\n\tpublic matchId!: Types.ObjectId;\n\n\t@prop({ required: true, type: () => MatchScore, _id: false })\n\tpublic score!: MatchScore;\n\n\t@prop({ required: true, type: Date })\n\tpublic predictionTime!: Date;\n\n\t@prop({ type: Boolean, default: null })\n\tpublic succeeded!: boolean | null;\n\n\t@prop({ ref: () => Coupon })\n\tpublic coupon?: Ref<Coupon>;\n}\n\n@modelOptions({ schemaOptions: { collection: 'tournamentParticipants', timestamps: true } })\nexport class TournamentParticipant extends TimeStamps {\n\t@prop({ required: true, ref: () => User })\n\tpublic userId!: Ref<User>;\n\n\t@prop({ required: true, ref: () => Tournament })\n\tpublic tournamentId!: Ref<Tournament>;\n\n\t@prop({ type: Types.ObjectId })\n\tpublic teamId?: Types.ObjectId;\n\n\t@prop({ type: String, enum: TournamentParticipantStatus })\n\tpublic status?: TournamentParticipantStatus;\n\n\t@prop({ type: () => [TournamentPredictionEntry], default: [] })\n\tpublic predictions!: TournamentPredictionEntry[];\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
2
2
  import { Types } from 'mongoose';
3
- import { Status, TournamentProvider, TournamentRewardType } from '../../../utilities/enum';
3
+ import { Status, TournamentProvider, TournamentMatchStatus, TournamentNotificationTag, TournamentRewardType, TournamentScheduledNotificationTarget } from '../../../utilities/enum';
4
4
  export declare class MatchScore {
5
5
  team1: number | null;
6
6
  team2: number | null;
@@ -27,13 +27,13 @@ export declare class TournamentMatch {
27
27
  startingDate: Date;
28
28
  endDate?: Date;
29
29
  matchEnded: boolean;
30
- matchStatus?: string;
31
- notificationFlags: Map<string, boolean>;
30
+ matchStatus?: TournamentMatchStatus;
31
+ notificationFlags: Map<TournamentNotificationTag, boolean>;
32
32
  }
33
33
  export declare class ScheduledNotificationConfig {
34
- type: string;
34
+ type: TournamentNotificationTag;
35
35
  durationMins: number;
36
- target: string;
36
+ target: TournamentScheduledNotificationTarget;
37
37
  }
38
38
  export declare class TournamentReward {
39
39
  type: TournamentRewardType;
@@ -53,11 +53,13 @@ export declare class Tournament extends TimeStamps {
53
53
  startDate: Date;
54
54
  endDate: Date;
55
55
  status: Status;
56
+ deepLinkRoute?: string;
56
57
  externalProvider?: TournamentProvider;
57
58
  externalApiKey?: string;
58
59
  teams: TournamentTeam[];
59
60
  matches: TournamentMatch[];
60
61
  reward?: TournamentReward;
61
- notificationTemplates: Map<string, NotificationMessage>;
62
+ notificationTemplates: Map<TournamentNotificationTag, NotificationMessage>;
62
63
  scheduledNotifications: ScheduledNotificationConfig[];
64
+ notificationFlags: Map<TournamentNotificationTag, boolean>;
63
65
  }
@@ -124,7 +124,7 @@ __decorate([
124
124
  __metadata("design:type", Boolean)
125
125
  ], TournamentMatch.prototype, "matchEnded", void 0);
126
126
  __decorate([
127
- (0, typegoose_1.prop)({ type: String }),
127
+ (0, typegoose_1.prop)({ type: String, enum: enum_1.TournamentMatchStatus }),
128
128
  __metadata("design:type", String)
129
129
  ], TournamentMatch.prototype, "matchStatus", void 0);
130
130
  __decorate([
@@ -138,7 +138,7 @@ class ScheduledNotificationConfig {
138
138
  }
139
139
  exports.ScheduledNotificationConfig = ScheduledNotificationConfig;
140
140
  __decorate([
141
- (0, typegoose_1.prop)({ required: true, type: String }),
141
+ (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.TournamentNotificationTag }),
142
142
  __metadata("design:type", String)
143
143
  ], ScheduledNotificationConfig.prototype, "type", void 0);
144
144
  __decorate([
@@ -146,7 +146,7 @@ __decorate([
146
146
  __metadata("design:type", Number)
147
147
  ], ScheduledNotificationConfig.prototype, "durationMins", void 0);
148
148
  __decorate([
149
- (0, typegoose_1.prop)({ required: true, type: String }),
149
+ (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.TournamentScheduledNotificationTarget }),
150
150
  __metadata("design:type", String)
151
151
  ], ScheduledNotificationConfig.prototype, "target", void 0);
152
152
  let TournamentReward = class TournamentReward {
@@ -197,6 +197,7 @@ let Tournament = class Tournament extends defaultClasses_1.TimeStamps {
197
197
  startDate;
198
198
  endDate;
199
199
  status;
200
+ deepLinkRoute;
200
201
  externalProvider;
201
202
  externalApiKey;
202
203
  teams;
@@ -204,6 +205,7 @@ let Tournament = class Tournament extends defaultClasses_1.TimeStamps {
204
205
  reward;
205
206
  notificationTemplates;
206
207
  scheduledNotifications;
208
+ notificationFlags;
207
209
  };
208
210
  exports.Tournament = Tournament;
209
211
  __decorate([
@@ -226,6 +228,10 @@ __decorate([
226
228
  (0, typegoose_1.prop)({ type: String, enum: enum_1.Status, default: enum_1.Status.ACTIVE }),
227
229
  __metadata("design:type", String)
228
230
  ], Tournament.prototype, "status", void 0);
231
+ __decorate([
232
+ (0, typegoose_1.prop)({ type: String, default: null }),
233
+ __metadata("design:type", String)
234
+ ], Tournament.prototype, "deepLinkRoute", void 0);
229
235
  __decorate([
230
236
  (0, typegoose_1.prop)({ required: false, type: String, enum: enum_1.TournamentProvider }),
231
237
  __metadata("design:type", String)
@@ -257,6 +263,10 @@ __decorate([
257
263
  (0, typegoose_1.prop)({ type: () => [ScheduledNotificationConfig], default: [], _id: false }),
258
264
  __metadata("design:type", Array)
259
265
  ], Tournament.prototype, "scheduledNotifications", void 0);
266
+ __decorate([
267
+ (0, typegoose_1.prop)({ type: () => Boolean }),
268
+ __metadata("design:type", Map)
269
+ ], Tournament.prototype, "notificationFlags", void 0);
260
270
  exports.Tournament = Tournament = __decorate([
261
271
  (0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'tournaments', timestamps: true } })
262
272
  ], Tournament);
@@ -1 +1 @@
1
- {"version":3,"file":"tournament.model.js","sourceRoot":"/","sources":["libraries/mongo/models/tournament.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EA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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;qBAtClD,UAAU;IADtB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;GACpE,UAAU,CAuCtB","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Types } from 'mongoose';\nimport { Status, TournamentProvider, 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({ type: String, default: null })\n\tpublic externalId?: string;\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, default: null })\n\tpublic externalId?: string;\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;\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({ required: false, type: String, enum: TournamentProvider })\n\tpublic externalProvider?: TournamentProvider;\n\n\t@prop({ required: false, type: String })\n\tpublic externalApiKey?: string;\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"]}
1
+ {"version":3,"file":"tournament.model.js","sourceRoot":"/","sources":["libraries/mongo/models/tournament.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AACrE,uCAAiC;AACjC,kDAAoL;AAEpL,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,UAAU,CAAU;IAGpB,IAAI,CAAU;IAGd,OAAO,CAAU;CACxB;AAZD,wCAYC;AAVO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,gBAAK,CAA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,GAAG,EAAE,CAAC,CAAC,2BAA2B,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;;0DACf;AAGvD;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;8BACH,GAAG;qDAAqC;qBA5CvD,UAAU;IADtB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;GACpE,UAAU,CA6CtB","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Types } from 'mongoose';\nimport { Status, TournamentProvider, TournamentMatchStatus, TournamentNotificationTag, TournamentRewardType, TournamentScheduledNotificationTarget } 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({ type: String, default: null })\n\tpublic externalId?: string;\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, default: null })\n\tpublic externalId?: string;\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, enum: TournamentMatchStatus })\n\tpublic matchStatus?: TournamentMatchStatus;\n\n\t@prop({ type: () => Boolean })\n\tpublic notificationFlags!: Map<TournamentNotificationTag, boolean>;\n}\n\nexport class ScheduledNotificationConfig {\n\t@prop({ required: true, type: String, enum: TournamentNotificationTag })\n\tpublic type!: TournamentNotificationTag;\n\n\t@prop({ required: true, type: Number })\n\tpublic durationMins!: number;\n\n\t@prop({ required: true, type: String, enum: TournamentScheduledNotificationTarget })\n\tpublic target!: TournamentScheduledNotificationTarget;\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: String, default: null })\n\tpublic deepLinkRoute?: string;\n\n\t@prop({ required: false, type: String, enum: TournamentProvider })\n\tpublic externalProvider?: TournamentProvider;\n\n\t@prop({ required: false, type: String })\n\tpublic externalApiKey?: string;\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<TournamentNotificationTag, NotificationMessage>;\n\n\t@prop({ type: () => [ScheduledNotificationConfig], default: [], _id: false })\n\tpublic scheduledNotifications!: ScheduledNotificationConfig[];\n\n\t@prop({ type: () => Boolean })\n\tpublic notificationFlags!: Map<TournamentNotificationTag, boolean>;\n}\n"]}
@@ -5,9 +5,9 @@ interface AuthOptions {
5
5
  autoRefresh?: boolean;
6
6
  }
7
7
  export declare function createAuthenticatedProcedure(options: AuthOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
8
+ req: import("http").IncomingMessage;
8
9
  res: import("http").ServerResponse<import("http").IncomingMessage>;
9
10
  tokenType: TokenType | undefined;
10
- req: import("http").IncomingMessage;
11
11
  requestId: string | undefined;
12
12
  entity: import("../context").EntityContext | undefined;
13
13
  usedRefreshToken: boolean | undefined;
@@ -4,9 +4,9 @@ interface RoleProtectedOptions {
4
4
  allowedRoles: string[];
5
5
  }
6
6
  export declare function createRoleProtectedProcedure(options: RoleProtectedOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
7
+ req: import("http").IncomingMessage;
7
8
  res: import("http").ServerResponse<import("http").IncomingMessage>;
8
9
  tokenType: import("../../auth").TokenType | undefined;
9
- req: import("http").IncomingMessage;
10
10
  requestId: string | undefined;
11
11
  entity: import("../context").EntityContext | undefined;
12
12
  usedRefreshToken: boolean | undefined;
@@ -3,9 +3,9 @@ interface PhoneVerifiedOptions {
3
3
  entityTypes: AuthEntityType[];
4
4
  }
5
5
  export declare function createPhoneVerifiedProcedure(options: PhoneVerifiedOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
6
+ req: import("http").IncomingMessage;
6
7
  res: import("http").ServerResponse<import("http").IncomingMessage>;
7
8
  tokenType: import("../../auth").TokenType | undefined;
8
- req: import("http").IncomingMessage;
9
9
  requestId: string | undefined;
10
10
  entity: import("../context").EntityContext | undefined;
11
11
  usedRefreshToken: boolean | undefined;
@@ -5,9 +5,9 @@ interface AuthOptions {
5
5
  autoRefresh?: boolean;
6
6
  }
7
7
  export declare function publicUserDecoder(options: AuthOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
8
+ req: import("http").IncomingMessage;
8
9
  res: import("http").ServerResponse<import("http").IncomingMessage>;
9
10
  tokenType: TokenType | undefined;
10
- req: import("http").IncomingMessage;
11
11
  requestId: string | undefined;
12
12
  entity: import("../context").EntityContext | undefined;
13
13
  usedRefreshToken: boolean | undefined;
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.4.152
25
+ Version: 1.4.153
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.4.152",
3
+ "version": "1.4.153",
4
4
  "description": "Lyxa type definitions and validation schemas for both frontend and backend",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",
@@ -356,7 +356,8 @@ export declare enum ClickType {
356
356
  CLICKABLE_WALLET = "clickable_wallet",
357
357
  CLICKABLE_SETTING = "clickable_setting",
358
358
  CLICKABLE_FALLBACK = "clickable_fallback",
359
- CLICKABLE_BOOKING = "clickable_booking"
359
+ CLICKABLE_BOOKING = "clickable_booking",
360
+ CLICKABLE_TOURNAMENT = "clickable_tournament"
360
361
  }
361
362
  export declare enum ChargeType {
362
363
  CUSTOM = "custom"
@@ -1252,3 +1253,26 @@ export declare enum TournamentRewardType {
1252
1253
  export declare enum TournamentProvider {
1253
1254
  API_FOOTBALL = "api-football"
1254
1255
  }
1256
+ export declare enum TournamentNotificationTag {
1257
+ TOURNAMENT_ACTIVATION = "tournament-activation",
1258
+ MATCH_RESULT_WINNER = "match-result-winner",
1259
+ MATCH_RESULT_LOSER = "match-result-loser",
1260
+ TEAM_SELECTION_REMINDER_1_DAY = "team-selection-reminder-1-day",
1261
+ PREDICTION_REMINDER_3_HOURS = "prediction-reminder-3-hours",
1262
+ PREDICTION_REMINDER_15_MINUTES = "prediction-reminder-15-minutes"
1263
+ }
1264
+ export declare enum TournamentScheduledNotificationTarget {
1265
+ GLOBAL = "global",
1266
+ PREDICTION_PENDING_PARTICIPANTS = "prediction-pending-participants",
1267
+ NO_TEAM_SELECTED_PARTICIPANTS = "no-team-selected-participants"
1268
+ }
1269
+ export declare enum TournamentMatchStatus {
1270
+ UPCOMING = "upcoming",
1271
+ STARTED = "started",
1272
+ ENDED = "ended"
1273
+ }
1274
+ export declare enum TournamentParticipantStatus {
1275
+ JOINED = "joined",
1276
+ SEEN = "seen",
1277
+ NOT_SEEN = "not_seen"
1278
+ }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BobType = exports.BobChannelType = exports.BobModel = exports.BobSettlementStatus = exports.BobSettlementType = exports.BobAccountType = exports.ZoneStatus = exports.FaqAccountType = exports.CounterType = exports.BannerUserType = exports.BannerLinkType = exports.BannerClickType = exports.VendorRole = exports.ShopRole = exports.OnlineStatus = exports.ShopOnlineStatus = exports.ChargeType = exports.ClickType = exports.NotificationAccountType = exports.DishCategory = exports.ProductDietaryType = exports.ShopDietaryType = exports.PriceOption = exports.ProductType = exports.CoreAuthIdentityType = exports.UserAppSectionItemType = exports.UserAppSectionType = exports.AdminLogsUpdatedFieldsType = exports.UpdatedField = exports.GeoLocationType = exports.RatingAccountType = exports.SubscriptionStatus = exports.SubscriptionPackage = exports.PaidCurrency = exports.PaymentStatus = exports.ChangeReturnMethod = exports.PaymentMethod = exports.ValueType = exports.HolidayWorkStatus = exports.WorkStatus = exports.WeekDay = exports.GlobalItemType = exports.AdjustmentStatus = exports.ServiceItemType = exports.ItemType = exports.Status = exports.AppPlatform = exports.AccountType = exports.AgentLiveStatus = exports.AuthEntityType = void 0;
4
4
  exports.PayoutStatus = exports.PayoutType = exports.AddRemoveCreditAccountType = exports.SettingsReasonStatus = exports.CancellationReasonTypeEnum = exports.SupportReasonTypeEnum = exports.PlusSettingsPackageType = exports.AddRemoveCreditSettlementType = exports.SettlementType = exports.MediaType = exports.WorkingHourSettingsType = exports.ZoneGeometryType = exports.RiderAssignmentStatus = exports.CourierServiceType = exports.TripLegStatus = exports.DeliveryStatus = exports.CourierOrderPaymentFrom = exports.UserActionReason = exports.UserActionType = exports.ShopCourierOrderStatus = exports.ServiceBookingStatus = exports.CourierOrderStatus = exports.RegularOrderStatus = exports.AdjustmentType = exports.ServiceBookingStatusTimelineType = exports.StatusTimelineType = exports.OrderType = exports.Language = exports.OrderSize = exports.RiderBagSize = exports.RiderType = exports.ShiftType = exports.CreatedBy = exports.LiveStatus = exports.PaymentIntentStatus = exports.CardStatus = exports.CardUserType = exports.PaymentProvider = exports.CardType = exports.PaymentPreference = exports.CartStatus = exports.LimitedTimeOfferCampaignStatus = exports.AdminRole = exports.PunchMarketingStatus = exports.MarketingStatus = exports.ServiceMarketingType = exports.MarketingType = exports.FavouriteType = exports.CouponExpirationReason = exports.CouponType = void 0;
5
5
  exports.SyncCacheEnumType = exports.DateFormatType = exports.AppAppearanceType = exports.GraphType = exports.CalendarEventType = exports.CalendarViewType = exports.LyxaTimeZoneEnum = exports.UserOrderCompletionScope = exports.GroupCartNotificationStatus = exports.Currency = exports.RequestFrom = exports.UploadState = exports.SubServiceType = exports.ServiceType = exports.ActionType = exports.DeviceType = exports.PushNotificationEventType = exports.SocketEventType = exports.SocketServiceQueue = exports.OtpMethodType = exports.ReviewType = exports.FoodNutritionType = exports.AdjustmentReason = exports.UrgentOrderReasons = exports.ServiceFlagReasonType = exports.ServiceFlagType = exports.FlagReasonType = exports.FlagType = exports.PromotionType = exports.ServiceBookingCanceledBy = exports.TRPCErrorEnum = exports.ShopFilterSortByEnum = exports.BookingStatus = exports.ProfessionalScheduleType = exports.ServiceBookingRecurrencePattern = exports.ProfessionalRecurrencePattern = exports.ServiceBookingPriority = exports.ProfessionalStatus = exports.Service = exports.ServiceLineItemType = exports.ServiceCartStatus = exports.ChatroomType = exports.UserRef = exports.TicketStatus = exports.TicketType = exports.RewardedToTypeEnum = exports.ReplacementType = exports.ReplacementReason = exports.OrderCanceledBy = exports.LogUser = void 0;
6
- exports.TournamentProvider = exports.TournamentRewardType = exports.OnlinePaymentStatus = exports.BarcodeTypes = exports.RiderScoreEventTag = exports.AreebaPaymentType = exports.HttpStatus = exports.LogTag = exports.LogLevel = void 0;
6
+ exports.TournamentParticipantStatus = exports.TournamentMatchStatus = exports.TournamentScheduledNotificationTarget = exports.TournamentNotificationTag = exports.TournamentProvider = exports.TournamentRewardType = exports.OnlinePaymentStatus = exports.BarcodeTypes = exports.RiderScoreEventTag = exports.AreebaPaymentType = exports.HttpStatus = exports.LogTag = exports.LogLevel = void 0;
7
7
  var AuthEntityType;
8
8
  (function (AuthEntityType) {
9
9
  AuthEntityType["USER"] = "USER";
@@ -396,6 +396,7 @@ var ClickType;
396
396
  ClickType["CLICKABLE_SETTING"] = "clickable_setting";
397
397
  ClickType["CLICKABLE_FALLBACK"] = "clickable_fallback";
398
398
  ClickType["CLICKABLE_BOOKING"] = "clickable_booking";
399
+ ClickType["CLICKABLE_TOURNAMENT"] = "clickable_tournament";
399
400
  })(ClickType || (exports.ClickType = ClickType = {}));
400
401
  var ChargeType;
401
402
  (function (ChargeType) {
@@ -1417,4 +1418,31 @@ var TournamentProvider;
1417
1418
  (function (TournamentProvider) {
1418
1419
  TournamentProvider["API_FOOTBALL"] = "api-football";
1419
1420
  })(TournamentProvider || (exports.TournamentProvider = TournamentProvider = {}));
1421
+ var TournamentNotificationTag;
1422
+ (function (TournamentNotificationTag) {
1423
+ TournamentNotificationTag["TOURNAMENT_ACTIVATION"] = "tournament-activation";
1424
+ TournamentNotificationTag["MATCH_RESULT_WINNER"] = "match-result-winner";
1425
+ TournamentNotificationTag["MATCH_RESULT_LOSER"] = "match-result-loser";
1426
+ TournamentNotificationTag["TEAM_SELECTION_REMINDER_1_DAY"] = "team-selection-reminder-1-day";
1427
+ TournamentNotificationTag["PREDICTION_REMINDER_3_HOURS"] = "prediction-reminder-3-hours";
1428
+ TournamentNotificationTag["PREDICTION_REMINDER_15_MINUTES"] = "prediction-reminder-15-minutes";
1429
+ })(TournamentNotificationTag || (exports.TournamentNotificationTag = TournamentNotificationTag = {}));
1430
+ var TournamentScheduledNotificationTarget;
1431
+ (function (TournamentScheduledNotificationTarget) {
1432
+ TournamentScheduledNotificationTarget["GLOBAL"] = "global";
1433
+ TournamentScheduledNotificationTarget["PREDICTION_PENDING_PARTICIPANTS"] = "prediction-pending-participants";
1434
+ TournamentScheduledNotificationTarget["NO_TEAM_SELECTED_PARTICIPANTS"] = "no-team-selected-participants";
1435
+ })(TournamentScheduledNotificationTarget || (exports.TournamentScheduledNotificationTarget = TournamentScheduledNotificationTarget = {}));
1436
+ var TournamentMatchStatus;
1437
+ (function (TournamentMatchStatus) {
1438
+ TournamentMatchStatus["UPCOMING"] = "upcoming";
1439
+ TournamentMatchStatus["STARTED"] = "started";
1440
+ TournamentMatchStatus["ENDED"] = "ended";
1441
+ })(TournamentMatchStatus || (exports.TournamentMatchStatus = TournamentMatchStatus = {}));
1442
+ var TournamentParticipantStatus;
1443
+ (function (TournamentParticipantStatus) {
1444
+ TournamentParticipantStatus["JOINED"] = "joined";
1445
+ TournamentParticipantStatus["SEEN"] = "seen";
1446
+ TournamentParticipantStatus["NOT_SEEN"] = "not_seen";
1447
+ })(TournamentParticipantStatus || (exports.TournamentParticipantStatus = TournamentParticipantStatus = {}));
1420
1448
  //# sourceMappingURL=enum.js.map