@lyxa.ai/marketing 1.0.54 → 1.0.55

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.
Files changed (94) hide show
  1. package/dist/lib/index.d.ts +4 -0
  2. package/dist/lib/index.d.ts.map +1 -1
  3. package/dist/lib/index.js +2 -2
  4. package/dist/lib/index.js.map +1 -1
  5. package/dist/lib/modules/coupon/routers/coupon.router.d.ts +4 -0
  6. package/dist/lib/modules/coupon/routers/coupon.router.d.ts.map +1 -1
  7. package/dist/lib/modules/coupon/services/coupon.service.d.ts.map +1 -1
  8. package/dist/lib/modules/coupon/services/coupon.service.js +4 -1
  9. package/dist/lib/modules/coupon/services/coupon.service.js.map +1 -1
  10. package/dist/lib/modules/coupon/services/custom-coupon.service.d.ts +5 -0
  11. package/dist/lib/modules/coupon/services/custom-coupon.service.d.ts.map +1 -1
  12. package/dist/lib/modules/coupon/services/helper.service.d.ts +5 -0
  13. package/dist/lib/modules/coupon/services/helper.service.d.ts.map +1 -1
  14. package/dist/lib/modules/coupon/services/individual-store-coupon.service.d.ts +5 -0
  15. package/dist/lib/modules/coupon/services/individual-store-coupon.service.d.ts.map +1 -1
  16. package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.d.ts +1 -0
  17. package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.d.ts.map +1 -1
  18. package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.js +25 -7
  19. package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.js.map +1 -1
  20. package/dist/lib/modules/coupon/services/shops-categories-coupon.service.d.ts +5 -0
  21. package/dist/lib/modules/coupon/services/shops-categories-coupon.service.d.ts.map +1 -1
  22. package/dist/lib/modules/coupon/validations/coupon.validation.d.ts +18 -0
  23. package/dist/lib/modules/coupon/validations/coupon.validation.d.ts.map +1 -1
  24. package/dist/lib/modules/coupon/validations/coupon.validation.js +6 -0
  25. package/dist/lib/modules/coupon/validations/coupon.validation.js.map +1 -1
  26. package/dist/lib/modules/coupon/validations/create-coupon.validation.d.ts.map +1 -1
  27. package/dist/lib/modules/coupon/validations/create-coupon.validation.js +4 -1
  28. package/dist/lib/modules/coupon/validations/create-coupon.validation.js.map +1 -1
  29. package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.validation.d.ts +9 -1
  30. package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.validation.d.ts.map +1 -1
  31. package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.validation.js +26 -3
  32. package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.validation.js.map +1 -1
  33. package/dist/lib/modules/tournament/match/events/evaluate-predictions.consumer.js +1 -1
  34. package/dist/lib/modules/tournament/match/events/evaluate-predictions.consumer.js.map +1 -1
  35. package/dist/lib/modules/tournament/notification/__tests__/notification.service.spec.d.ts +2 -0
  36. package/dist/lib/modules/tournament/notification/__tests__/notification.service.spec.d.ts.map +1 -0
  37. package/dist/lib/modules/tournament/notification/__tests__/notification.service.spec.js +266 -0
  38. package/dist/lib/modules/tournament/notification/__tests__/notification.service.spec.js.map +1 -0
  39. package/dist/lib/modules/tournament/notification/notification.service.d.ts +14 -3
  40. package/dist/lib/modules/tournament/notification/notification.service.d.ts.map +1 -1
  41. package/dist/lib/modules/tournament/notification/notification.service.js +89 -31
  42. package/dist/lib/modules/tournament/notification/notification.service.js.map +1 -1
  43. package/dist/lib/modules/tournament/participant/participant.repository.d.ts +1 -0
  44. package/dist/lib/modules/tournament/participant/participant.repository.d.ts.map +1 -1
  45. package/dist/lib/modules/tournament/participant/participant.repository.js +9 -0
  46. package/dist/lib/modules/tournament/participant/participant.repository.js.map +1 -1
  47. package/dist/lib/modules/tournament/participant/participant.service.d.ts +1 -0
  48. package/dist/lib/modules/tournament/participant/participant.service.d.ts.map +1 -1
  49. package/dist/lib/modules/tournament/participant/participant.service.js +6 -0
  50. package/dist/lib/modules/tournament/participant/participant.service.js.map +1 -1
  51. package/dist/lib/modules/tournament/reward/reward.builder.d.ts.map +1 -1
  52. package/dist/lib/modules/tournament/reward/reward.builder.js +3 -3
  53. package/dist/lib/modules/tournament/reward/reward.builder.js.map +1 -1
  54. package/dist/lib/modules/tournament/reward/reward.types.d.ts +1 -0
  55. package/dist/lib/modules/tournament/reward/reward.types.d.ts.map +1 -1
  56. package/dist/lib/modules/tournament/reward/reward.types.js.map +1 -1
  57. package/dist/lib/modules/tournament/schedule/schedule.service.d.ts +7 -0
  58. package/dist/lib/modules/tournament/schedule/schedule.service.d.ts.map +1 -1
  59. package/dist/lib/modules/tournament/schedule/schedule.service.js +52 -19
  60. package/dist/lib/modules/tournament/schedule/schedule.service.js.map +1 -1
  61. package/dist/lib/utility/utils.js +2 -2
  62. package/dist/lib/utility/utils.js.map +1 -1
  63. package/dist/types/index.d.ts +4 -0
  64. package/dist/types/index.d.ts.map +1 -1
  65. package/dist/types/modules/coupon/routers/coupon.router.d.ts +4 -0
  66. package/dist/types/modules/coupon/routers/coupon.router.d.ts.map +1 -1
  67. package/dist/types/modules/coupon/services/coupon.service.d.ts.map +1 -1
  68. package/dist/types/modules/coupon/services/custom-coupon.service.d.ts +5 -0
  69. package/dist/types/modules/coupon/services/custom-coupon.service.d.ts.map +1 -1
  70. package/dist/types/modules/coupon/services/helper.service.d.ts +5 -0
  71. package/dist/types/modules/coupon/services/helper.service.d.ts.map +1 -1
  72. package/dist/types/modules/coupon/services/individual-store-coupon.service.d.ts +5 -0
  73. package/dist/types/modules/coupon/services/individual-store-coupon.service.d.ts.map +1 -1
  74. package/dist/types/modules/coupon/services/patterns/repository/CouponMetricsRepository.d.ts +1 -0
  75. package/dist/types/modules/coupon/services/patterns/repository/CouponMetricsRepository.d.ts.map +1 -1
  76. package/dist/types/modules/coupon/services/shops-categories-coupon.service.d.ts +5 -0
  77. package/dist/types/modules/coupon/services/shops-categories-coupon.service.d.ts.map +1 -1
  78. package/dist/types/modules/coupon/validations/coupon.validation.d.ts +18 -0
  79. package/dist/types/modules/coupon/validations/coupon.validation.d.ts.map +1 -1
  80. package/dist/types/modules/coupon/validations/create-coupon.validation.d.ts.map +1 -1
  81. package/dist/types/modules/limited-time-offer/config/limited-time-offer-config.validation.d.ts +9 -1
  82. package/dist/types/modules/limited-time-offer/config/limited-time-offer-config.validation.d.ts.map +1 -1
  83. package/dist/types/modules/tournament/notification/notification.service.d.ts +14 -3
  84. package/dist/types/modules/tournament/notification/notification.service.d.ts.map +1 -1
  85. package/dist/types/modules/tournament/participant/participant.repository.d.ts +1 -0
  86. package/dist/types/modules/tournament/participant/participant.repository.d.ts.map +1 -1
  87. package/dist/types/modules/tournament/participant/participant.service.d.ts +1 -0
  88. package/dist/types/modules/tournament/participant/participant.service.d.ts.map +1 -1
  89. package/dist/types/modules/tournament/reward/reward.builder.d.ts.map +1 -1
  90. package/dist/types/modules/tournament/reward/reward.types.d.ts +1 -0
  91. package/dist/types/modules/tournament/reward/reward.types.d.ts.map +1 -1
  92. package/dist/types/modules/tournament/schedule/schedule.service.d.ts +7 -0
  93. package/dist/types/modules/tournament/schedule/schedule.service.d.ts.map +1 -1
  94. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"participant.repository.d.ts","sourceRoot":"/","sources":["modules/tournament/participant/participant.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAE1E,qBACa,+BAA+B;IACxC,OAAO,CAAC,gBAAgB,CAAoC;;IAMtD,yBAAyB,CAC3B,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAC/B,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GACtC,OAAO,CAAC,OAAO,CAAC;IAIb,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,8BAA8B,CAAC;IAK9D,uBAAuB,CACzB,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QA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AE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GACjC,OAAO,CAAC,8BAA8B,EAAE,CAAC;CAU/C;AAED,eAAO,MAAM,+BAA+B,iCAAiD,CAAC"}
@@ -87,6 +87,15 @@ let TournamentParticipantRepository = class TournamentParticipantRepository {
87
87
  .lean()
88
88
  .exec();
89
89
  }
90
+ async findByTournamentWithPrediction(tournamentId, matchId) {
91
+ return this.participantModel
92
+ .find({
93
+ tournamentId,
94
+ 'predictions.matchId': matchId,
95
+ })
96
+ .lean()
97
+ .exec();
98
+ }
90
99
  };
91
100
  exports.TournamentParticipantRepository = TournamentParticipantRepository;
