@lyxa.ai/marketing 1.0.57 → 1.0.59

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 (176) hide show
  1. package/dist/lib/event/event-initializations.d.ts.map +1 -1
  2. package/dist/lib/event/event-initializations.js +1 -0
  3. package/dist/lib/event/event-initializations.js.map +1 -1
  4. package/dist/lib/event/event-listeners/event-listeners.d.ts +1 -0
  5. package/dist/lib/event/event-listeners/event-listeners.d.ts.map +1 -1
  6. package/dist/lib/event/event-listeners/event-listeners.js +62 -12
  7. package/dist/lib/event/event-listeners/event-listeners.js.map +1 -1
  8. package/dist/lib/event/events/marketing-product-seed.event.d.ts +1 -2
  9. package/dist/lib/event/events/marketing-product-seed.event.d.ts.map +1 -1
  10. package/dist/lib/event/events/marketing-product-seed.event.js.map +1 -1
  11. package/dist/lib/event/events/marketing-product-sync.event.d.ts +11 -0
  12. package/dist/lib/event/events/marketing-product-sync.event.d.ts.map +1 -0
  13. package/dist/lib/event/events/marketing-product-sync.event.js +12 -0
  14. package/dist/lib/event/events/marketing-product-sync.event.js.map +1 -0
  15. package/dist/lib/index.d.ts +243 -12
  16. package/dist/lib/index.d.ts.map +1 -1
  17. package/dist/lib/index.js +3 -2
  18. package/dist/lib/index.js.map +1 -1
  19. package/dist/lib/modules/coupon/routers/coupon.router.d.ts +2 -2
  20. package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.js +2 -2
  21. package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.js.map +1 -1
  22. package/dist/lib/modules/coupon/validations/coupon.validation.d.ts +6 -6
  23. package/dist/lib/modules/coupon/validations/coupon.validation.js +2 -2
  24. package/dist/lib/modules/coupon/validations/coupon.validation.js.map +1 -1
  25. package/dist/lib/modules/deal-setting/services/deal-setting.service.d.ts.map +1 -1
  26. package/dist/lib/modules/deal-setting/services/deal-setting.service.js +4 -1
  27. package/dist/lib/modules/deal-setting/services/deal-setting.service.js.map +1 -1
  28. package/dist/lib/modules/featured-setting/services/featured-setting.service.d.ts.map +1 -1
  29. package/dist/lib/modules/featured-setting/services/featured-setting.service.js +3 -0
  30. package/dist/lib/modules/featured-setting/services/featured-setting.service.js.map +1 -1
  31. package/dist/lib/modules/limited-time-offer/campaign/campaign.router.d.ts +54 -8
  32. package/dist/lib/modules/limited-time-offer/campaign/campaign.router.d.ts.map +1 -1
  33. package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js +11 -0
  34. package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js.map +1 -1
  35. package/dist/lib/modules/limited-time-offer/campaign/jobs/index.d.ts.map +1 -1
  36. package/dist/lib/modules/limited-time-offer/campaign/jobs/index.js +6 -0
  37. package/dist/lib/modules/limited-time-offer/campaign/jobs/index.js.map +1 -1
  38. package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts +0 -1
  39. package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts.map +1 -1
  40. package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.js +2 -6
  41. package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.js.map +1 -1
  42. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts +16 -3
  43. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts.map +1 -1
  44. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.js +22 -3
  45. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.js.map +1 -1
  46. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts +2 -0
  47. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts.map +1 -1
  48. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.js +12 -0
  49. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.js.map +1 -1
  50. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +242 -35
  51. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts.map +1 -1
  52. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.js +19 -1
  53. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.js.map +1 -1
  54. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +6 -1
  55. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts.map +1 -1
  56. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.js +45 -1
  57. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.js.map +1 -1
  58. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts +3 -0
  59. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts.map +1 -1
  60. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.js +66 -8
  61. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.js.map +1 -1
  62. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts +1 -1
  63. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts.map +1 -1
  64. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.js +37 -19
  65. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.js.map +1 -1
  66. package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.validation.d.ts +2 -2
  67. package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts +241 -10
  68. package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -1
  69. package/dist/lib/modules/limited-time-offer/limited-time-offer.service.d.ts +2 -0
  70. package/dist/lib/modules/limited-time-offer/limited-time-offer.service.d.ts.map +1 -1
  71. package/dist/lib/modules/limited-time-offer/limited-time-offer.service.js +15 -3
  72. package/dist/lib/modules/limited-time-offer/limited-time-offer.service.js.map +1 -1
  73. package/dist/lib/modules/limited-time-offer/notification/limited-time-offer-notification.constants.d.ts +1 -1
  74. package/dist/lib/modules/limited-time-offer/notification/limited-time-offer-notification.constants.js +1 -1
  75. package/dist/lib/modules/limited-time-offer/notification/limited-time-offer-notification.constants.js.map +1 -1
  76. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts +10 -2
  77. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts.map +1 -1
  78. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.js +4 -1
  79. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.js.map +1 -1
  80. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts +10 -0
  81. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts.map +1 -1
  82. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.js +43 -0
  83. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.js.map +1 -1
  84. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts +187 -2
  85. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts.map +1 -1
  86. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.js +29 -0
  87. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.js.map +1 -1
  88. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +395 -0
  89. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts.map +1 -1
  90. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.js +16 -6
  91. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.js.map +1 -1
  92. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts +7 -4
  93. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts.map +1 -1
  94. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.js +31 -6
  95. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.js.map +1 -1
  96. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts +14 -3
  97. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts.map +1 -1
  98. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.js +76 -16
  99. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.js.map +1 -1
  100. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts +13 -0
  101. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts.map +1 -0
  102. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.js +75 -0
  103. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.js.map +1 -0
  104. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts +21 -0
  105. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts.map +1 -0
  106. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.js +83 -0
  107. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.js.map +1 -0
  108. package/dist/lib/modules/marketing/services/marketing.service.d.ts +1 -0
  109. package/dist/lib/modules/marketing/services/marketing.service.d.ts.map +1 -1
  110. package/dist/lib/modules/marketing/services/marketing.service.js +60 -46
  111. package/dist/lib/modules/marketing/services/marketing.service.js.map +1 -1
  112. package/dist/lib/modules/marketing/services/product-marketing.service.d.ts +2 -3
  113. package/dist/lib/modules/marketing/services/product-marketing.service.d.ts.map +1 -1
  114. package/dist/lib/modules/marketing/services/product-marketing.service.js +42 -13
  115. package/dist/lib/modules/marketing/services/product-marketing.service.js.map +1 -1
  116. package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.d.ts.map +1 -1
  117. package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.js +95 -27
  118. package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.js.map +1 -1
  119. package/dist/types/event/event-initializations.d.ts.map +1 -1
  120. package/dist/types/event/event-listeners/event-listeners.d.ts +1 -0
  121. package/dist/types/event/event-listeners/event-listeners.d.ts.map +1 -1
  122. package/dist/types/event/events/marketing-product-seed.event.d.ts +1 -2
  123. package/dist/types/event/events/marketing-product-seed.event.d.ts.map +1 -1
  124. package/dist/types/event/events/marketing-product-sync.event.d.ts +11 -0
  125. package/dist/types/event/events/marketing-product-sync.event.d.ts.map +1 -0
  126. package/dist/types/index.d.ts +243 -12
  127. package/dist/types/index.d.ts.map +1 -1
  128. package/dist/types/modules/coupon/routers/coupon.router.d.ts +2 -2
  129. package/dist/types/modules/coupon/validations/coupon.validation.d.ts +6 -6
  130. package/dist/types/modules/deal-setting/services/deal-setting.service.d.ts.map +1 -1
  131. package/dist/types/modules/featured-setting/services/featured-setting.service.d.ts.map +1 -1
  132. package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts +54 -8
  133. package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts.map +1 -1
  134. package/dist/types/modules/limited-time-offer/campaign/jobs/index.d.ts.map +1 -1
  135. package/dist/types/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts +0 -1
  136. package/dist/types/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts.map +1 -1
  137. package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts +16 -3
  138. package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts.map +1 -1
  139. package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts +2 -0
  140. package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts.map +1 -1
  141. package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +242 -35
  142. package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts.map +1 -1
  143. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +6 -1
  144. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts.map +1 -1
  145. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts +3 -0
  146. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts.map +1 -1
  147. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts +1 -1
  148. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts.map +1 -1
  149. package/dist/types/modules/limited-time-offer/config/limited-time-offer-config.validation.d.ts +2 -2
  150. package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts +241 -10
  151. package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -1
  152. package/dist/types/modules/limited-time-offer/limited-time-offer.service.d.ts +2 -0
  153. package/dist/types/modules/limited-time-offer/limited-time-offer.service.d.ts.map +1 -1
  154. package/dist/types/modules/limited-time-offer/notification/limited-time-offer-notification.constants.d.ts +1 -1
  155. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts +10 -2
  156. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts.map +1 -1
  157. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts +10 -0
  158. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts.map +1 -1
  159. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts +187 -2
  160. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts.map +1 -1
  161. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +395 -0
  162. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts.map +1 -1
  163. package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts +7 -4
  164. package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts.map +1 -1
  165. package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts +14 -3
  166. package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts.map +1 -1
  167. package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts +13 -0
  168. package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts.map +1 -0
  169. package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts +21 -0
  170. package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts.map +1 -0
  171. package/dist/types/modules/marketing/services/marketing.service.d.ts +1 -0
  172. package/dist/types/modules/marketing/services/marketing.service.d.ts.map +1 -1
  173. package/dist/types/modules/marketing/services/product-marketing.service.d.ts +7 -3
  174. package/dist/types/modules/marketing/services/product-marketing.service.d.ts.map +1 -1
  175. package/dist/types/modules/marketing/services/synchronize-product-marketing.service.d.ts.map +1 -1
  176. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"event-initializations.d.ts","sourceRoot":"/","sources":["event/event-initializations.ts"],"names":[],"mappings":"AAQA,wBAAsB,kBAAkB,kBAMvC"}