92
101
  exports.TournamentParticipantRepository = TournamentParticipantRepository = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"participant.repository.js","sourceRoot":"/","sources":["modules/tournament/participant/participant.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAE5C,sEAAuF;AAIhF,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAChC,gBAAgB,CAAoC;IAE5D;QACI,IAAI,CAAC,gBAAgB,GAAG,mCAA0B,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,yBAAyB,CAC3B,MAA+B,EAC/B,YAAqC;QAErC,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAa;QACtB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtD,OAAO,GAAG,CAAC,QAAQ,EAA+C,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,uBAAuB,CACzB,MAA+B,EAC/B,YAAqC;QAErC,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,YA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,OAAO,EAAE;SAC1C,CAAC;aACD,IAAI,EAAE;aACN,IAAI,EAA+C,CAAC;IAC7D,CAAC;CAEJ,CAAA;AA1EY,0EAA+B;0CAA/B,+BAA+B;IAD3C,IAAA,gBAAO,GAAE;;GACG,+BAA+B,CA0E3C;AAEY,QAAA,+BAA+B,GAAG,gBAAS,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { mongoose } from '@typegoose/typegoose';\nimport { TournamentParticipantModel } from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport { TournamentParticipantOutputDTO } from './participant.validation';\n\n@Service()\nexport class TournamentParticipantRepository {\n private participantModel: typeof TournamentParticipantModel;\n\n constructor() {\n this.participantModel = TournamentParticipantModel;\n }\n\n async existsByUserAndTournament(\n userId: mongoose.Types.ObjectId,\n tournamentId: mongoose.Types.ObjectId\n ): Promise<boolean> {\n return !!(await this.participantModel.exists({ userId, tournamentId }));\n }\n\n async create(input: object): Promise<TournamentParticipantOutputDTO> {\n const doc = await this.participantModel.create(input);\n return doc.toObject() as unknown as TournamentParticipantOutputDTO;\n }\n\n async findByUserAndTournament(\n userId: mongoose.Types.ObjectId,\n tournamentId: mongoose.Types.ObjectId\n ): Promise<TournamentParticipantOutputDTO | null> {\n return this.participantModel.findOne({ userId, tournamentId }).lean() as Promise<TournamentParticipantOutputDTO | null>;\n }\n\n async findByTournament(tournamentId: mongoose.Types.ObjectId): Promise<TournamentParticipantOutputDTO[]> {\n return this.participantModel.find({ tournamentId }).lean() as Promise<TournamentParticipantOutputDTO[]>;\n }\n\n async findByUser(userId: mongoose.Types.ObjectId): Promise<TournamentParticipantOutputDTO | null> {\n return this.participantModel\n .findOne({ userId })\n .sort({ createdAt: -1 })\n .lean() as Promise<TournamentParticipantOutputDTO | null>;\n }\n\n async updateToJoined(\n userId: mongoose.Types.ObjectId,\n tournamentId: mongoose.Types.ObjectId,\n teamId: mongoose.Types.ObjectId\n ): Promise<TournamentParticipantOutputDTO | null> {\n return this.participantModel\n .findOneAndUpdate({ userId, tournamentId }, { $set: { status: 'joined', teamId } }, { new: true })\n .lean() as Promise<TournamentParticipantOutputDTO | null>;\n }\n\n async createIfAbsent(\n userId: mongoose.Types.ObjectId,\n tournamentId: mongoose.Types.ObjectId,\n status: string\n ): Promise<void> {\n await this.participantModel.findOneAndUpdate(\n { userId, tournamentId },\n { $setOnInsert: { userId, tournamentId, predictions: [], status } },\n { upsert: true }\n );\n }\n\n public async findByTournamentWithoutPrediction(\n tournamentId: mongoose.Types.ObjectId,\n teamIds: mongoose.Types.ObjectId[],\n matchId: mongoose.Types.ObjectId\n ): Promise<TournamentParticipantOutputDTO[]> {\n return this.participantModel\n .find({\n tournamentId,\n teamId: { $in: teamIds },\n 'predictions.matchId': { $ne: matchId },\n })\n .lean()\n .exec() as Promise<TournamentParticipantOutputDTO[]>;\n }\n\n}\n\nexport const tournamentParticipantRepository = Container.get(TournamentParticipantRepository);\n"]}
1
+ {"version":3,"file":"participant.repository.js","sourceRoot":"/","sources":["modules/tournament/participant/participant.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAE5C,sEAAuF;AAIhF,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAChC,gBAAgB,CAAoC;IAE5D;QACI,IAAI,CAAC,gBAAgB,GAAG,mCAA0B,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,yBAAyB,CAC3B,MAA+B,EAC/B,YAAqC;QAErC,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAa;QACtB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtD,OAAO,GAAG,CAAC,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,OAAgC;QAEhC,OAAO,IAAI,CAAC,gBAAgB;aACvB,IAAI,CAAC;YACF,YAAY;YACZ,MAAM,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE;YACxB,qBAAqB,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE;SAC1C,CAAC;aACD,IAAI,EAAE;aACN,IAAI,EAA+C,CAAC;IAC7D,CAAC;IAEM,KAAK,CAAC,8BAA8B,CACvC,YAAqC,EACrC,OAAgC;QAEhC,OAAO,IAAI,CAAC,gBAAgB;aACvB,IAAI,CAAC;YACF,YAAY;YACZ,qBAAqB,EAAE,OAAO;SACjC,CAAC;aACD,IAAI,EAAE;aACN,IAAI,EAA+C,CAAC;IAC7D,CAAC;CAEJ,CAAA;AAvFY,0EAA+B;0CAA/B,+BAA+B;IAD3C,IAAA,gBAAO,GAAE;;GACG,+BAA+B,CAuF3C;AAEY,QAAA,+BAA+B,GAAG,gBAAS,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { mongoose } from '@typegoose/typegoose';\nimport { TournamentParticipantModel } from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport { TournamentParticipantOutputDTO } from './participant.validation';\n\n@Service()\nexport class TournamentParticipantRepository {\n private participantModel: typeof TournamentParticipantModel;\n\n constructor() {\n this.participantModel = TournamentParticipantModel;\n }\n\n async existsByUserAndTournament(\n userId: mongoose.Types.ObjectId,\n tournamentId: mongoose.Types.ObjectId\n ): Promise<boolean> {\n return !!(await this.participantModel.exists({ userId, tournamentId }));\n }\n\n async create(input: object): Promise<TournamentParticipantOutputDTO> {\n const doc = await this.participantModel.create(input);\n return doc.toObject() as unknown as TournamentParticipantOutputDTO;\n }\n\n async findByUserAndTournament(\n userId: mongoose.Types.ObjectId,\n tournamentId: mongoose.Types.ObjectId\n ): Promise<TournamentParticipantOutputDTO | null> {\n return this.participantModel.findOne({ userId, tournamentId }).lean() as Promise<TournamentParticipantOutputDTO | null>;\n }\n\n async findByTournament(tournamentId: mongoose.Types.ObjectId): Promise<TournamentParticipantOutputDTO[]> {\n return this.participantModel.find({ tournamentId }).lean() as Promise<TournamentParticipantOutputDTO[]>;\n }\n\n async findByUser(userId: mongoose.Types.ObjectId): Promise<TournamentParticipantOutputDTO | null> {\n return this.participantModel\n .findOne({ userId })\n .sort({ createdAt: -1 })\n .lean() as Promise<TournamentParticipantOutputDTO | null>;\n }\n\n async updateToJoined(\n userId: mongoose.Types.ObjectId,\n tournamentId: mongoose.Types.ObjectId,\n teamId: mongoose.Types.ObjectId\n ): Promise<TournamentParticipantOutputDTO | null> {\n return this.participantModel\n .findOneAndUpdate({ userId, tournamentId }, { $set: { status: 'joined', teamId } }, { new: true })\n .lean() as Promise<TournamentParticipantOutputDTO | null>;\n }\n\n async createIfAbsent(\n userId: mongoose.Types.ObjectId,\n tournamentId: mongoose.Types.ObjectId,\n status: string\n ): Promise<void> {\n await this.participantModel.findOneAndUpdate(\n { userId, tournamentId },\n { $setOnInsert: { userId, tournamentId, predictions: [], status } },\n { upsert: true }\n );\n }\n\n public async findByTournamentWithoutPrediction(\n tournamentId: mongoose.Types.ObjectId,\n teamIds: mongoose.Types.ObjectId[],\n matchId: mongoose.Types.ObjectId\n ): Promise<TournamentParticipantOutputDTO[]> {\n return this.participantModel\n .find({\n tournamentId,\n teamId: { $in: teamIds },\n 'predictions.matchId': { $ne: matchId },\n })\n .lean()\n .exec() as Promise<TournamentParticipantOutputDTO[]>;\n }\n\n public async findByTournamentWithPrediction(\n tournamentId: mongoose.Types.ObjectId,\n matchId: mongoose.Types.ObjectId\n ): Promise<TournamentParticipantOutputDTO[]> {\n return this.participantModel\n .find({\n tournamentId,\n 'predictions.matchId': matchId,\n })\n .lean()\n .exec() as Promise<TournamentParticipantOutputDTO[]>;\n }\n\n}\n\nexport const tournamentParticipantRepository = Container.get(TournamentParticipantRepository);\n"]}
@@ -10,6 +10,7 @@ export declare class ParticipantService {
10
10
  getByUserAndTournament(userId: mongoose.Types.ObjectId, tournamentId: mongoose.Types.ObjectId): Promise<TournamentParticipantOutputDTO>;
11
11
  getAll(tournamentId: mongoose.Types.ObjectId): Promise<TournamentParticipantOutputDTO[]>;
12
12
  getUnpredicted(tournamentId: mongoose.Types.ObjectId, teamIds: mongoose.Types.ObjectId[], matchId: mongoose.Types.ObjectId): Promise<TournamentParticipantOutputDTO[]>;
13
+ getPredicted(tournamentId: mongoose.Types.ObjectId, matchId: mongoose.Types.ObjectId): Promise<TournamentParticipantOutputDTO[]>;
13
14
  }
14
15
  export declare const participantService: ParticipantService;
15
16
  //# sourceMappingURL=participant.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"participant.service.d.ts","sourceRoot":"/","sources":["modules/tournament/participant/participant.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EACH,sBAAsB,EACtB,0BAA0B,EAC1B,8BAA8B,EACjC,MAAM,0BAA0B,CAAC;AAOlC,qBACa,kBAAkB;IAC3B,OAAO,CAAC,UAAU,CAAkC;IACpD,OAAO,CAAC,eAAe,CAA4B;;IAOnD,OAAO,CAAC,gBAAgB;IAKX,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,8BAA8B,CAAC;IAuB7G,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC;IAO3F,sBAAsB,CAC/B,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAC/B,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GACtC,OAAO,CAAC,8BAA8B,CAAC;IAM7B,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,8BAA8B,EAAE,CAAC;IAMx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C,KAAK,CAAC,QAAQ,GACjC,OAAO,CAAC,8BAA8B,EAAE,CAAC;IAM/B,YAAY,CACrB,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EACrC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GACjC,OAAO,CAAC,8BAA8B,EAAE,CAAC;CAM/C;AAED,eAAO,MAAM,kBAAkB,oBAAoC,CAAC"}
@@ -105,6 +105,12 @@ let ParticipantService = class ParticipantService {
105
105
  throw (0, error_common_1.notFoundError)('Tournament not found');
106
106
  return this.repository.findByTournamentWithoutPrediction(tournamentId, teamIds, matchId);
107
107
  }
108
+ async getPredicted(tournamentId, matchId) {
109
+ const tournament = await this.matchRepository.findById(tournamentId);
110
+ if (!tournament)
111
+ throw (0, error_common_1.notFoundError)('Tournament not found');
112
+ return this.repository.findByTournamentWithPrediction(tournamentId, matchId);
113
+ }
108
114
  };
109
115
  exports.ParticipantService = ParticipantService;