1
+ {"version":3,"file":"event-initializations.d.ts","sourceRoot":"/","sources":["event/event-initializations.ts"],"names":[],"mappings":"AASA,wBAAsB,kBAAkB,kBAOvC"}
@@ -7,6 +7,7 @@ const jobs_1 = require("../modules/limited-time-offer/campaign/jobs");
7
7
  async function initEventListeners() {
8
8
  (0, event_listeners_1.subscribeToSyncAllProductsProductMarketingInfoProcessEvent)();
9
9
  await (0, event_listeners_1.subscribeToMarketingEntireMenuSeedEvent)();
10
+ await (0, event_listeners_1.subscribeToMarketingProductSyncEvent)();
10
11
  await (0, event_listeners_1.subscribeToMarketingReturnPunchCouponEvent)();
11
12
  await (0, evaluate_predictions_consumer_1.EvaluatePredictionsConsumer)();
12
13
  await (0, jobs_1.startBullMQWorkers)();
@@ -1 +1 @@
1
- {"version":3,"file":"event-initializations.js","sourceRoot":"/","sources":["event/event-initializations.ts"],"names":[],"mappings":";;AAQA,gDAMC;AAdD,uEAI2C;AAC3C,kHAA2G;AAC3G,oEAA+E;AAExE,KAAK,UAAU,kBAAkB;IACpC,IAAA,4EAA0D,GAAE,CAAC;IAC7D,MAAM,IAAA,yDAAuC,GAAE,CAAC;IAChD,MAAM,IAAA,4DAA0C,GAAE,CAAC;IACnD,MAAM,IAAA,2DAA2B,GAAE,CAAC;IACpC,MAAM,IAAA,yBAAkB,GAAE,CAAC;AAC/B,CAAC","sourcesContent":["import {\n subscribeToSyncAllProductsProductMarketingInfoProcessEvent,\n subscribeToMarketingEntireMenuSeedEvent,\n subscribeToMarketingReturnPunchCouponEvent,\n} from './event-listeners/event-listeners';\nimport {EvaluatePredictionsConsumer} from '@modules/tournament/match/events/evaluate-predictions.consumer';\nimport { startBullMQWorkers } from '@modules/limited-time-offer/campaign/jobs';\n\nexport async function initEventListeners() {\n subscribeToSyncAllProductsProductMarketingInfoProcessEvent();\n await subscribeToMarketingEntireMenuSeedEvent();\n await subscribeToMarketingReturnPunchCouponEvent();\n await EvaluatePredictionsConsumer();\n await startBullMQWorkers();\n}\n"]}
1
+ {"version":3,"file":"event-initializations.js","sourceRoot":"/","sources":["event/event-initializations.ts"],"names":[],"mappings":";;AASA,gDAOC;AAhBD,uEAK2C;AAC3C,kHAA2G;AAC3G,oEAA+E;AAExE,KAAK,UAAU,kBAAkB;IACpC,IAAA,4EAA0D,GAAE,CAAC;IAC7D,MAAM,IAAA,yDAAuC,GAAE,CAAC;IAChD,MAAM,IAAA,sDAAoC,GAAE,CAAC;IAC7C,MAAM,IAAA,4DAA0C,GAAE,CAAC;IACnD,MAAM,IAAA,2DAA2B,GAAE,CAAC;IACpC,MAAM,IAAA,yBAAkB,GAAE,CAAC;AAC/B,CAAC","sourcesContent":["import {\n subscribeToSyncAllProductsProductMarketingInfoProcessEvent,\n subscribeToMarketingEntireMenuSeedEvent,\n subscribeToMarketingProductSyncEvent,\n subscribeToMarketingReturnPunchCouponEvent,\n} from './event-listeners/event-listeners';\nimport {EvaluatePredictionsConsumer} from '@modules/tournament/match/events/evaluate-predictions.consumer';\nimport { startBullMQWorkers } from '@modules/limited-time-offer/campaign/jobs';\n\nexport async function initEventListeners() {\n subscribeToSyncAllProductsProductMarketingInfoProcessEvent();\n await subscribeToMarketingEntireMenuSeedEvent();\n await subscribeToMarketingProductSyncEvent();\n await subscribeToMarketingReturnPunchCouponEvent();\n await EvaluatePredictionsConsumer();\n await startBullMQWorkers();\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  export declare function subscribeToSyncAllProductsProductMarketingInfoProcessEvent(): Promise<void>;
2
2
  export declare function subscribeToMarketingEntireMenuSeedEvent(): Promise<void>;
3
+ export declare function subscribeToMarketingProductSyncEvent(): Promise<void>;
3
4
  export declare function subscribeToMarketingReturnPunchCouponEvent(): Promise<void>;
4
5
  //# sourceMappingURL=event-listeners.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"event-listeners.d.ts","sourceRoot":"/","sources":["event/event-listeners/event-listeners.ts"],"names":[],"mappings":"AAaA,wBAAsB,0DAA0D,kBAI/E;AAgBD,wBAAsB,uCAAuC,kBA4D5D;AAED,wBAAsB,0CAA0C,kBAI/D"}
1
+ {"version":3,"file":"event-listeners.d.ts","sourceRoot":"/","sources":["event/event-listeners/event-listeners.ts"],"names":[],"mappings":"AAcA,wBAAsB,0DAA0D,kBAI/E;AAgBD,wBAAsB,uCAAuC,kBA+D5D;AAED,wBAAsB,oCAAoC,kBAqDzD;AAED,wBAAsB,0CAA0C,kBAI/D"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.subscribeToSyncAllProductsProductMarketingInfoProcessEvent = subscribeToSyncAllProductsProductMarketingInfoProcessEvent;
4
4
  exports.subscribeToMarketingEntireMenuSeedEvent = subscribeToMarketingEntireMenuSeedEvent;
5
+ exports.subscribeToMarketingProductSyncEvent = subscribeToMarketingProductSyncEvent;
5
6
  exports.subscribeToMarketingReturnPunchCouponEvent = subscribeToMarketingReturnPunchCouponEvent;
6
7
  const event_1 = require("@lyxa.ai/core/dist/libraries/event");
7
8
  const core_1 = require("@lyxa.ai/core");
@@ -11,6 +12,7 @@ const typegoose_1 = require("@typegoose/typegoose");
11
12
  const mongo_stream_changes_batch_process_shops_event_1 = require("@lyxa.ai/core/dist/libraries/event/events/mongo-stream-changes-batch-process-shops-event");
12
13
  const events_common_methods_1 = require("@lyxa.ai/core/dist/utilities/events-common-methods");
13
14
  const marketing_product_seed_event_1 = require("../events/marketing-product-seed.event");
15
+ const marketing_product_sync_event_1 = require("../events/marketing-product-sync.event");
14
16
  const services_2 = require("../../modules/punch-marketing-history/services");
15
17
  async function subscribeToSyncAllProductsProductMarketingInfoProcessEvent() {
16
18
  await (0, event_1.subscribeToEvent)(EventEnums_1.PublishEventEnums.SYNC_ALL_PRODUCTS_PRODUCT_MARKETING_INFO_EVENT, async (payload) => {
@@ -30,40 +32,43 @@ const noRequeue = (label, handler) => async (payload) => {
30
32
  async function subscribeToMarketingEntireMenuSeedEvent() {
31
33
  await (0, event_1.subscribeToEvent)(marketing_product_seed_event_1.MARKETING_ENTIRE_MENU_SEED_EVENT, noRequeue('entire-menu-seed', async (payload) => {
32
34
  const logger = (0, core_1.getLibraries)().getLoggerKit();
33
- const { marketingId: mid, shopId: sid, page, pageSize } = payload;
35
+ const { marketingId: mid, shopId: sid } = payload;
34
36
  if (!typegoose_1.mongoose.isValidObjectId(mid) || !typegoose_1.mongoose.isValidObjectId(sid)) {
35
37
  logger.error('entire-menu seed: invalid ids — dropping message', null, {
36
38
  tag: 'marketing.seed.entire-menu',
37
- data: { marketingId: mid, shopId: sid, page, pageSize },
39
+ data: { marketingId: mid, shopId: sid },
38
40
  });
39
41
  return;
40
42
  }
41
43
  const marketingId = new typegoose_1.mongoose.Types.ObjectId(mid);
42
44
  const shopId = new typegoose_1.mongoose.Types.ObjectId(sid);
45
+ const productIds = (payload.productIds ?? [])
46
+ .filter(id => typegoose_1.mongoose.isValidObjectId(id))
47
+ .map(id => new typegoose_1.mongoose.Types.ObjectId(id));
48
+ if (!productIds.length)
49
+ return;
43
50
  const MAX_ATTEMPTS = 3;
44
51
  let lastError;
45
52
  for (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {
46
53
  try {
47
- const productIds = await services_1.productMarketingService.upsertProductMarketingsForPage({
48
- shop: shopId,
54
+ const upserted = await services_1.productMarketingService.upsertProductMarketingsForPage({
49
55
  marketingId,
50
- page,
51
- pageSize,
56
+ productIds,
52
57
  isAppliedByCompany: payload.isAppliedByCompany,
53
58
  isBuy1Get1: payload.isBuy1Get1,
54
59
  value: payload.value,
55
60
  valueType: payload.valueType,
56
61
  });
57
- if (productIds.length) {
58
- await services_1.synchronizeProductMarketingService.syncProductMarketingInfoByProductIds(productIds);
62
+ if (upserted.length) {
63
+ await services_1.synchronizeProductMarketingService.syncProductMarketingInfoByProductIds(upserted);
59
64
  }
60
65
  (0, events_common_methods_1.publishSyncSingleShopSectionsInCacheProcessEvent)({
61
66
  shopId,
62
67
  operation: mongo_stream_changes_batch_process_shops_event_1.ChangeStreamOperationTypes.UPDATE,
63
68
  });
64
- logger.debug(`page ${page} seeded — ${productIds.length} products updated`, {
69
+ logger.debug(`entire-menu seed done — ${upserted.length} products updated`, {
65
70
  tag: 'marketing.seed.entire-menu',
66
- data: { marketingId: mid, shopId: sid, page, count: productIds.length },
71
+ data: { marketingId: mid, shopId: sid, count: upserted.length },
67
72
  });
68
73
  return;
69
74
  }
@@ -74,9 +79,54 @@ async function subscribeToMarketingEntireMenuSeedEvent() {
74
79
  }
75
80
  }
76
81
  }
77
- logger.error(`page ${page} seed failed after ${MAX_ATTEMPTS} attempts — manual reseed required`, lastError, {
82
+ logger.error(`entire-menu seed failed after ${MAX_ATTEMPTS} attempts — manual reseed required`, lastError, {
78
83
  tag: 'marketing.seed.entire-menu',
79
- data: { marketingId: mid, shopId: sid, page, pageSize },
84
+ data: { marketingId: mid, shopId: sid, count: productIds.length },
85
+ });
86
+ }));
87
+ }
88
+ async function subscribeToMarketingProductSyncEvent() {
89
+ await (0, event_1.subscribeToEvent)(marketing_product_sync_event_1.MARKETING_PRODUCT_SYNC_EVENT, noRequeue('marketing-product-sync', async (payload) => {
90
+ const logger = (0, core_1.getLibraries)().getLoggerKit();
91
+ const { marketingId: mid, shopId: sid } = payload;
92
+ if (!typegoose_1.mongoose.isValidObjectId(mid) || !typegoose_1.mongoose.isValidObjectId(sid)) {
93
+ logger.error('marketing-product-sync: invalid ids — dropping message', null, {
94
+ tag: 'marketing.product-sync',
95
+ data: { marketingId: mid, shopId: sid },
96
+ });
97
+ return;
98
+ }
99
+ const shopId = new typegoose_1.mongoose.Types.ObjectId(sid);
100
+ const productIds = (payload.productIds ?? [])
101
+ .filter(id => typegoose_1.mongoose.isValidObjectId(id))
102
+ .map(id => new typegoose_1.mongoose.Types.ObjectId(id));
103
+ if (!productIds.length)
104
+ return;
105
+ const MAX_ATTEMPTS = 3;
106
+ let lastError;
107
+ for (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {
108
+ try {
109
+ await services_1.synchronizeProductMarketingService.syncProductMarketingInfoByProductIds(productIds);
110
+ (0, events_common_methods_1.publishSyncSingleShopSectionsInCacheProcessEvent)({
111
+ shopId,
112
+ operation: mongo_stream_changes_batch_process_shops_event_1.ChangeStreamOperationTypes.UPDATE,
113
+ });
114
+ logger.debug(`marketing-product-sync done — ${productIds.length} products`, {
115
+ tag: 'marketing.product-sync',
116
+ data: { marketingId: mid, shopId: sid, count: productIds.length },
117
+ });
118
+ return;
119
+ }
120
+ catch (error) {
121
+ lastError = error;
122
+ if (attempt < MAX_ATTEMPTS) {
123
+ await new Promise(resolve => setTimeout(resolve, 2000 * attempt));
124
+ }
125
+ }
126
+ }
127
+ logger.error(`marketing-product-sync failed after ${MAX_ATTEMPTS} attempts`, lastError, {
128
+ tag: 'marketing.product-sync',
129
+ data: { marketingId: mid, shopId: sid, count: productIds.length },
80
130
  });
81
131
  }));
82
132
  }
@@ -1 +1 @@
1
- {"version":3,"file":"event-listeners.js","sourceRoot":"/","sources":["event/event-listeners/event-listeners.ts"],"names":[],"mappings":";;AAaA,gIAIC;AAgBD,0FA4DC;AAED,gGAIC;AAnGD,8DAAsE;AACtE,wCAA6C;AAC7C,0DAA0G;AAC1G,8EAAkF;AAClF,oDAAgD;AAChD,6JAAsI;AACtI,8FAAsH;AACtH,yFAGgD;AAChD,wEAAyF;AAElF,KAAK,UAAU,0DAA0D;IAC/E,MAAM,IAAA,wBAAgB,EAAC,8BAAiB,CAAC,8CAA8C,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE;QACxG,6CAAkC,CAAC,2CAA2C,CAAC,OAAO,CAAC,CAAC;IACzF,CAAC,CAAC,CAAC;AACJ,CAAC;AAID,MAAM,SAAS,GACd,CAAI,KAAa,EAAE,OAAsC,EAAE,EAAE,CAC7D,KAAK,EAAE,OAAU,EAAiB,EAAE;IACnC,IAAI,CAAC;QACJ,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACd,IAAA,mBAAY,GAAE,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,0CAA0C,EAAE,GAAG,EAAE;YAC5F,GAAG,EAAE,kBAAkB;SACvB,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CAAC;AAEI,KAAK,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AO,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { subscribeToEvent } from '@lyxa.ai/core/dist/libraries/event';\nimport { getLibraries } from '@lyxa.ai/core';\nimport { productMarketingService, synchronizeProductMarketingService } from '@modules/marketing/services';\nimport { PublishEventEnums } from '@lyxa.ai/core/dist/libraries/event/EventEnums';\nimport { mongoose } from '@typegoose/typegoose';\nimport { ChangeStreamOperationTypes } from '@lyxa.ai/core/dist/libraries/event/events/mongo-stream-changes-batch-process-shops-event';\nimport { publishSyncSingleShopSectionsInCacheProcessEvent } from '@lyxa.ai/core/dist/utilities/events-common-methods';\nimport {\n\tMARKETING_ENTIRE_MENU_SEED_EVENT,\n\tMarketingProductSeedPayload,\n} from '../events/marketing-product-seed.event';\nimport { punchMarketingHistoryService } from '@modules/punch-marketing-history/services';\n\nexport async function subscribeToSyncAllProductsProductMarketingInfoProcessEvent() {\n\tawait subscribeToEvent(PublishEventEnums.SYNC_ALL_PRODUCTS_PRODUCT_MARKETING_INFO_EVENT, async payload => {\n\t\tsynchronizeProductMarketingService.processAllProductsProductMarketingInfoEvent(payload);\n\t});\n}\n\n// subscribeToEvent nacks with requeue=true on a thrown handler, so a failing message\n// bounces back to the queue forever. Swallow throws here -> handler returns -> message acked.\nconst noRequeue =\n\t<T>(label: string, handler: (payload: T) => Promise<void>) =>\n\tasync (payload: T): Promise<void> => {\n\t\ttry {\n\t\t\tawait handler(payload);\n\t\t} catch (err) {\n\t\t\tgetLibraries().getLoggerKit().error(`${label}: handler failed — dropping (no requeue)`, err, {\n\t\t\t\ttag: 'event.no-requeue',\n\t\t\t});\n\t\t}\n\t};\n\nexport async function subscribeToMarketingEntireMenuSeedEvent() {\n\tawait subscribeToEvent(MARKETING_ENTIRE_MENU_SEED_EVENT, noRequeue('entire-menu-seed', async (payload: MarketingProductSeedPayload) => {\n\t\tconst logger = getLibraries().getLoggerKit();\n\t\tconst { marketingId: mid, shopId: sid, page, pageSize } = payload;\n\n\t\tif (!mongoose.isValidObjectId(mid) || !mongoose.isValidObjectId(sid)) {\n\t\t\tlogger.error('entire-menu seed: invalid ids — dropping message', null, {\n\t\t\t\ttag: 'marketing.seed.entire-menu',\n\t\t\t\tdata: { marketingId: mid, shopId: sid, page, pageSize },\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tconst marketingId = new mongoose.Types.ObjectId(mid);\n\t\tconst shopId = new mongoose.Types.ObjectId(sid);\n\n\t\tconst MAX_ATTEMPTS = 3;\n\t\tlet lastError: unknown;\n\n\t\tfor (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {\n\t\t\ttry {\n\t\t\t\tconst productIds = await productMarketingService.upsertProductMarketingsForPage({\n\t\t\t\t\tshop: shopId,\n\t\t\t\t\tmarketingId,\n\t\t\t\t\tpage,\n\t\t\t\t\tpageSize,\n\t\t\t\t\tisAppliedByCompany: payload.isAppliedByCompany,\n\t\t\t\t\tisBuy1Get1: payload.isBuy1Get1,\n\t\t\t\t\tvalue: payload.value,\n\t\t\t\t\tvalueType: payload.valueType,\n\t\t\t\t});\n\n\t\t\t\tif (productIds.length) {\n\t\t\t\t\tawait synchronizeProductMarketingService.syncProductMarketingInfoByProductIds(productIds);\n\t\t\t\t}\n\n\t\t\t\tpublishSyncSingleShopSectionsInCacheProcessEvent({\n\t\t\t\t\tshopId,\n\t\t\t\t\toperation: ChangeStreamOperationTypes.UPDATE,\n\t\t\t\t});\n\n\t\t\t\tlogger.debug(`page ${page} seeded — ${productIds.length} products updated`, {\n\t\t\t\t\ttag: 'marketing.seed.entire-menu',\n\t\t\t\t\tdata: { marketingId: mid, shopId: sid, page, count: productIds.length },\n\t\t\t\t});\n\n\t\t\t\treturn;\n\t\t\t} catch (error) {\n\t\t\t\tlastError = error;\n\t\t\t\tif (attempt < MAX_ATTEMPTS) {\n\t\t\t\t\tawait new Promise(resolve => setTimeout(resolve, 2000 * attempt));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlogger.error(`page ${page} seed failed after ${MAX_ATTEMPTS} attempts — manual reseed required`, lastError, {\n\t\t\ttag: 'marketing.seed.entire-menu',\n\t\t\tdata: { marketingId: mid, shopId: sid, page, pageSize },\n\t\t});\n\t}));\n}\n\nexport async function subscribeToMarketingReturnPunchCouponEvent() {\n\tawait subscribeToEvent(PublishEventEnums.MARKETING_RETURN_PUNCH_COUPON_EVENT, async payload => {\n\t\tpunchMarketingHistoryService.returnPunchCoupon(payload.orderId);\n\t});\n}\n"]}
1
+ {"version":3,"file":"event-listeners.js","sourceRoot":"/","sources":["event/event-listeners/event-listeners.ts"],"names":[],"mappings":";;AAcA,gIAIC;AAgBD,0FA+DC;AAED,oFAqDC;AAED,gGAIC;AA9JD,8DAAsE;AACtE,wCAA6C;AAC7C,0DAA0G;AAC1G,8EAAkF;AAClF,oDAAgD;AAChD,6JAAsI;AACtI,8FAAsH;AACtH,yFAGgD;AAChD,yFAAmH;AACnH,wEAAyF;AAElF,KAAK,UAAU,0DAA0D;IAC/E,MAAM,IAAA,wBAAgB,EAAC,8BAAiB,CAAC,8CAA8C,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE;QACxG,6CAAkC,CAAC,2CAA2C,CAAC,OAAO,CAAC,CAAC;IACzF,CAAC,CAAC,CAAC;AACJ,CAAC;AAID,MAAM,SAAS,GACd,CAAI,KAAa,EAAE,OAAsC,EAAE,EAAE,CAC7D,KAAK,EAAE,OAAU,EAAiB,EAAE;IACnC,IAAI,CAAC;QACJ,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACd,IAAA,mBAAY,GAAE,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,0CAA0C,EAAE,GAAG,EAAE;YAC5F,GAAG,EAAE,kBAAkB;SACvB,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CAAC;AAEI,KAAK,UAAU,uCAAuC;IAC5D,MAAM,IAAA,wBAAg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UAAU,CAAC,CAAC;gBAE1F,IAAA,wEAAgD,EAAC;oBAChD,MAAM;oBACN,SAAS,EAAE,2EAA0B,CAAC,MAAM;iBAC5C,CAAC,CAAC;gBAEH,MAAM,CAAC,KAAK,CAAC,iCAAiC,UAAU,CAAC,MAAM,WAAW,EAAE;oBAC3E,GAAG,EAAE,wBAAwB;oBAC7B,IAAI,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE;iBACjE,CAAC,CAAC;gBACH,OAAO;YACR,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,SAAS,GAAG,KAAK,CAAC;gBAClB,IAAI,OAAO,GAAG,YAAY,EAAE,CAAC;oBAC5B,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC;gBACnE,CAAC;YACF,CAAC;QACF,CAAC;QAED,MAAM,CAAC,KAAK,CAAC,uCAAuC,YAAY,WAAW,EAAE,SAAS,EAAE;YACvF,GAAG,EAAE,wBAAwB;YAC7B,IAAI,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE;SACjE,CAAC,CAAC;IACJ,CAAC,CAAC,CACF,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,0CAA0C;IAC/D,MAAM,IAAA,wBAAgB,EAAC,8BAAiB,CAAC,mCAAmC,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE;QAC7F,uCAA4B,CAAC,iBAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { subscribeToEvent } from '@lyxa.ai/core/dist/libraries/event';\nimport { getLibraries } from '@lyxa.ai/core';\nimport { productMarketingService, synchronizeProductMarketingService } from '@modules/marketing/services';\nimport { PublishEventEnums } from '@lyxa.ai/core/dist/libraries/event/EventEnums';\nimport { mongoose } from '@typegoose/typegoose';\nimport { ChangeStreamOperationTypes } from '@lyxa.ai/core/dist/libraries/event/events/mongo-stream-changes-batch-process-shops-event';\nimport { publishSyncSingleShopSectionsInCacheProcessEvent } from '@lyxa.ai/core/dist/utilities/events-common-methods';\nimport {\n\tMARKETING_ENTIRE_MENU_SEED_EVENT,\n\tMarketingProductSeedPayload,\n} from '../events/marketing-product-seed.event';\nimport { MARKETING_PRODUCT_SYNC_EVENT, MarketingProductSyncPayload } from '../events/marketing-product-sync.event';\nimport { punchMarketingHistoryService } from '@modules/punch-marketing-history/services';\n\nexport async function subscribeToSyncAllProductsProductMarketingInfoProcessEvent() {\n\tawait subscribeToEvent(PublishEventEnums.SYNC_ALL_PRODUCTS_PRODUCT_MARKETING_INFO_EVENT, async payload => {\n\t\tsynchronizeProductMarketingService.processAllProductsProductMarketingInfoEvent(payload);\n\t});\n}\n\n// subscribeToEvent nacks with requeue=true on a thrown handler, so a failing message\n// bounces back to the queue forever. Swallow throws here -> handler returns -> message acked.\nconst noRequeue =\n\t<T>(label: string, handler: (payload: T) => Promise<void>) =>\n\tasync (payload: T): Promise<void> => {\n\t\ttry {\n\t\t\tawait handler(payload);\n\t\t} catch (err) {\n\t\t\tgetLibraries().getLoggerKit().error(`${label}: handler failed — dropping (no requeue)`, err, {\n\t\t\t\ttag: 'event.no-requeue',\n\t\t\t});\n\t\t}\n\t};\n\nexport async function subscribeToMarketingEntireMenuSeedEvent() {\n\tawait subscribeToEvent(MARKETING_ENTIRE_MENU_SEED_EVENT, noRequeue('entire-menu-seed', async (payload: MarketingProductSeedPayload) => {\n\t\tconst logger = getLibraries().getLoggerKit();\n\t\tconst { marketingId: mid, shopId: sid } = payload;\n\n\t\tif (!mongoose.isValidObjectId(mid) || !mongoose.isValidObjectId(sid)) {\n\t\t\tlogger.error('entire-menu seed: invalid ids — dropping message', null, {\n\t\t\t\ttag: 'marketing.seed.entire-menu',\n\t\t\t\tdata: { marketingId: mid, shopId: sid },\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tconst marketingId = new mongoose.Types.ObjectId(mid);\n\t\tconst shopId = new mongoose.Types.ObjectId(sid);\n\t\tconst productIds = (payload.productIds ?? [])\n\t\t\t.filter(id => mongoose.isValidObjectId(id))\n\t\t\t.map(id => new mongoose.Types.ObjectId(id));\n\n\t\tif (!productIds.length) return;\n\n\t\tconst MAX_ATTEMPTS = 3;\n\t\tlet lastError: unknown;\n\n\t\tfor (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {\n\t\t\ttry {\n\t\t\t\tconst upserted = await productMarketingService.upsertProductMarketingsForPage({\n\t\t\t\t\tmarketingId,\n\t\t\t\t\tproductIds,\n\t\t\t\t\tisAppliedByCompany: payload.isAppliedByCompany,\n\t\t\t\t\tisBuy1Get1: payload.isBuy1Get1,\n\t\t\t\t\tvalue: payload.value,\n\t\t\t\t\tvalueType: payload.valueType,\n\t\t\t\t});\n\n\t\t\t\tif (upserted.length) {\n\t\t\t\t\tawait synchronizeProductMarketingService.syncProductMarketingInfoByProductIds(upserted);\n\t\t\t\t}\n\n\t\t\t\tpublishSyncSingleShopSectionsInCacheProcessEvent({\n\t\t\t\t\tshopId,\n\t\t\t\t\toperation: ChangeStreamOperationTypes.UPDATE,\n\t\t\t\t});\n\n\t\t\t\tlogger.debug(`entire-menu seed done — ${upserted.length} products updated`, {\n\t\t\t\t\ttag: 'marketing.seed.entire-menu',\n\t\t\t\t\tdata: { marketingId: mid, shopId: sid, count: upserted.length },\n\t\t\t\t});\n\n\t\t\t\treturn;\n\t\t\t} catch (error) {\n\t\t\t\tlastError = error;\n\t\t\t\tif (attempt < MAX_ATTEMPTS) {\n\t\t\t\t\tawait new Promise(resolve => setTimeout(resolve, 2000 * attempt));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlogger.error(`entire-menu seed failed after ${MAX_ATTEMPTS} attempts — manual reseed required`, lastError, {\n\t\t\ttag: 'marketing.seed.entire-menu',\n\t\t\tdata: { marketingId: mid, shopId: sid, count: productIds.length },\n\t\t});\n\t}));\n}\n\nexport async function subscribeToMarketingProductSyncEvent() {\n\tawait subscribeToEvent(\n\t\tMARKETING_PRODUCT_SYNC_EVENT,\n\t\tnoRequeue('marketing-product-sync', async (payload: MarketingProductSyncPayload) => {\n\t\t\tconst logger = getLibraries().getLoggerKit();\n\t\t\tconst { marketingId: mid, shopId: sid } = payload;\n\n\t\t\tif (!mongoose.isValidObjectId(mid) || !mongoose.isValidObjectId(sid)) {\n\t\t\t\tlogger.error('marketing-product-sync: invalid ids — dropping message', null, {\n\t\t\t\t\ttag: 'marketing.product-sync',\n\t\t\t\t\tdata: { marketingId: mid, shopId: sid },\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst shopId = new mongoose.Types.ObjectId(sid);\n\t\t\tconst productIds = (payload.productIds ?? [])\n\t\t\t\t.filter(id => mongoose.isValidObjectId(id))\n\t\t\t\t.map(id => new mongoose.Types.ObjectId(id));\n\n\t\t\tif (!productIds.length) return;\n\n\t\t\tconst MAX_ATTEMPTS = 3;\n\t\t\tlet lastError: unknown;\n\n\t\t\tfor (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {\n\t\t\t\ttry {\n\t\t\t\t\tawait synchronizeProductMarketingService.syncProductMarketingInfoByProductIds(productIds);\n\n\t\t\t\t\tpublishSyncSingleShopSectionsInCacheProcessEvent({\n\t\t\t\t\t\tshopId,\n\t\t\t\t\t\toperation: ChangeStreamOperationTypes.UPDATE,\n\t\t\t\t\t});\n\n\t\t\t\t\tlogger.debug(`marketing-product-sync done — ${productIds.length} products`, {\n\t\t\t\t\t\ttag: 'marketing.product-sync',\n\t\t\t\t\t\tdata: { marketingId: mid, shopId: sid, count: productIds.length },\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tlastError = error;\n\t\t\t\t\tif (attempt < MAX_ATTEMPTS) {\n\t\t\t\t\t\tawait new Promise(resolve => setTimeout(resolve, 2000 * attempt));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlogger.error(`marketing-product-sync failed after ${MAX_ATTEMPTS} attempts`, lastError, {\n\t\t\t\ttag: 'marketing.product-sync',\n\t\t\t\tdata: { marketingId: mid, shopId: sid, count: productIds.length },\n\t\t\t});\n\t\t})\n\t);\n}\n\nexport async function subscribeToMarketingReturnPunchCouponEvent() {\n\tawait subscribeToEvent(PublishEventEnums.MARKETING_RETURN_PUNCH_COUPON_EVENT, async payload => {\n\t\tpunchMarketingHistoryService.returnPunchCoupon(payload.orderId);\n\t});\n}\n"]}
@@ -6,8 +6,7 @@ export interface MarketingProductSeedPayload {
6
6
  shopId: string;
7
7
  isAppliedByCompany: boolean;
8
8
  isBuy1Get1: boolean;
9
- page: number;
10
- pageSize: number;
9
+ productIds: string[];
11
10
  value?: number;
12
11
  valueType?: ValueType;
13
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"marketing-product-seed.event.d.ts","sourceRoot":"/","sources":["event/events/marketing-product-seed.event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE9D,eAAO,MAAM,gCAAgC,qCAAqC,CAAC;AAEnF,MAAM,WAAW,2BAA2B;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,OAAO,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,qBAAa,4BAA6B,SAAQ,SAAS,CAAC,2BAA2B,CAAC;gBAC3E,OAAO,EAAE,2BAA2B;CAGhD"}
1
+ {"version":3,"file":"marketing-product-seed.event.d.ts","sourceRoot":"/","sources":["event/events/marketing-product-seed.event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE9D,eAAO,MAAM,gCAAgC,qCAAqC,CAAC;AAEnF,MAAM,WAAW,2BAA2B;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,OAAO,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,qBAAa,4BAA6B,SAAQ,SAAS,CAAC,2BAA2B,CAAC;gBAC3E,OAAO,EAAE,2BAA2B;CAGhD"}
@@ -1 +1 @@
1
- {"version":3,"file":"marketing-product-seed.event.js","sourceRoot":"/","sources":["event/events/marketing-product-seed.event.ts"],"names":[],"mappings":";;;AAAA,4EAAyE;AAG5D,QAAA,gCAAgC,GAAG,kCAAkC,CAAC;AAanF,MAAa,4BAA6B,SAAQ,qBAAsC;IACvF,YAAY,OAAoC;QAC/C,KAAK,CAAC,wCAAgC,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;CACD;AAJD,oEAIC","sourcesContent":["import { BaseEvent } from '@lyxa.ai/core/dist/libraries/event/BaseEvent';\nimport { ValueType } from '@lyxa.ai/core/dist/utilities/enum';\n\nexport const MARKETING_ENTIRE_MENU_SEED_EVENT = 'marketing_entire_menu_seed_event';\n\nexport interface MarketingProductSeedPayload {\n\tmarketingId: string;\n\tshopId: string;\n\tisAppliedByCompany: boolean;\n\tisBuy1Get1: boolean;\n\tpage: number;\n\tpageSize: number;\n\tvalue?: number;\n\tvalueType?: ValueType;\n}\n\nexport class MarketingEntireMenuSeedEvent extends BaseEvent<MarketingProductSeedPayload> {\n\tconstructor(payload: MarketingProductSeedPayload) {\n\t\tsuper(MARKETING_ENTIRE_MENU_SEED_EVENT, payload);\n\t}\n}\n"]}
1
+ {"version":3,"file":"marketing-product-seed.event.js","sourceRoot":"/","sources":["event/events/marketing-product-seed.event.ts"],"names":[],"mappings":";;;AAAA,4EAAyE;AAG5D,QAAA,gCAAgC,GAAG,kCAAkC,CAAC;AAYnF,MAAa,4BAA6B,SAAQ,qBAAsC;IACvF,YAAY,OAAoC;QAC/C,KAAK,CAAC,wCAAgC,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;CACD;AAJD,oEAIC","sourcesContent":["import { BaseEvent } from '@lyxa.ai/core/dist/libraries/event/BaseEvent';\nimport { ValueType } from '@lyxa.ai/core/dist/utilities/enum';\n\nexport const MARKETING_ENTIRE_MENU_SEED_EVENT = 'marketing_entire_menu_seed_event';\n\nexport interface MarketingProductSeedPayload {\n\tmarketingId: string;\n\tshopId: string;\n\tisAppliedByCompany: boolean;\n\tisBuy1Get1: boolean;\n\tproductIds: string[];\n\tvalue?: number;\n\tvalueType?: ValueType;\n}\n\nexport class MarketingEntireMenuSeedEvent extends BaseEvent<MarketingProductSeedPayload> {\n\tconstructor(payload: MarketingProductSeedPayload) {\n\t\tsuper(MARKETING_ENTIRE_MENU_SEED_EVENT, payload);\n\t}\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import { BaseEvent } from '@lyxa.ai/core/dist/libraries/event/BaseEvent';
2
+ export declare const MARKETING_PRODUCT_SYNC_EVENT = "marketing_product_sync_event";
3
+ export interface MarketingProductSyncPayload {
4
+ marketingId: string;
5
+ shopId: string;
6
+ productIds: string[];
7
+ }
8
+ export declare class MarketingProductSyncEvent extends BaseEvent<MarketingProductSyncPayload> {
9
+ constructor(payload: MarketingProductSyncPayload);
10
+ }
11
+ //# sourceMappingURL=marketing-product-sync.event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marketing-product-sync.event.d.ts","sourceRoot":"/","sources":["event/events/marketing-product-sync.event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAEzE,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAE3E,MAAM,WAAW,2BAA2B;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,qBAAa,yBAA0B,SAAQ,SAAS,CAAC,2BAA2B,CAAC;gBACxE,OAAO,EAAE,2BAA2B;CAGhD"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MarketingProductSyncEvent = exports.MARKETING_PRODUCT_SYNC_EVENT = void 0;
4
+ const BaseEvent_1 = require("@lyxa.ai/core/dist/libraries/event/BaseEvent");
5
+ exports.MARKETING_PRODUCT_SYNC_EVENT = 'marketing_product_sync_event';
6
+ class MarketingProductSyncEvent extends BaseEvent_1.BaseEvent {
7
+ constructor(payload) {
8
+ super(exports.MARKETING_PRODUCT_SYNC_EVENT, payload);
9
+ }
10
+ }
11
+ exports.MarketingProductSyncEvent = MarketingProductSyncEvent;
12
+ //# sourceMappingURL=marketing-product-sync.event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marketing-product-sync.event.js","sourceRoot":"/","sources":["event/events/marketing-product-sync.event.ts"],"names":[],"mappings":";;;AAAA,4EAAyE;AAE5D,QAAA,4BAA4B,GAAG,8BAA8B,CAAC;AAQ3E,MAAa,yBAA0B,SAAQ,qBAAsC;IACpF,YAAY,OAAoC;QAC/C,KAAK,CAAC,oCAA4B,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;CACD;AAJD,8DAIC","sourcesContent":["import { BaseEvent } from '@lyxa.ai/core/dist/libraries/event/BaseEvent';\n\nexport const MARKETING_PRODUCT_SYNC_EVENT = 'marketing_product_sync_event';\n\nexport interface MarketingProductSyncPayload {\n\tmarketingId: string;\n\tshopId: string;\n\tproductIds: string[];\n}\n\nexport class MarketingProductSyncEvent extends BaseEvent<MarketingProductSyncPayload> {\n\tconstructor(payload: MarketingProductSyncPayload) {\n\t\tsuper(MARKETING_PRODUCT_SYNC_EVENT, payload);\n\t}\n}\n"]}