110
116
  exports.ParticipantService = ParticipantService = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"participant.service.js","sourceRoot":"/","sources":["modules/tournament/participant/participant.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0C;AAC1C,yCAAuC;AAEvC,4EAAwG;AACxG,qEAAyE;AAMzE,gEAAoE;AAEpE,0DAAyD;AACzD,+DAAyD;AACzD,4DAA8E;AAGvE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACnB,UAAU,CAAkC;IAC5C,eAAe,CAA4B;IAEnD;QACI,IAAI,CAAC,UAAU,GAAG,gBAAS,CAAC,GAAG,CAAC,wDAA+B,CAAC,CAAC;QACjE,IAAI,CAAC,eAAe,GAAG,gBAAS,CAAC,GAAG,CAAC,4CAAyB,CAAC,CAAC;IACpE,CAAC;IAEO,gBAAgB,CAAC,UAA0B,EAAE,MAA+B;QAChF,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAA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UAAU,CAAC,iCAAiC,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7F,CAAC;CAEJ,CAAA;AArEY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,gBAAO,GAAE;;GACG,kBAAkB,CAqE9B;AAEY,QAAA,kBAAkB,GAAG,gBAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import Container, {Service} from 'typedi';\nimport {TRPCError} from '@trpc/server';\nimport {mongoose} from '@typegoose/typegoose';\nimport {badRequestError, conflictError, notFoundError} from '@lyxa.ai/core/dist/utilities/error-common';\nimport {TournamentParticipantRepository} from './participant.repository';\nimport {\n JoinTournamentInputDTO,\n MarkSeenTournamentInputDTO,\n TournamentParticipantOutputDTO,\n} from './participant.validation';\nimport {TournamentMatchRepository} from '../match/match.repository';\nimport {Tournament as TournamentType} from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport {ensureCampaignActive} from '../tournament.utils';\nimport {ParticipantBuilder} from './participant.builder';\nimport {TournamentParticipantStatus} from '@lyxa.ai/core/dist/utilities/enum';\n\n@Service()\nexport class ParticipantService {\n private repository: TournamentParticipantRepository;\n private matchRepository: TournamentMatchRepository;\n\n constructor() {\n this.repository = Container.get(TournamentParticipantRepository);\n this.matchRepository = Container.get(TournamentMatchRepository);\n }\n\n private ensureTeamExists(tournament: TournamentType, teamId: mongoose.Types.ObjectId) {\n const exists = tournament.teams.some(team => team._id.toString() === teamId.toString());\n if (!exists) throw badRequestError('Selected team does not exist in this tournament');\n }\n\n public async join(userId: mongoose.Types.ObjectId, input: JoinTournamentInputDTO): Promise<TournamentParticipantOutputDTO> {\n const tournament = await this.matchRepository.findById(input.tournamentId);\n if (!tournament) throw notFoundError('Tournament not found');\n\n ensureCampaignActive(tournament);\n this.ensureTeamExists(tournament, input.teamId);\n\n const existing = await this.repository.findByUserAndTournament(userId, input.tournamentId);\n if (existing?.status === TournamentParticipantStatus.JOINED) throw conflictError('You have already joined this tournament');\n\n if (existing) {\n const updated = await this.repository.updateToJoined(userId, input.tournamentId, input.teamId);\n if (!updated) throw new TRPCError({code: 'INTERNAL_SERVER_ERROR', message: 'Failed to join tournament'});\n return updated;\n }\n\n const result = await this.repository.create(\n ParticipantBuilder.buildNewParticipant(userId, input.tournamentId, input.teamId)\n );\n\n return result;\n }\n\n public async markSeen(userId: mongoose.Types.ObjectId, input: MarkSeenTournamentInputDTO): Promise<void> {\n const exists = await this.matchRepository.findById(input.tournamentId);\n if (!exists) throw notFoundError('Tournament not found');\n\n await this.repository.createIfAbsent(userId, input.tournamentId, TournamentParticipantStatus.SEEN);\n }\n\n public async getByUserAndTournament(\n userId: mongoose.Types.ObjectId,\n tournamentId: mongoose.Types.ObjectId\n ): Promise<TournamentParticipantOutputDTO> {\n const participant = await this.repository.findByUserAndTournament(userId, tournamentId);\n if (!participant) throw notFoundError('You have not joined this tournament');\n return participant;\n }\n\n public async getAll(tournamentId: mongoose.Types.ObjectId): Promise<TournamentParticipantOutputDTO[]> {\n const tournament = await this.matchRepository.findById(tournamentId);\n if (!tournament) throw notFoundError('Tournament not found');\n return this.repository.findByTournament(tournamentId);\n }\n\n public async getUnpredicted(\n tournamentId: mongoose.Types.ObjectId,\n teamIds: mongoose.Types.ObjectId[],\n matchId: mongoose.Types.ObjectId\n ): Promise<TournamentParticipantOutputDTO[]> {\n const tournament = await this.matchRepository.findById(tournamentId);\n if (!tournament) throw notFoundError('Tournament not found');\n return this.repository.findByTournamentWithoutPrediction(tournamentId, teamIds, matchId);\n }\n\n}\n\nexport const participantService = Container.get(ParticipantService);\n"]}
1
+ {"version":3,"file":"participant.service.js","sourceRoot":"/","sources":["modules/tournament/participant/participant.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0C;AAC1C,yCAAuC;AAEvC,4EAAwG;AACxG,qEAAyE;AAMzE,gEAAoE;AAEpE,0DAAyD;AACzD,+DAAyD;AACzD,4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CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC1D,CAAC;IAEM,KAAK,CAAC,cAAc,CACvB,YAAqC,EACrC,OAAkC,EAClC,OAAgC;QAEhC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QACrE,IAAI,CAAC,UAAU;YAAE,MAAM,IAAA,4BAAa,EAAC,sBAAsB,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC,UAAU,CAAC,iCAAiC,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7F,CAAC;IAEM,KAAK,CAAC,YAAY,CACrB,YAAqC,EACrC,OAAgC;QAEhC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QACrE,IAAI,CAAC,UAAU;YAAE,MAAM,IAAA,4BAAa,EAAC,sBAAsB,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC,UAAU,CAAC,8BAA8B,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACjF,CAAC;CAEJ,CAAA;AA9EY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,gBAAO,GAAE;;GACG,kBAAkB,CA8E9B;AAEY,QAAA,kBAAkB,GAAG,gBAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import Container, {Service} from 'typedi';\nimport {TRPCError} from '@trpc/server';\nimport {mongoose} from '@typegoose/typegoose';\nimport {badRequestError, conflictError, notFoundError} from '@lyxa.ai/core/dist/utilities/error-common';\nimport {TournamentParticipantRepository} from './participant.repository';\nimport {\n JoinTournamentInputDTO,\n MarkSeenTournamentInputDTO,\n TournamentParticipantOutputDTO,\n} from './participant.validation';\nimport {TournamentMatchRepository} from '../match/match.repository';\nimport {Tournament as TournamentType} from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport {ensureCampaignActive} from '../tournament.utils';\nimport {ParticipantBuilder} from './participant.builder';\nimport {TournamentParticipantStatus} from '@lyxa.ai/core/dist/utilities/enum';\n\n@Service()\nexport class ParticipantService {\n private repository: TournamentParticipantRepository;\n private matchRepository: TournamentMatchRepository;\n\n constructor() {\n this.repository = Container.get(TournamentParticipantRepository);\n this.matchRepository = Container.get(TournamentMatchRepository);\n }\n\n private ensureTeamExists(tournament: TournamentType, teamId: mongoose.Types.ObjectId) {\n const exists = tournament.teams.some(team => team._id.toString() === teamId.toString());\n if (!exists) throw badRequestError('Selected team does not exist in this tournament');\n }\n\n public async join(userId: mongoose.Types.ObjectId, input: JoinTournamentInputDTO): Promise<TournamentParticipantOutputDTO> {\n const tournament = await this.matchRepository.findById(input.tournamentId);\n if (!tournament) throw notFoundError('Tournament not found');\n\n ensureCampaignActive(tournament);\n this.ensureTeamExists(tournament, input.teamId);\n\n const existing = await this.repository.findByUserAndTournament(userId, input.tournamentId);\n if (existing?.status === TournamentParticipantStatus.JOINED) throw conflictError('You have already joined this tournament');\n\n if (existing) {\n const updated = await this.repository.updateToJoined(userId, input.tournamentId, input.teamId);\n if (!updated) throw new TRPCError({code: 'INTERNAL_SERVER_ERROR', message: 'Failed to join tournament'});\n return updated;\n }\n\n const result = await this.repository.create(\n ParticipantBuilder.buildNewParticipant(userId, input.tournamentId, input.teamId)\n );\n\n return result;\n }\n\n public async markSeen(userId: mongoose.Types.ObjectId, input: MarkSeenTournamentInputDTO): Promise<void> {\n const exists = await this.matchRepository.findById(input.tournamentId);\n if (!exists) throw notFoundError('Tournament not found');\n\n await this.repository.createIfAbsent(userId, input.tournamentId, TournamentParticipantStatus.SEEN);\n }\n\n public async getByUserAndTournament(\n userId: mongoose.Types.ObjectId,\n tournamentId: mongoose.Types.ObjectId\n ): Promise<TournamentParticipantOutputDTO> {\n const participant = await this.repository.findByUserAndTournament(userId, tournamentId);\n if (!participant) throw notFoundError('You have not joined this tournament');\n return participant;\n }\n\n public async getAll(tournamentId: mongoose.Types.ObjectId): Promise<TournamentParticipantOutputDTO[]> {\n const tournament = await this.matchRepository.findById(tournamentId);\n if (!tournament) throw notFoundError('Tournament not found');\n return this.repository.findByTournament(tournamentId);\n }\n\n public async getUnpredicted(\n tournamentId: mongoose.Types.ObjectId,\n teamIds: mongoose.Types.ObjectId[],\n matchId: mongoose.Types.ObjectId\n ): Promise<TournamentParticipantOutputDTO[]> {\n const tournament = await this.matchRepository.findById(tournamentId);\n if (!tournament) throw notFoundError('Tournament not found');\n return this.repository.findByTournamentWithoutPrediction(tournamentId, teamIds, matchId);\n }\n\n public async getPredicted(\n tournamentId: mongoose.Types.ObjectId,\n matchId: mongoose.Types.ObjectId\n ): Promise<TournamentParticipantOutputDTO[]> {\n const tournament = await this.matchRepository.findById(tournamentId);\n if (!tournament) throw notFoundError('Tournament not found');\n return this.repository.findByTournamentWithPrediction(tournamentId, matchId);\n }\n\n}\n\nexport const participantService = Container.get(ParticipantService);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"reward.builder.d.ts","sourceRoot":"/","sources":["modules/tournament/reward/reward.builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAC,kBAAkB,EAAE,mBAAmB,EAAE,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAEtF,OAAO,EAAC,6BAA6B,EAAC,MAAM,+DAA+D,CAAC;AAe5G,qBAAa,aAAa;IACtB,MAAM,CAAC,wBAAwB,CAC3B,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAChC,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EACrC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,EACpC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,kBAAkB,GAC3B,aAAa;IAUhB,MAAM,CAAC,gBAAgB,CACnB,OAAO,EAAE,mBAAmB,EAC5B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAG,GACnC,6BAA6B;IAWhC,OAAO,CAAC,MAAM,CAAC,kBAAkB;CAqBpC"}
1
+ {"version":3,"file":"reward.builder.d.ts","sourceRoot":"/","sources":["modules/tournament/reward/reward.builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAC,kBAAkB,EAAE,mBAAmB,EAAE,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAEtF,OAAO,EAAC,6BAA6B,EAAC,MAAM,+DAA+D,CAAC;AAc5G,qBAAa,aAAa;IACtB,MAAM,CAAC,wBAAwB,CAC3B,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAChC,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EACrC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,EACpC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,kBAAkB,GAC3B,aAAa;IAUhB,MAAM,CAAC,gBAAgB,CACnB,OAAO,EAAE,mBAAmB,EAC5B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAG,GACnC,6BAA6B;IAWhC,OAAO,CAAC,MAAM,CAAC,kBAAkB;CAsBpC"}
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RewardBuilder = void 0;
4
4
  const enum_1 = require("@lyxa.ai/core/dist/utilities/enum");
5
5
  const tournament_utils_1 = require("../tournament.utils");
6
- const FWC_MIN_ORDER_VALUE = 5;
7
6
  const FWC_ORDER_LIMIT_PER_USER = 1;
8
7
  const FWC_COUPON_DURATION_MONTHS = 1;
9
8
  const FWC_ELIGIBLE_ITEM_TYPES = [
@@ -44,14 +43,15 @@ class RewardBuilder {
44
43
  valueType: enum_1.ValueType.PERCENTAGE,
45
44
  value: config.percentage,
46
45
  maxDiscountLimit: config.maxDiscountPerOrder,
46
+ isMaxDiscountLimitEnabled: true,
47
47
  couponNamePrefix: config.couponNamePrefix,
48
48
  duration: { start: now, end: expiresAt },
49
49
  isSpendLimitEnabled: false,
50
50
  spendLimit: null,
51
51
  isOrderLimitPerUserEnabled: true,
52
52
  orderLimitPerUser: FWC_ORDER_LIMIT_PER_USER,
53
- isMinOrderValueEnabled: true,
54
- minOrderValue: FWC_MIN_ORDER_VALUE,
53
+ isMinOrderValueEnabled: false,
54
+ minOrderValue: 0,
55
55
  itemTypes: FWC_ELIGIBLE_ITEM_TYPES,
56
56
  };
57
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"reward.builder.js","sourceRoot":"/","sources":["modules/tournament/reward/reward.builder.ts"],"names":[],"mappings":";;;AACA,4DAAkF;AAElF,0DAA2C;AAG3C,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,wBAAwB,GAAG,CAAC,CAAC;AACnC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AACrC,MAAM,uBAAuB,GAAe;IACxC,eAAQ,CAAC,IAAI;IACb,eAAQ,CAAC,OAAO;IAChB,eAAQ,CAAC,QAAQ;IACjB,eAAQ,CAAC,MAAM;IACf,eAAQ,CAAC,MAAM;IACf,eAAQ,CAAC,GAAG;IACZ,eAAQ,CAAC,cAAc;CAC1B,CAAC;AAEF,MAAa,aAAa;IACtB,MAAM,CAAC,wBAAwB,CAC3B,OAAgC,EAChC,YAAqC,EACrC,SAAoC,EACpC,WAAmB,EACnB,MAA0B;QAE1B,OAAO;YACH,OAAO,EAAE,SAAS;YAClB,YAAY;YACZ,OAAO;YACP,WAAW;YACX,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAC,MAAM,CAAC;SACpD,CAAC;IACN,CAAC;IAED,MAAM,CAAC,gBAAgB,CACnB,OAA4B,EAC5B,IAAY,EACZ,MAAkC;QAElC,MAAM,EAAC,gBAAgB,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAC,GAAG,OAAO,CAAC;QACtD,OAAO;YACH,GAAG,IAAI;YACP,IAAI;YACJ,KAAK,EAAE,MAAM;YACb,KAAK,EAAE,EAAE;YACT,OAAO,EAAE,EAAE;SAC8B,CAAC;IAClD,CAAC;IAEO,MAAM,CAAC,kBAAkB,CAAC,MAA0B;QACxD,MAAM,GAAG,GAAG,IAAA,yBAAM,GAAE,CAAC;QACrB,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;QAChC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,GAAG,0BAA0B,CAAC,CAAC;QAEtE,OAAO;YACH,UAAU,EAAE,iBAAU,CAAC,eAAe;YACtC,SAAS,EAAE,gBAAS,CAAC,UAAU;YAC/B,KAAK,EAAE,MAAM,CAAC,UAAU;YACxB,gBAAgB,EAAE,MAAM,CAAC,mBAAmB;YAC5C,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;YACzC,QAAQ,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAC;YACtC,mBAAmB,EAAE,KAAK;YAC1B,UAAU,EAAE,IAAI;YAChB,0BAA0B,EAAE,IAAI;YAChC,iBAAiB,EAAE,wBAAwB;YAC3C,sBAAsB,EAAE,IAAI;YAC5B,aAAa,EAAE,mBAAmB;YAClC,SAAS,EAAE,uBAAuB;SACrC,CAAC;IACN,CAAC;CACJ;AArDD,sCAqDC","sourcesContent":["import {mongoose} from '@typegoose/typegoose';\nimport {CouponType, ItemType, ValueType} from '@lyxa.ai/core/dist/utilities/enum';\nimport {CouponRewardConfig, CouponRewardPayload, RewardContext} from './reward.types';\nimport {utcNow} from '../tournament.utils';\nimport {CreateIndividualUserCouponDTO} from '@modules/coupon/validations/individual-user-coupon.validation';\n\nconst FWC_MIN_ORDER_VALUE = 5;\nconst FWC_ORDER_LIMIT_PER_USER = 1;\nconst FWC_COUPON_DURATION_MONTHS = 1;\nconst FWC_ELIGIBLE_ITEM_TYPES: ItemType[] = [\n ItemType.FOOD,\n ItemType.GROCERY,\n ItemType.PHARMACY,\n ItemType.COFFEE,\n ItemType.FLOWER,\n ItemType.PET,\n ItemType.HEALTHY_CORNER,\n];\n\nexport class RewardBuilder {\n static buildCouponRewardContext(\n matchId: mongoose.Types.ObjectId,\n tournamentId: mongoose.Types.ObjectId,\n winnerIds: mongoose.Types.ObjectId[],\n matchNumber: number,\n config: CouponRewardConfig\n ): RewardContext {\n return {\n userIds: winnerIds,\n tournamentId,\n matchId,\n matchNumber,\n payload: RewardBuilder.buildCouponPayload(config),\n };\n }\n\n static buildCouponInput(\n payload: CouponRewardPayload,\n code: string,\n userId: mongoose.Types.ObjectId []\n ): CreateIndividualUserCouponDTO {\n const {couponNamePrefix: _ignored, ...rest} = payload;\n return {\n ...rest,\n code,\n users: userId,\n shops: [],\n vendors: [],\n } as unknown as CreateIndividualUserCouponDTO;\n }\n\n private static buildCouponPayload(config: CouponRewardConfig): CouponRewardPayload {\n const now = utcNow();\n const expiresAt = new Date(now);\n expiresAt.setMonth(expiresAt.getMonth() + FWC_COUPON_DURATION_MONTHS);\n\n return {\n couponType: CouponType.INDIVIDUAL_USER,\n valueType: ValueType.PERCENTAGE,\n value: config.percentage,\n maxDiscountLimit: config.maxDiscountPerOrder,\n couponNamePrefix: config.couponNamePrefix,\n duration: {start: now, end: expiresAt},\n isSpendLimitEnabled: false,\n spendLimit: null,\n isOrderLimitPerUserEnabled: true,\n orderLimitPerUser: FWC_ORDER_LIMIT_PER_USER,\n isMinOrderValueEnabled: true,\n minOrderValue: FWC_MIN_ORDER_VALUE,\n itemTypes: FWC_ELIGIBLE_ITEM_TYPES,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"reward.builder.js","sourceRoot":"/","sources":["modules/tournament/reward/reward.builder.ts"],"names":[],"mappings":";;;AACA,4DAAkF;AAElF,0DAA2C;AAG3C,MAAM,wBAAwB,GAAG,CAAC,CAAC;AACnC,MAAM,0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M,CAAC,gBAAgB;YACzC,QAAQ,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAC;YACtC,mBAAmB,EAAE,KAAK;YAC1B,UAAU,EAAE,IAAI;YAChB,0BAA0B,EAAE,IAAI;YAChC,iBAAiB,EAAE,wBAAwB;YAC3C,sBAAsB,EAAE,KAAK;YAC7B,aAAa,EAAE,CAAC;YAChB,SAAS,EAAE,uBAAuB;SACrC,CAAC;IACN,CAAC;CACJ;AAtDD,sCAsDC","sourcesContent":["import {mongoose} from '@typegoose/typegoose';\nimport {CouponType, ItemType, ValueType} from '@lyxa.ai/core/dist/utilities/enum';\nimport {CouponRewardConfig, CouponRewardPayload, RewardContext} from './reward.types';\nimport {utcNow} from '../tournament.utils';\nimport {CreateIndividualUserCouponDTO} from '@modules/coupon/validations/individual-user-coupon.validation';\n\nconst FWC_ORDER_LIMIT_PER_USER = 1;\nconst FWC_COUPON_DURATION_MONTHS = 1;\nconst FWC_ELIGIBLE_ITEM_TYPES: ItemType[] = [\n ItemType.FOOD,\n ItemType.GROCERY,\n ItemType.PHARMACY,\n ItemType.COFFEE,\n ItemType.FLOWER,\n ItemType.PET,\n ItemType.HEALTHY_CORNER,\n];\n\nexport class RewardBuilder {\n static buildCouponRewardContext(\n matchId: mongoose.Types.ObjectId,\n tournamentId: mongoose.Types.ObjectId,\n winnerIds: mongoose.Types.ObjectId[],\n matchNumber: number,\n config: CouponRewardConfig\n ): RewardContext {\n return {\n userIds: winnerIds,\n tournamentId,\n matchId,\n matchNumber,\n payload: RewardBuilder.buildCouponPayload(config),\n };\n }\n\n static buildCouponInput(\n payload: CouponRewardPayload,\n code: string,\n userId: mongoose.Types.ObjectId []\n ): CreateIndividualUserCouponDTO {\n const {couponNamePrefix: _ignored, ...rest} = payload;\n return {\n ...rest,\n code,\n users: userId,\n shops: [],\n vendors: [],\n } as unknown as CreateIndividualUserCouponDTO;\n }\n\n private static buildCouponPayload(config: CouponRewardConfig): CouponRewardPayload {\n const now = utcNow();\n const expiresAt = new Date(now);\n expiresAt.setMonth(expiresAt.getMonth() + FWC_COUPON_DURATION_MONTHS);\n\n return {\n couponType: CouponType.INDIVIDUAL_USER,\n valueType: ValueType.PERCENTAGE,\n value: config.percentage,\n maxDiscountLimit: config.maxDiscountPerOrder,\n isMaxDiscountLimitEnabled: true,\n couponNamePrefix: config.couponNamePrefix,\n duration: {start: now, end: expiresAt},\n isSpendLimitEnabled: false,\n spendLimit: null,\n isOrderLimitPerUserEnabled: true,\n orderLimitPerUser: FWC_ORDER_LIMIT_PER_USER,\n isMinOrderValueEnabled: false,\n minOrderValue: 0,\n itemTypes: FWC_ELIGIBLE_ITEM_TYPES,\n };\n }\n}\n"]}
@@ -26,6 +26,7 @@ export interface CouponRewardPayload {
26
26
  isMinOrderValueEnabled: boolean;
27
27
  minOrderValue: number;
28
28
  itemTypes: ItemType[];
29
+ isMaxDiscountLimitEnabled: boolean;
29
30
  }
30
31
  export type CouponRewardResult = {
31
32
  code: string;
@@ -1 +1 @@
1
- {"version":3,"file":"reward.types.d.ts","sourceRoot":"/","sources":["modules/tournament/reward/reward.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAElF,oBAAY,UAAU;IAClB,MAAM,WAAW;CACpB;AAED,MAAM,WAAW,kBAAkB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACjC,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAAE,IAAI,CAAC;CACb;AAED,MAAM,WAAW,mBAAmB;IAChC,UAAU,EAAE,UAAU,CAAC,eAAe,CAAC;IACvC,SAAS,EAAE,SAAS,CAAC,UAAU,CAAC;IAChC,KAAK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["modules/tournament/reward/reward.types.ts"],"names":[],"mappings":";;;AAGA,IAAY,UAEX;AAFD,WAAY,UAAU;IAClB,+BAAiB,CAAA;AACrB,CAAC,EAFW,UAAU,0BAAV,UAAU,QAErB","sourcesContent":["import {mongoose} from '@typegoose/typegoose';\nimport {CouponType, ItemType, ValueType} from '@lyxa.ai/core/dist/utilities/enum';\n\nexport enum RewardType {\n COUPON = 'coupon',\n}\n\nexport interface CouponRewardConfig {\n percentage: number;\n maxDiscountPerOrder: number;\n couponNamePrefix: string;\n}\n\nexport interface CouponRewardDuration {\n start: Date;\n end: Date;\n}\n\nexport interface CouponRewardPayload {\n couponType: CouponType.INDIVIDUAL_USER;\n valueType: ValueType.PERCENTAGE;\n value: number;\n maxDiscountLimit: number;\n couponNamePrefix: string;\n duration: CouponRewardDuration;\n isSpendLimitEnabled: boolean;\n spendLimit: number | null;\n isOrderLimitPerUserEnabled: boolean;\n orderLimitPerUser: number;\n isMinOrderValueEnabled: boolean;\n minOrderValue: number;\n itemTypes: ItemType[];\n}\n\nexport type CouponRewardResult = {\n code: string;\n duration: CouponRewardDuration;\n couponOfferLabel: string;\n couponValidityLabel: string;\n _id: mongoose.Types.ObjectId;\n};\n\nexport interface RewardContext<P = CouponRewardPayload> {\n userIds: mongoose.Types.ObjectId[];\n tournamentId: mongoose.Types.ObjectId;\n matchId: mongoose.Types.ObjectId;\n matchNumber: number;\n payload: P;\n}\n"]}
1
+ {"version":3,"file":"reward.types.js","sourceRoot":"/","sources":["modules/tournament/reward/reward.types.ts"],"names":[],"mappings":";;;AAGA,IAAY,UAEX;AAFD,WAAY,UAAU;IAClB,+BAAiB,CAAA;AACrB,CAAC,EAFW,UAAU,0BAAV,UAAU,QAErB","sourcesContent":["import {mongoose} from '@typegoose/typegoose';\nimport {CouponType, ItemType, ValueType} from '@lyxa.ai/core/dist/utilities/enum';\n\nexport enum RewardType {\n COUPON = 'coupon',\n}\n\nexport interface CouponRewardConfig {\n percentage: number;\n maxDiscountPerOrder: number;\n couponNamePrefix: string;\n}\n\nexport interface CouponRewardDuration {\n start: Date;\n end: Date;\n}\n\nexport interface CouponRewardPayload {\n couponType: CouponType.INDIVIDUAL_USER;\n valueType: ValueType.PERCENTAGE;\n value: number;\n maxDiscountLimit: number;\n couponNamePrefix: string;\n duration: CouponRewardDuration;\n isSpendLimitEnabled: boolean;\n spendLimit: number | null;\n isOrderLimitPerUserEnabled: boolean;\n orderLimitPerUser: number;\n isMinOrderValueEnabled: boolean;\n minOrderValue: number;\n itemTypes: ItemType[];\n isMaxDiscountLimitEnabled: boolean\n}\n\nexport type CouponRewardResult = {\n code: string;\n duration: CouponRewardDuration;\n couponOfferLabel: string;\n couponValidityLabel: string;\n _id: mongoose.Types.ObjectId;\n};\n\nexport interface RewardContext<P = CouponRewardPayload> {\n userIds: mongoose.Types.ObjectId[];\n tournamentId: mongoose.Types.ObjectId;\n matchId: mongoose.Types.ObjectId;\n matchNumber: number;\n payload: P;\n}\n"]}
@@ -7,7 +7,14 @@ export declare class ScheduleService {
7
7
  private userModel;
8
8
  constructor();
9
9
  private dispatchTournamentActivationNotification;
10
+ private static readonly REMINDER_TYPES;
10
11
  dispatchPending(): Promise<void>;
12
+ private dispatchDueReminders;
13
+ private dispatchReminder;
14
+ private isDue;
15
+ private alreadySent;
16
+ private canSendNow;
17
+ private isCompanyOpen;
11
18
  }
12
19
  export declare const scheduleDispatchService: ScheduleService;
13
20
  //# sourceMappingURL=schedule.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schedule.service.d.ts","sourceRoot":"/","sources":["modules/tournament/schedule/schedule.service.ts"],"names":[],"mappings":"AAYA,qBACa,eAAe;IAC3B,OAAO,CAAC,gBAAgB,CAA6B;IACrD,OAAO,CAAC,eAAe,CAA4B;IACnD,OAAO,CAAC,qBAAqB,CAAkC;IAC/D,OAAO,CAAC,kBAAkB,CAAiC;IAC3D,OAAO,CAAC,mBAAmB,CAAgC;IAC3D,OAAO,CAAC,SAAS,CAA2C;;YA0D9C,wCAAwC;IAuBzC,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;CA4C7C;AAED,eAAO,MAAM,uBAAuB,iBAAiC,CAAC"}
1
+ {"version":3,"file":"schedule.service.d.ts","sourceRoot":"/","sources":["modules/tournament/schedule/schedule.service.ts"],"names":[],"mappings":"AAoBA,qBACa,eAAe;IAC3B,OAAO,CAAC,gBAAgB,CAA6B;IACrD,OAAO,CAAC,eAAe,CAA4B;IACnD,OAAO,CAAC,qBAAqB,CAAkC;IAC/D,OAAO,CAAC,kBAAkB,CAAiC;IAC3D,OAAO,CAAC,mBAAmB,CAAgC;IAC3D,OAAO,CAAC,SAAS,CAA2C;;YA0D9C,wCAAwC;IAuBtD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAInC;IAEU,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;YAU/B,oBAAoB;YAapB,gBAAgB;IAuB9B,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,WAAW;YAOL,UAAU;YAKV,aAAa;CAM3B;AAED,eAAO,MAAM,uBAAuB,iBAAiC,CAAC"}
@@ -41,17 +41,21 @@ var __importStar = (this && this.__importStar) || (function () {
41
41
  var __metadata = (this && this.__metadata) || function (k, v) {
42
42
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
43
43
  };
44
+ var ScheduleService_1;
44
45
  Object.defineProperty(exports, "__esModule", { value: true });
45
46
  exports.scheduleDispatchService = exports.ScheduleService = void 0;
46
47
  const typedi_1 = __importStar(require("typedi"));
48
+ const core_1 = require("@lyxa.ai/core");
47
49
  const models_1 = require("@lyxa.ai/core/dist/libraries/mongo/models");
48
50
  const enum_1 = require("@lyxa.ai/core/dist/utilities/enum");
51
+ const workHourSetting_1 = require("@lyxa.ai/core/dist/utilities/workHourSetting");
49
52
  const config_repository_1 = require("../config/config.repository");
50
53
  const match_repository_1 = require("../match/match.repository");
51
54
  const participant_repository_1 = require("../participant/participant.repository");
52
55
  const notification_template_repository_1 = require("../notification/notification-template.repository");
53
56
  const notification_service_1 = require("../notification/notification.service");
54
57
  let ScheduleService = class ScheduleService {
58
+ static { ScheduleService_1 = this; }
55
59
  configRepository;
56
60
  matchRepository;
57
61
  participantRepository;
@@ -82,33 +86,62 @@ let ScheduleService = class ScheduleService {
82
86
  });
83
87
  await this.configRepository.setNotificationFlag(tournament._id, enum_1.TournamentNotificationTag.TOURNAMENT_ACTIVATION);
84
88
  }
89
+ static REMINDER_TYPES = new Set([
90
+ enum_1.TournamentNotificationTag.PREDICTION_REMINDER_15_MINUTES,
91
+ enum_1.TournamentNotificationTag.PREDICTION_REMINDER_3_HOURS,
92
+ enum_1.TournamentNotificationTag.PREDICTION_REMINDER_1_HOUR,
93
+ ]);
85
94
  async dispatchPending() {
86
95
  const tournament = await this.configRepository.findActiveFull();
87
96
  if (!tournament)
88
97
  return;
89
- const tournamentId = tournament._id;
90
- const templates = await this.templateRepository.findTemplates(tournamentId);
91
- const now = Date.now();
98
+ const templates = await this.templateRepository.findTemplates(tournament._id);
92
99
  await this.dispatchTournamentActivationNotification(tournament, templates);
93
- await Promise.all(tournament.matches.map(match => Promise.all(tournament.scheduledNotifications.map(async ({ type, durationMins, target }) => {
94
- if (![
95
- enum_1.TournamentNotificationTag.PREDICTION_REMINDER_15_MINUTES,
96
- enum_1.TournamentNotificationTag.PREDICTION_REMINDER_3_HOURS,
97
- ].includes(type))
98
- return;
99
- const notificationTime = new Date(match.startingDate).getTime() - durationMins * 60 * 1000;
100
- const flags = match.notificationFlags;
101
- if (now < notificationTime)
102
- return;
103
- if (flags?.[type] === true)
104
- return;
105
- await this.notificationService.dispatchScheduledJob(type, target, templates, tournamentId, [match.team1.teamId, match.team2.teamId], match._id, match.startingDate, tournament.deepLinkRoute);
106
- await this.matchRepository.setNotificationFlag(tournamentId, match._id, type);
107
- }))));
100
+ await this.dispatchDueReminders(tournament, templates);
101
+ }
102
+ async dispatchDueReminders(tournament, templates) {
103
+ await Promise.all(tournament.matches.flatMap(match => tournament.scheduledNotifications.map(scheduled => this.dispatchReminder(tournament, match, scheduled, templates))));
104
+ }
105
+ async dispatchReminder(tournament, match, scheduled, templates) {
106
+ const { type, target, durationMins } = scheduled;
107
+ if (!ScheduleService_1.REMINDER_TYPES.has(type))
108
+ return;
109
+ if (this.alreadySent(match, type))
110
+ return;
111
+ if (!this.isDue(match, durationMins))
112
+ return;
113
+ if (await this.canSendNow(type))
114
+ await this.notificationService.dispatchScheduledReminder({
115
+ tournament,
116
+ match,
117
+ templates,
118
+ type,
119
+ target
120
+ });
121
+ await this.matchRepository.setNotificationFlag(tournament._id, match._id, type);
122
+ }
123
+ isDue(match, durationMins) {
124
+ const notificationTime = new Date(match.startingDate).getTime() - durationMins * 60 * 1000;
125
+ return Date.now() >= notificationTime;
126
+ }
127
+ alreadySent(match, type) {
128
+ const flags = match.notificationFlags;
129
+ return flags?.[type] === true;
130
+ }
131
+ async canSendNow(type) {
132
+ if (type !== enum_1.TournamentNotificationTag.PREDICTION_REMINDER_1_HOUR)
133
+ return true;
134
+ return this.isCompanyOpen();
135
+ }
136
+ async isCompanyOpen() {
137
+ const settings = (await (0, core_1.getLibraries)().getCachedSettingsService().getSettings());
138
+ if (!settings?.workHourSetting)
139
+ return false;
140
+ return (0, workHourSetting_1.isLyxaOpen)(settings.workHourSetting);
108
141
  }
109
142
  };
110
143
  exports.ScheduleService = ScheduleService;
111
- exports.ScheduleService = ScheduleService = __decorate([
144
+ exports.ScheduleService = ScheduleService = ScheduleService_1 = __decorate([
112
145
  (0, typedi_1.Service)(),
113
146
  __metadata("design:paramtypes", [])
114
147
  ], ScheduleService);
@@ -1 +1 @@
1
- {"version":3,"file":"schedule.service.js","sourceRoot":"/","sources":["modules/tournament/schedule/schedule.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAG5C,sEAAiG;AACjG,4DAA8E;AAC9E,mEAAyE;AACzE,gEAAsE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CAAC,KAAK,IAAI;gBAAE,OAAO;YAEnC,MAAM,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,CAClD,IAAI,EACJ,MAAM,EACN,SAAS,EACT,YAAY,EACZ,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EACxC,KAAK,CAAC,GAAG,EACY,KAAK,CAAC,YAAY,EACvC,UAAU,CAAC,aAAa,CACxB,CAAC;YACF,MAAM,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,YAAY,EAAE,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC/E,CAAC,CAAC,CACF,CACD,CACD,CAAC;IACH,CAAC;CACD,CAAA;AAnIY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,gBAAO,GAAE;;GACG,eAAe,CAmI3B;AAEY,QAAA,uBAAuB,GAAG,gBAAS,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { mongoose } from '@typegoose/typegoose';\nimport { SoftDeleteModel } from '@lyxa.ai/core/dist/libraries/mongo/plugins/soft-delete-plugin';\nimport { NotificationMessage, User, UserModel } from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport { TournamentNotificationTag } from '@lyxa.ai/core/dist/utilities/enum';\nimport { TournamentConfigRepository } from '../config/config.repository';\nimport { TournamentMatchRepository } from '../match/match.repository';\nimport { TournamentParticipantRepository } from '../participant/participant.repository';\nimport { NotificationTemplateRepository } from '../notification/notification-template.repository';\nimport { TournamentNotificationService } from '../notification/notification.service';\nimport { TournamentDocument } from '../config/config.types';\n\n@Service()\nexport class ScheduleService {\n\tprivate configRepository: TournamentConfigRepository;\n\tprivate matchRepository: TournamentMatchRepository;\n\tprivate participantRepository: TournamentParticipantRepository;\n\tprivate templateRepository: NotificationTemplateRepository;\n\tprivate notificationService: TournamentNotificationService;\n\tprivate userModel: typeof UserModel & SoftDeleteModel<User>;\n\n\tconstructor() {\n\t\tthis.configRepository = Container.get(TournamentConfigRepository);\n\t\tthis.matchRepository = Container.get(TournamentMatchRepository);\n\t\tthis.participantRepository = Container.get(TournamentParticipantRepository);\n\t\tthis.templateRepository = Container.get(NotificationTemplateRepository);\n\t\tthis.notificationService = Container.get(TournamentNotificationService);\n\t\tthis.userModel = UserModel as typeof UserModel & SoftDeleteModel<User>;\n\t}\n\n\t// NOTE: there is a huge possibility we will not use this feature, left it out in case they want it back\n\t//\n\t// public async dispatchPreTournamentReminders(): Promise<void> {\n\t// \tconst tournaments = await this.configRepository.findPendingReminderTournaments();\n\t// \tif (!tournaments.length) return;\n\t//\n\t// \tawait Promise.all(\n\t// \t\ttournaments.map(async tournament => {\n\t// \t\t\tconst templates = await this.templateRepository.findTemplates(tournament._id);\n\t// \t\t\tconst reminderTemplate = templates.get(TournamentNotificationTag.TEAM_SELECTION_REMINDER_1_DAY);\n\t// \t\t\tif (!reminderTemplate) return;\n\t//\n\t// \t\t\tconst participants = await this.participantRepository.findByTournament(tournament._id);\n\t// \t\t\tconst usersWithTeam = participants\n\t// \t\t\t\t.filter(participant => participant.teamId)\n\t// \t\t\t\t.map(participant => participant.userId);\n\t// \t\t\tconst recipients = await this.userModel\n\t// \t\t\t\t.find({ _id: { $nin: usersWithTeam } })\n\t// \t\t\t\t.select('_id')\n\t// \t\t\t\t.lean();\n\t//\n\t// \t\t\tif (!recipients.length) {\n\t// \t\t\t\tawait this.configRepository.setNotificationFlag(\n\t// \t\t\t\t\ttournament._id,\n\t// \t\t\t\t\tTournamentNotificationTag.TEAM_SELECTION_REMINDER_1_DAY\n\t// \t\t\t\t);\n\t// \t\t\t\treturn;\n\t// \t\t\t}\n\t//\n\t// \t\t\tawait this.notificationService.notifyUsers(\n\t// \t\t\t\t{\n\t// \t\t\t\t\ttitle: reminderTemplate.title,\n\t// \t\t\t\t\tbody: reminderTemplate.body,\n\t// \t\t\t\t\ttournamentNotificationType: TournamentNotificationTag.TEAM_SELECTION_REMINDER_1_DAY,\n\t// \t\t\t\t\ttournamentId: tournament._id.toString(),\n\t// \t\t\t\t\tdeepLinkRoute: tournament.deepLinkRoute,\n\t// \t\t\t\t},\n\t// \t\t\t\trecipients.map(user => user._id as mongoose.Types.ObjectId)\n\t// \t\t\t);\n\t// \t\t\tawait this.configRepository.setNotificationFlag(\n\t// \t\t\t\ttournament._id,\n\t// \t\t\t\tTournamentNotificationTag.TEAM_SELECTION_REMINDER_1_DAY\n\t// \t\t\t);\n\t// \t\t})\n\t// \t);\n\t// }\n\n\tprivate async dispatchTournamentActivationNotification(\n\t\ttournament: TournamentDocument,\n\t\ttemplates: Map<TournamentNotificationTag, NotificationMessage>\n\t): Promise<void> {\n\t\tconst flags = new Map(Object.entries(tournament.notificationFlags || {}) as Array<[TournamentNotificationTag, boolean]>);\n\t\tif (flags.get(TournamentNotificationTag.TOURNAMENT_ACTIVATION) === true) return;\n\n\t\tconst template = templates.get(TournamentNotificationTag.TOURNAMENT_ACTIVATION);\n\t\tif (!template) return;\n\n\t\tawait this.notificationService.notifyGlobal({\n\t\t\ttitle: template.title,\n\t\t\tbody: template.body,\n\t\t\ttournamentNotificationType: TournamentNotificationTag.TOURNAMENT_ACTIVATION,\n\t\t\ttournamentId: tournament._id.toString(),\n\t\t\tdeepLinkRoute: tournament.deepLinkRoute,\n\t\t});\n\t\tawait this.configRepository.setNotificationFlag(\n\t\t\ttournament._id,\n\t\t\tTournamentNotificationTag.TOURNAMENT_ACTIVATION\n\t\t);\n\t}\n\n\tpublic async dispatchPending(): Promise<void> {\n\t\tconst tournament = await this.configRepository.findActiveFull();\n\t\tif (!tournament) return;\n\n\t\tconst tournamentId = tournament._id;\n\t\tconst templates = await this.templateRepository.findTemplates(tournamentId);\n\t\tconst now = Date.now();\n\n\t\tawait this.dispatchTournamentActivationNotification(tournament, templates);\n\n\t\tawait Promise.all(\n\t\t\ttournament.matches.map(match =>\n\t\t\t\tPromise.all(\n\t\t\t\t\ttournament.scheduledNotifications.map(async ({ type, durationMins, target }) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t![\n\t\t\t\t\t\t\t\tTournamentNotificationTag.PREDICTION_REMINDER_15_MINUTES,\n\t\t\t\t\t\t\t\tTournamentNotificationTag.PREDICTION_REMINDER_3_HOURS,\n\t\t\t\t\t\t\t].includes(type)\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\tconst notificationTime = new Date(match.startingDate).getTime() - durationMins * 60 * 1000;\n\t\t\t\t\t\tconst flags = match.notificationFlags as unknown as Record<string, boolean> | undefined;\n\n\t\t\t\t\t\tif (now < notificationTime) return;\n\t\t\t\t\t\tif (flags?.[type] === true) return;\n\n\t\t\t\t\t\tawait this.notificationService.dispatchScheduledJob(\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\ttemplates,\n\t\t\t\t\t\t\ttournamentId,\n\t\t\t\t\t\t\t[match.team1.teamId, match.team2.teamId],\n\t\t\t\t\t\t\tmatch._id,\n match.startingDate,\n\t\t\t\t\t\t\ttournament.deepLinkRoute,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tawait this.matchRepository.setNotificationFlag(tournamentId, match._id, type);\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}\n}\n\nexport const scheduleDispatchService = Container.get(ScheduleService);\n"]}
1
+ {"version":3,"file":"schedule.service.js","sourceRoot":"/","sources":["modules/tournament/schedule/schedule.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0C;AAC1C,wCAA2C;AAE3C,sEAOmD;AACnD,4DAA4E;AAC5E,kFAAwE;AACxE,mEAAuE;AACvE,gEAAoE;AACpE,kFAAsF;AACtF,uGAAgG;AAChG,+EAAmF;AAI5E,IAAM,eAAe,GAArB,MAAM,eAAe;;IACnB,gBAAgB,CAA6B;IAC7C,eAAe,CAA4B;IAC3C,qBAAqB,CA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CAAC;IAC7C,CAAC;;AAjKW,0CAAe;0BAAf,eAAe;IAD3B,IAAA,gBAAO,GAAE;;GACG,eAAe,CAkK3B;AAEY,QAAA,uBAAuB,GAAG,gBAAS,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC","sourcesContent":["import Container, {Service} from 'typedi';\nimport {getLibraries} from '@lyxa.ai/core';\nimport {SoftDeleteModel} from '@lyxa.ai/core/dist/libraries/mongo/plugins/soft-delete-plugin';\nimport {\n\tNotificationMessage,\n\tScheduledNotificationConfig,\n\tSetting,\n\tTournamentMatch,\n\tUser,\n\tUserModel,\n} from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport {TournamentNotificationTag} from '@lyxa.ai/core/dist/utilities/enum';\nimport {isLyxaOpen} from '@lyxa.ai/core/dist/utilities/workHourSetting';\nimport {TournamentConfigRepository} from '../config/config.repository';\nimport {TournamentMatchRepository} from '../match/match.repository';\nimport {TournamentParticipantRepository} from '../participant/participant.repository';\nimport {NotificationTemplateRepository} from '../notification/notification-template.repository';\nimport {TournamentNotificationService} from '../notification/notification.service';\nimport {TournamentDocument} from '../config/config.types';\n\n@Service()\nexport class ScheduleService {\n\tprivate configRepository: TournamentConfigRepository;\n\tprivate matchRepository: TournamentMatchRepository;\n\tprivate participantRepository: TournamentParticipantRepository;\n\tprivate templateRepository: NotificationTemplateRepository;\n\tprivate notificationService: TournamentNotificationService;\n\tprivate userModel: typeof UserModel & SoftDeleteModel<User>;\n\n\tconstructor() {\n\t\tthis.configRepository = Container.get(TournamentConfigRepository);\n\t\tthis.matchRepository = Container.get(TournamentMatchRepository);\n\t\tthis.participantRepository = Container.get(TournamentParticipantRepository);\n\t\tthis.templateRepository = Container.get(NotificationTemplateRepository);\n\t\tthis.notificationService = Container.get(TournamentNotificationService);\n\t\tthis.userModel = UserModel as typeof UserModel & SoftDeleteModel<User>;\n\t}\n\n\t// NOTE: there is a huge possibility we will not use this feature, left it out in case they want it back\n\t//\n\t// public async dispatchPreTournamentReminders(): Promise<void> {\n\t// \tconst tournaments = await this.configRepository.findPendingReminderTournaments();\n\t// \tif (!tournaments.length) return;\n\t//\n\t// \tawait Promise.all(\n\t// \t\ttournaments.map(async tournament => {\n\t// \t\t\tconst templates = await this.templateRepository.findTemplates(tournament._id);\n\t// \t\t\tconst reminderTemplate = templates.get(TournamentNotificationTag.TEAM_SELECTION_REMINDER_1_DAY);\n\t// \t\t\tif (!reminderTemplate) return;\n\t//\n\t// \t\t\tconst participants = await this.participantRepository.findByTournament(tournament._id);\n\t// \t\t\tconst usersWithTeam = participants\n\t// \t\t\t\t.filter(participant => participant.teamId)\n\t// \t\t\t\t.map(participant => participant.userId);\n\t// \t\t\tconst recipients = await this.userModel\n\t// \t\t\t\t.find({ _id: { $nin: usersWithTeam } })\n\t// \t\t\t\t.select('_id')\n\t// \t\t\t\t.lean();\n\t//\n\t// \t\t\tif (!recipients.length) {\n\t// \t\t\t\tawait this.configRepository.setNotificationFlag(\n\t// \t\t\t\t\ttournament._id,\n\t// \t\t\t\t\tTournamentNotificationTag.TEAM_SELECTION_REMINDER_1_DAY\n\t// \t\t\t\t);\n\t// \t\t\t\treturn;\n\t// \t\t\t}\n\t//\n\t// \t\t\tawait this.notificationService.notifyUsers(\n\t// \t\t\t\t{\n\t// \t\t\t\t\ttitle: reminderTemplate.title,\n\t// \t\t\t\t\tbody: reminderTemplate.body,\n\t// \t\t\t\t\ttournamentNotificationType: TournamentNotificationTag.TEAM_SELECTION_REMINDER_1_DAY,\n\t// \t\t\t\t\ttournamentId: tournament._id.toString(),\n\t// \t\t\t\t\tdeepLinkRoute: tournament.deepLinkRoute,\n\t// \t\t\t\t},\n\t// \t\t\t\trecipients.map(user => user._id as mongoose.Types.ObjectId)\n\t// \t\t\t);\n\t// \t\t\tawait this.configRepository.setNotificationFlag(\n\t// \t\t\t\ttournament._id,\n\t// \t\t\t\tTournamentNotificationTag.TEAM_SELECTION_REMINDER_1_DAY\n\t// \t\t\t);\n\t// \t\t})\n\t// \t);\n\t// }\n\n\tprivate async dispatchTournamentActivationNotification(\n\t\ttournament: TournamentDocument,\n\t\ttemplates: Map<TournamentNotificationTag, NotificationMessage>\n\t): Promise<void> {\n\t\tconst flags = new Map(Object.entries(tournament.notificationFlags || {}) as Array<[TournamentNotificationTag, boolean]>);\n\t\tif (flags.get(TournamentNotificationTag.TOURNAMENT_ACTIVATION) === true) return;\n\n\t\tconst template = templates.get(TournamentNotificationTag.TOURNAMENT_ACTIVATION);\n\t\tif (!template) return;\n\n\t\tawait this.notificationService.notifyGlobal({\n\t\t\ttitle: template.title,\n\t\t\tbody: template.body,\n\t\t\ttournamentNotificationType: TournamentNotificationTag.TOURNAMENT_ACTIVATION,\n\t\t\ttournamentId: tournament._id.toString(),\n\t\t\tdeepLinkRoute: tournament.deepLinkRoute,\n\t\t});\n\t\tawait this.configRepository.setNotificationFlag(\n\t\t\ttournament._id,\n\t\t\tTournamentNotificationTag.TOURNAMENT_ACTIVATION\n\t\t);\n\t}\n\n\tprivate static readonly REMINDER_TYPES: ReadonlySet<TournamentNotificationTag> = new Set([\n\t\tTournamentNotificationTag.PREDICTION_REMINDER_15_MINUTES,\n\t\tTournamentNotificationTag.PREDICTION_REMINDER_3_HOURS,\n\t\tTournamentNotificationTag.PREDICTION_REMINDER_1_HOUR,\n\t]);\n\n\tpublic async dispatchPending(): Promise<void> {\n\t\tconst tournament = await this.configRepository.findActiveFull();\n\t\tif (!tournament) return;\n\n\t\tconst templates = await this.templateRepository.findTemplates(tournament._id);\n\n\t\tawait this.dispatchTournamentActivationNotification(tournament, templates);\n\t\tawait this.dispatchDueReminders(tournament, templates);\n\t}\n\n\tprivate async dispatchDueReminders(\n\t\ttournament: TournamentDocument,\n\t\ttemplates: Map<TournamentNotificationTag, NotificationMessage>\n\t): Promise<void> {\n\t\tawait Promise.all(\n\t\t\ttournament.matches.flatMap(match =>\n\t\t\t\ttournament.scheduledNotifications.map(scheduled =>\n\t\t\t\t\tthis.dispatchReminder(tournament, match, scheduled, templates)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}\n\n\tprivate async dispatchReminder(\n\t\ttournament: TournamentDocument,\n\t\tmatch: TournamentMatch,\n\t\tscheduled: ScheduledNotificationConfig,\n\t\ttemplates: Map<TournamentNotificationTag, NotificationMessage>\n\t): Promise<void> {\n\t\tconst {type, target, durationMins} = scheduled;\n\n\t\tif (!ScheduleService.REMINDER_TYPES.has(type)) return;\n\t\tif (this.alreadySent(match, type)) return;\n\t\tif (!this.isDue(match, durationMins)) return;\n\n\t\tif (await this.canSendNow(type)) await this.notificationService.dispatchScheduledReminder({\n\t\t\ttournament,\n\t\t\tmatch,\n\t\t\ttemplates,\n\t\t\ttype,\n\t\t\ttarget\n\t\t});\n\n\t\tawait this.matchRepository.setNotificationFlag(tournament._id, match._id, type);\n\t}\n\n\tprivate isDue(match: TournamentMatch, durationMins: number): boolean {\n\t\tconst notificationTime = new Date(match.startingDate).getTime() - durationMins * 60 * 1000;\n\t\treturn Date.now() >= notificationTime;\n\t}\n\n\tprivate alreadySent(match: TournamentMatch, type: TournamentNotificationTag): boolean {\n\t\tconst flags = match.notificationFlags as unknown as Record<string, boolean> | undefined;\n\t\treturn flags?.[type] === true;\n\t}\n\n\t// The 1-hour reminder targets users who already predicted, so it's only worth sending while Lyxa\n\t// is open. Every other reminder can go out at any time.\n\tprivate async canSendNow(type: TournamentNotificationTag): Promise<boolean> {\n\t\tif (type !== TournamentNotificationTag.PREDICTION_REMINDER_1_HOUR) return true;\n\t\treturn this.isCompanyOpen();\n\t}\n\n\tprivate async isCompanyOpen(): Promise<boolean> {\n\t\tconst settings = (await getLibraries().getCachedSettingsService().getSettings()) as Setting | null;\n\t\t// Without configured working hours we can't confirm we're open, so hold the reminder for a later run.\n\t\tif (!settings?.workHourSetting) return false;\n\t\treturn isLyxaOpen(settings.workHourSetting);\n\t}\n}\n\nexport const scheduleDispatchService = Container.get(ScheduleService);\n"]}
@@ -10,8 +10,8 @@ function fillMissingPeriods(results, startDate, endDate, type, defaultFields) {
10
10
  resultMap.set(item.date, item);
11
11
  }
12
12
  const fieldKeys = Object.keys(defaultFields);
13
- const unit = type === enum_1.GraphType.MONTHLY ? 'month' : 'day';
14
- const dateFormat = type === enum_1.GraphType.MONTHLY ? 'YYYY-MM' : 'YYYY-MM-DD';
13
+ const unit = type === enum_1.GraphType.YEARLY ? 'year' : type === enum_1.GraphType.MONTHLY ? 'month' : 'day';
14
+ const dateFormat = type === enum_1.GraphType.YEARLY ? 'YYYY' : type === enum_1.GraphType.MONTHLY ? 'YYYY-MM' : 'YYYY-MM-DD';
15
15
  let current = (0, dayjs_1.dayjs)(startDate).startOf(unit);
16
16
  const end = (0, dayjs_1.dayjs)(endDate).startOf(unit);
17
17
  while (current.isBefore(end) || current.isSame(end)) {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"/","sources":["utility/utils.ts"],"names":[],"mappings":";;AAeA,gDA2CC;AA1DD,8DAA2D;AAC3D,4DAA8D;AAc9D,SAAgB,kBAAkB,CAC9B,OAAY,EACZ,SAAe,EACf,OAAa,EACb,IAAe,EACf,aAA8B;IAE9B,MAAM,UAAU,GAAQ,EAAE,CAAC;IAC3B,MAAM,SAAS,GAAG,IAAI,GAAG,EAAa,CAAC;IAGvC,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QACzB,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;IAGD,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAmC,CAAC;IAG/E,MAAM,IAAI,GAAG,IAAI,KAAK,gBAAS,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;IAC1D,MAAM,UAAU,GAAG,IAAI,KAAK,gBAAS,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC;IAEzE,IAAI,OAAO,GAAG,IAAA,aAAK,EAAC,SAAS,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,GAAG,GAAG,IAAA,aAAK,EAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAGzC,OAAO,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;QAClD,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC3C,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAGxC,MAAM,KAAK,GAAG;YACV,IAAI,EAAE,OAAO;YACb,GAAG,CAAC,QAAQ;gBACR,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACtF,CAAC,CAAC,EAAE,GAAG,aAAa,EAAE,CAAC;SACd,CAAC;QAElB,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvB,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,UAAU,CAAC;AACtB,CAAC","sourcesContent":["import { dayjs } from '@lyxa.ai/core/dist/utilities/dayjs';\nimport { GraphType } from '@lyxa.ai/core/dist/utilities/enum';\n\n/**\n * Fills in missing periods (daily or monthly) between two dates in a time-series dataset,\n * assigning default values for fields when data is missing.\n *\n * @template T - The shape of the result item, must include a `date` field.\n * @param results - Original array of time-series data with `date` keys.\n * @param startDate - The start date of the period to cover.\n * @param endDate - The end date of the period to cover.\n * @param type - Graph type (e.g., daily or monthly).\n * @param defaultFields - Default values to assign when a date is missing.\n * @returns A new array with missing dates filled in and populated with default values.\n */\nexport function fillMissingPeriods<T extends Record<string, any>>(\n results: T[],\n startDate: Date,\n endDate: Date,\n type: GraphType,\n defaultFields: Omit<T, 'date'>\n): T[] {\n const filledData: T[] = [];\n const resultMap = new Map<string, T>();\n\n // Index results by date string for quick lookup\n for (const item of results) {\n resultMap.set(item.date, item);\n }\n\n // Extract the field keys from defaultFields for dynamic value assignment\n const fieldKeys = Object.keys(defaultFields) as (keyof typeof defaultFields)[];\n\n // Determine the unit and format based on the graph type\n const unit = type === GraphType.MONTHLY ? 'month' : 'day';\n const dateFormat = type === GraphType.MONTHLY ? 'YYYY-MM' : 'YYYY-MM-DD';\n\n let current = dayjs(startDate).startOf(unit);\n const end = dayjs(endDate).startOf(unit);\n\n // Iterate through each period (day or month) and build the result\n while (current.isBefore(end) || current.isSame(end)) {\n const dateKey = current.format(dateFormat);\n const existing = resultMap.get(dateKey);\n\n // Construct the data entry using existing values or defaults\n const entry = {\n date: dateKey,\n ...(existing\n ? Object.fromEntries(fieldKeys.map(key => [key, existing[key] ?? defaultFields[key]]))\n : { ...defaultFields }),\n } as unknown as T;\n\n filledData.push(entry);\n current = current.add(1, unit);\n }\n\n return filledData;\n}"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"/","sources":["utility/utils.ts"],"names":[],"mappings":";;AAeA,gDA2CC;AA1DD,8DAA2D;AAC3D,4DAA8D;AAc9D,SAAgB,kBAAkB,CAC9B,OAAY,EACZ,SAAe,EACf,OAAa,EACb,IAAe,EACf,aAA8B;IAE9B,MAAM,UAAU,GAAQ,EAAE,CAAC;IAC3B,MAAM,SAAS,GAAG,IAAI,GAAG,EAAa,CAAC;IAGvC,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QACzB,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;IAGD,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAmC,CAAC;IAG/E,MAAM,IAAI,GAAG,IAAI,KAAK,gBAAS,CA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":["import { dayjs } from '@lyxa.ai/core/dist/utilities/dayjs';\nimport { GraphType } from '@lyxa.ai/core/dist/utilities/enum';\n\n/**\n * Fills in missing periods (daily or monthly) between two dates in a time-series dataset,\n * assigning default values for fields when data is missing.\n *\n * @template T - The shape of the result item, must include a `date` field.\n * @param results - Original array of time-series data with `date` keys.\n * @param startDate - The start date of the period to cover.\n * @param endDate - The end date of the period to cover.\n * @param type - Graph type (e.g., daily or monthly).\n * @param defaultFields - Default values to assign when a date is missing.\n * @returns A new array with missing dates filled in and populated with default values.\n */\nexport function fillMissingPeriods<T extends Record<string, any>>(\n results: T[],\n startDate: Date,\n endDate: Date,\n type: GraphType,\n defaultFields: Omit<T, 'date'>\n): T[] {\n const filledData: T[] = [];\n const resultMap = new Map<string, T>();\n\n // Index results by date string for quick lookup\n for (const item of results) {\n resultMap.set(item.date, item);\n }\n\n // Extract the field keys from defaultFields for dynamic value assignment\n const fieldKeys = Object.keys(defaultFields) as (keyof typeof defaultFields)[];\n\n // Determine the unit and format based on the graph type\n const unit = type === GraphType.YEARLY ? 'year' : type === GraphType.MONTHLY ? 'month' : 'day';\n const dateFormat = type === GraphType.YEARLY ? 'YYYY' : type === GraphType.MONTHLY ? 'YYYY-MM' : 'YYYY-MM-DD';\n\n let current = dayjs(startDate).startOf(unit);\n const end = dayjs(endDate).startOf(unit);\n\n // Iterate through each period (day or month) and build the result\n while (current.isBefore(end) || current.isSame(end)) {\n const dateKey = current.format(dateFormat);\n const existing = resultMap.get(dateKey);\n\n // Construct the data entry using existing values or defaults\n const entry = {\n date: dateKey,\n ...(existing\n ? Object.fromEntries(fieldKeys.map(key => [key, existing[key] ?? defaultFields[key]]))\n : { ...defaultFields }),\n } as unknown as T;\n\n filledData.push(entry);\n current = current.add(1, unit);\n }\n\n return filledData;\n}"]}
@@ -2963,6 +2963,10 @@ declare const marketingMicroServiceRouter: import("@trpc/server").TRPCBuiltRoute
2963
2963
  toDate: string | Date;
2964
2964
  status?: import("@lyxa.ai/core/dist/utilities/enum").Status | undefined;
2965
2965
  searchKey?: string | undefined;
2966
+ populate?: {
2967
+ path: string;
2968
+ select?: string | Record<string, 0 | 1> | undefined;
2969
+ }[] | undefined;
2966
2970
  };
2967
2971
  output: {
2968
2972
  message: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAoBA,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAY2C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAH3E,CAAC;AAuCH,MAAM,MAAM,2BAA2B,GAAG,OAAO,2BAA2B,CAAC"}
@@ -2161,6 +2161,10 @@ export declare const couponRouter: import("@trpc/server").TRPCBuiltRouter<{
2161
2161
  toDate: string | Date;
2162
2162
  status?: import("@lyxa.ai/core/dist/utilities/enum").Status | undefined;
2163
2163
  searchKey?: string | undefined;
2164
+ populate?: {
2165
+ path: string;
2166
+ select?: string | Record<string, 0 | 1> | undefined;
2167
+ }[] | undefined;
2164
2168
  };
2165
2169
  output: {
2166
2170
  message: string;
@@ -1 +1 @@
1
- {"version":3,"file":"coupon.router.d.ts","sourceRoot":"/","sources":["modules/coupon/routers/coupon.router.ts"],"names":[],"mappings":"AAqCA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
  categoryNumberingEnabled?: boolean | undefined;
243
243
  hideOutOfStockProducts?: boolean | undefined;
244
+ companyDetails?: {
245
+ registeredName?: string | undefined;
246
+ registeredAddress?: string | undefined;
247
+ mof?: string | undefined;
248
+ } | undefined;
244
249
  createdAt?: Date | undefined;
245
250
  updatedAt?: Date | undefined;
246
251
  }> & {
@@ -1 +1 @@
1
- {"version":3,"file":"custom-coupon.service.d.ts","sourceRoot":"/","sources":["modules/coupon/services/custom-coupon.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAqB,YAAY,IAAI,KAAK,EAAE,MAAM,4CAA4C,CAAC;AACtG,OAAO,EACN,qBAAqB,IAAI,SAAS,EAClC,qBAAqB,IAAI,SAAS,EAClC,iBAAiB,EACjB,MAAM,6BAA6B,CAAC;AAGrC,qBACa,mBAAmB;IAC/B,OAAO,CAAC,KAAK,CAAC;;IAMd;;;OAGG;IACU,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAIlE;;;;OAIG;IACU,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAuBjE,cAAc,CAAC,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BhF;AAED,eAAO,MAAM,mBAAmB,qBAAqC,CAAC"}
1
+ {"version":3,"file":"custom-coupon.service.d.ts","sourceRoot":"/","sources":["modules/coupon/services/custom-coupon.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAqB,YAAY,IAAI,KAAK,EAAE,MAAM,4CAA4C,CAAC;AACtG,OAAO,EACN,qBAAqB,IAAI,SAAS,EAClC,qBAAqB,IAAI,SAAS,EAClC,iBAAiB,EACjB,MAAM,6BAA6B,CAAC;AAGrC,qBACa,mBAAmB;IAC/B,OAAO,CAAC,KAAK,CAAC;;IAMd;;;OAGG;IACU,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAIlE;;;;OAIG;IACU,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAuBjE,cAAc,CAAC,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BhF;AAED,eAAO,MAAM,mBAAmB,qBAAqC,CAAC"}
@@ -233,6 +233,11 @@ export declare class CouponHelperService {
233
233
  isMenuDietaryFilterEnabled?: boolean | undefined;
234
234
  categoryNumberingEnabled?: boolean | undefined;
235
235
  hideOutOfStockProducts?: boolean | undefined;
236
+ companyDetails?: {
237
+ registeredName?: string | undefined;
238
+ registeredAddress?: string | undefined;
239
+ mof?: string | undefined;
240
+ } | undefined;
236
241
  createdAt?: Date | undefined;
237
242
  updatedAt?: Date | undefined;
238
243
  }> & {