legend-transactional 2.6.2 → 2.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -43,6 +43,10 @@ declare const availableMicroservices: {
43
43
  * Represents the "rankings" microservice.
44
44
  */
45
45
  readonly Rankings: "rankings";
46
+ /**
47
+ * Represents the "legend-events" microservice.
48
+ */
49
+ readonly Events: "legend-events";
46
50
  /**
47
51
  * Represents the "transactional" microservice.
48
52
  */
@@ -74,7 +78,7 @@ type AvailableMicroservices = (typeof availableMicroservices)[keyof typeof avail
74
78
  */
75
79
  interface RankingWinners {
76
80
  userId: string;
77
- reward: number;
81
+ reward: string;
78
82
  }
79
83
  /**
80
84
  * Represents a completed ranking with its title, reward type, and winners
@@ -582,6 +586,115 @@ interface EventPayload {
582
586
  expiredAt: string;
583
587
  occurredAt: string;
584
588
  };
589
+ /**
590
+ * New event created
591
+ */
592
+ 'legend_events.new_event_created': {
593
+ eventId: number;
594
+ title: string;
595
+ description: string;
596
+ authorEmail: string;
597
+ rewardType?: string;
598
+ startDate: string;
599
+ endDate: string;
600
+ maxPlayers?: number;
601
+ ticketPriceUsd?: number;
602
+ isFreeTournament: boolean;
603
+ notificationConfig?: {
604
+ customEmails?: string[];
605
+ templateName: string;
606
+ };
607
+ };
608
+ /**
609
+ * Event has started
610
+ */
611
+ 'legend_events.event_started': {
612
+ eventId: number;
613
+ title: string;
614
+ startedAt: string;
615
+ };
616
+ /**
617
+ * Event has ended
618
+ */
619
+ 'legend_events.event_ended': {
620
+ eventId: number;
621
+ title: string;
622
+ endedAt: string;
623
+ totalParticipants: number;
624
+ };
625
+ /**
626
+ * Player registered for an event (paid or free)
627
+ */
628
+ 'legend_events.player_registered': {
629
+ eventId: number;
630
+ userId: string;
631
+ paymentId?: string;
632
+ amountPaid?: number;
633
+ isFree: boolean;
634
+ registeredAt: string;
635
+ };
636
+ /**
637
+ * Player joined the waitlist (event full)
638
+ */
639
+ 'legend_events.player_joined_waitlist': {
640
+ eventId: number;
641
+ userId: string;
642
+ position: number;
643
+ joinedAt: string;
644
+ };
645
+ /**
646
+ * Score submitted for an event
647
+ */
648
+ 'legend_events.score_submitted': {
649
+ eventId: number;
650
+ userId: string;
651
+ score: number;
652
+ totalScore: number;
653
+ matchId?: string;
654
+ submittedAt: string;
655
+ };
656
+ /**
657
+ * Events have finished, send emails to winners
658
+ */
659
+ 'legend_events.events_finished': {
660
+ completedEvents: Array<{
661
+ eventId: number;
662
+ title: string;
663
+ description: string;
664
+ authorEmail: string;
665
+ endsAt: string;
666
+ reward?: string;
667
+ rewardType?: string;
668
+ winners: Array<{
669
+ userId: string;
670
+ position: number;
671
+ score: number;
672
+ }>;
673
+ notificationConfig?: Record<string, unknown>;
674
+ }>;
675
+ };
676
+ /**
677
+ * Intermediate reward delivered during event
678
+ */
679
+ 'legend_events.intermediate_reward': {
680
+ userId: string;
681
+ eventId: number;
682
+ intermediateRewardType: string;
683
+ rewardConfig: Record<string, unknown>;
684
+ templateName: string;
685
+ templateData: Record<string, unknown>;
686
+ };
687
+ /**
688
+ * Participation reward delivered post-event
689
+ */
690
+ 'legend_events.participation_reward': {
691
+ userId: string;
692
+ eventId: number;
693
+ participationRewardType: string;
694
+ rewardConfig: Record<string, unknown>;
695
+ templateName: string;
696
+ templateData: Record<string, unknown>;
697
+ };
585
698
  }
586
699
  /**
587
700
  * Represents the available events in the system.
@@ -623,6 +736,15 @@ declare const microserviceEvent: {
623
736
  readonly 'BILLING.SUBSCRIPTION_RENEWED': "billing.subscription_renewed";
624
737
  readonly 'BILLING.SUBSCRIPTION_CANCELED': "billing.subscription_canceled";
625
738
  readonly 'BILLING.SUBSCRIPTION_EXPIRED': "billing.subscription_expired";
739
+ readonly 'LEGEND_EVENTS.NEW_EVENT_CREATED': "legend_events.new_event_created";
740
+ readonly 'LEGEND_EVENTS.EVENT_STARTED': "legend_events.event_started";
741
+ readonly 'LEGEND_EVENTS.EVENT_ENDED': "legend_events.event_ended";
742
+ readonly 'LEGEND_EVENTS.PLAYER_REGISTERED': "legend_events.player_registered";
743
+ readonly 'LEGEND_EVENTS.PLAYER_JOINED_WAITLIST': "legend_events.player_joined_waitlist";
744
+ readonly 'LEGEND_EVENTS.SCORE_SUBMITTED': "legend_events.score_submitted";
745
+ readonly 'LEGEND_EVENTS.EVENTS_FINISHED': "legend_events.events_finished";
746
+ readonly 'LEGEND_EVENTS.INTERMEDIATE_REWARD': "legend_events.intermediate_reward";
747
+ readonly 'LEGEND_EVENTS.PARTICIPATION_REWARD': "legend_events.participation_reward";
626
748
  };
627
749
  /**
628
750
  * Available microservices events in the system.
@@ -1045,6 +1167,15 @@ declare const billingCommands: {};
1045
1167
  */
1046
1168
  type BillingCommands = (typeof billingCommands)[keyof typeof billingCommands];
1047
1169
 
1170
+ /**
1171
+ * Different commands related to the "legend-events" microservice.
1172
+ */
1173
+ declare const legendEventsCommands: {};
1174
+ /**
1175
+ * Available commands for the "legend-events" microservice.
1176
+ */
1177
+ type LegendEventsCommands = (typeof legendEventsCommands)[keyof typeof legendEventsCommands];
1178
+
1048
1179
  /**
1049
1180
  * A map that defines the relationship between microservices and their corresponding commands.
1050
1181
  */
@@ -1103,6 +1234,10 @@ interface CommandMap {
1103
1234
  * Represents the mapping of "transactional" microservice commands.
1104
1235
  */
1105
1236
  [availableMicroservices.Transactional]: TransactionalCommands;
1237
+ /**
1238
+ * Represents the mapping of "legend-events" microservice commands.
1239
+ */
1240
+ [availableMicroservices.Events]: LegendEventsCommands;
1106
1241
  }
1107
1242
  /**
1108
1243
  * Represents a command specific to a microservice.
package/dist/index.d.ts CHANGED
@@ -43,6 +43,10 @@ declare const availableMicroservices: {
43
43
  * Represents the "rankings" microservice.
44
44
  */
45
45
  readonly Rankings: "rankings";
46
+ /**
47
+ * Represents the "legend-events" microservice.
48
+ */
49
+ readonly Events: "legend-events";
46
50
  /**
47
51
  * Represents the "transactional" microservice.
48
52
  */
@@ -74,7 +78,7 @@ type AvailableMicroservices = (typeof availableMicroservices)[keyof typeof avail
74
78
  */
75
79
  interface RankingWinners {
76
80
  userId: string;
77
- reward: number;
81
+ reward: string;
78
82
  }
79
83
  /**
80
84
  * Represents a completed ranking with its title, reward type, and winners
@@ -582,6 +586,115 @@ interface EventPayload {
582
586
  expiredAt: string;
583
587
  occurredAt: string;
584
588
  };
589
+ /**
590
+ * New event created
591
+ */
592
+ 'legend_events.new_event_created': {
593
+ eventId: number;
594
+ title: string;
595
+ description: string;
596
+ authorEmail: string;
597
+ rewardType?: string;
598
+ startDate: string;
599
+ endDate: string;
600
+ maxPlayers?: number;
601
+ ticketPriceUsd?: number;
602
+ isFreeTournament: boolean;
603
+ notificationConfig?: {
604
+ customEmails?: string[];
605
+ templateName: string;
606
+ };
607
+ };
608
+ /**
609
+ * Event has started
610
+ */
611
+ 'legend_events.event_started': {
612
+ eventId: number;
613
+ title: string;
614
+ startedAt: string;
615
+ };
616
+ /**
617
+ * Event has ended
618
+ */
619
+ 'legend_events.event_ended': {
620
+ eventId: number;
621
+ title: string;
622
+ endedAt: string;
623
+ totalParticipants: number;
624
+ };
625
+ /**
626
+ * Player registered for an event (paid or free)
627
+ */
628
+ 'legend_events.player_registered': {
629
+ eventId: number;
630
+ userId: string;
631
+ paymentId?: string;
632
+ amountPaid?: number;
633
+ isFree: boolean;
634
+ registeredAt: string;
635
+ };
636
+ /**
637
+ * Player joined the waitlist (event full)
638
+ */
639
+ 'legend_events.player_joined_waitlist': {
640
+ eventId: number;
641
+ userId: string;
642
+ position: number;
643
+ joinedAt: string;
644
+ };
645
+ /**
646
+ * Score submitted for an event
647
+ */
648
+ 'legend_events.score_submitted': {
649
+ eventId: number;
650
+ userId: string;
651
+ score: number;
652
+ totalScore: number;
653
+ matchId?: string;
654
+ submittedAt: string;
655
+ };
656
+ /**
657
+ * Events have finished, send emails to winners
658
+ */
659
+ 'legend_events.events_finished': {
660
+ completedEvents: Array<{
661
+ eventId: number;
662
+ title: string;
663
+ description: string;
664
+ authorEmail: string;
665
+ endsAt: string;
666
+ reward?: string;
667
+ rewardType?: string;
668
+ winners: Array<{
669
+ userId: string;
670
+ position: number;
671
+ score: number;
672
+ }>;
673
+ notificationConfig?: Record<string, unknown>;
674
+ }>;
675
+ };
676
+ /**
677
+ * Intermediate reward delivered during event
678
+ */
679
+ 'legend_events.intermediate_reward': {
680
+ userId: string;
681
+ eventId: number;
682
+ intermediateRewardType: string;
683
+ rewardConfig: Record<string, unknown>;
684
+ templateName: string;
685
+ templateData: Record<string, unknown>;
686
+ };
687
+ /**
688
+ * Participation reward delivered post-event
689
+ */
690
+ 'legend_events.participation_reward': {
691
+ userId: string;
692
+ eventId: number;
693
+ participationRewardType: string;
694
+ rewardConfig: Record<string, unknown>;
695
+ templateName: string;
696
+ templateData: Record<string, unknown>;
697
+ };
585
698
  }
586
699
  /**
587
700
  * Represents the available events in the system.
@@ -623,6 +736,15 @@ declare const microserviceEvent: {
623
736
  readonly 'BILLING.SUBSCRIPTION_RENEWED': "billing.subscription_renewed";
624
737
  readonly 'BILLING.SUBSCRIPTION_CANCELED': "billing.subscription_canceled";
625
738
  readonly 'BILLING.SUBSCRIPTION_EXPIRED': "billing.subscription_expired";
739
+ readonly 'LEGEND_EVENTS.NEW_EVENT_CREATED': "legend_events.new_event_created";
740
+ readonly 'LEGEND_EVENTS.EVENT_STARTED': "legend_events.event_started";
741
+ readonly 'LEGEND_EVENTS.EVENT_ENDED': "legend_events.event_ended";
742
+ readonly 'LEGEND_EVENTS.PLAYER_REGISTERED': "legend_events.player_registered";
743
+ readonly 'LEGEND_EVENTS.PLAYER_JOINED_WAITLIST': "legend_events.player_joined_waitlist";
744
+ readonly 'LEGEND_EVENTS.SCORE_SUBMITTED': "legend_events.score_submitted";
745
+ readonly 'LEGEND_EVENTS.EVENTS_FINISHED': "legend_events.events_finished";
746
+ readonly 'LEGEND_EVENTS.INTERMEDIATE_REWARD': "legend_events.intermediate_reward";
747
+ readonly 'LEGEND_EVENTS.PARTICIPATION_REWARD': "legend_events.participation_reward";
626
748
  };
627
749
  /**
628
750
  * Available microservices events in the system.
@@ -1045,6 +1167,15 @@ declare const billingCommands: {};
1045
1167
  */
1046
1168
  type BillingCommands = (typeof billingCommands)[keyof typeof billingCommands];
1047
1169
 
1170
+ /**
1171
+ * Different commands related to the "legend-events" microservice.
1172
+ */
1173
+ declare const legendEventsCommands: {};
1174
+ /**
1175
+ * Available commands for the "legend-events" microservice.
1176
+ */
1177
+ type LegendEventsCommands = (typeof legendEventsCommands)[keyof typeof legendEventsCommands];
1178
+
1048
1179
  /**
1049
1180
  * A map that defines the relationship between microservices and their corresponding commands.
1050
1181
  */
@@ -1103,6 +1234,10 @@ interface CommandMap {
1103
1234
  * Represents the mapping of "transactional" microservice commands.
1104
1235
  */
1105
1236
  [availableMicroservices.Transactional]: TransactionalCommands;
1237
+ /**
1238
+ * Represents the mapping of "legend-events" microservice commands.
1239
+ */
1240
+ [availableMicroservices.Events]: LegendEventsCommands;
1106
1241
  }
1107
1242
  /**
1108
1243
  * Represents a command specific to a microservice.
package/dist/index.js CHANGED
@@ -48,6 +48,10 @@ var availableMicroservices = {
48
48
  * Represents the "rankings" microservice.
49
49
  */
50
50
  Rankings: "rankings",
51
+ /**
52
+ * Represents the "legend-events" microservice.
53
+ */
54
+ Events: "legend-events",
51
55
  /**
52
56
  * Represents the "transactional" microservice.
53
57
  */
@@ -117,7 +121,18 @@ var microserviceEvent = {
117
121
  "BILLING.SUBSCRIPTION_UPDATED": "billing.subscription_updated",
118
122
  "BILLING.SUBSCRIPTION_RENEWED": "billing.subscription_renewed",
119
123
  "BILLING.SUBSCRIPTION_CANCELED": "billing.subscription_canceled",
120
- "BILLING.SUBSCRIPTION_EXPIRED": "billing.subscription_expired"
124
+ "BILLING.SUBSCRIPTION_EXPIRED": "billing.subscription_expired",
125
+ ///////////////////////////
126
+ // LEGEND EVENTS
127
+ "LEGEND_EVENTS.NEW_EVENT_CREATED": "legend_events.new_event_created",
128
+ "LEGEND_EVENTS.EVENT_STARTED": "legend_events.event_started",
129
+ "LEGEND_EVENTS.EVENT_ENDED": "legend_events.event_ended",
130
+ "LEGEND_EVENTS.PLAYER_REGISTERED": "legend_events.player_registered",
131
+ "LEGEND_EVENTS.PLAYER_JOINED_WAITLIST": "legend_events.player_joined_waitlist",
132
+ "LEGEND_EVENTS.SCORE_SUBMITTED": "legend_events.score_submitted",
133
+ "LEGEND_EVENTS.EVENTS_FINISHED": "legend_events.events_finished",
134
+ "LEGEND_EVENTS.INTERMEDIATE_REWARD": "legend_events.intermediate_reward",
135
+ "LEGEND_EVENTS.PARTICIPATION_REWARD": "legend_events.participation_reward"
121
136
  };
122
137
 
123
138
  // src/@types/rabbit-mq.ts
package/dist/index.mjs CHANGED
@@ -41,6 +41,10 @@ var availableMicroservices = {
41
41
  * Represents the "rankings" microservice.
42
42
  */
43
43
  Rankings: "rankings",
44
+ /**
45
+ * Represents the "legend-events" microservice.
46
+ */
47
+ Events: "legend-events",
44
48
  /**
45
49
  * Represents the "transactional" microservice.
46
50
  */
@@ -110,7 +114,18 @@ var microserviceEvent = {
110
114
  "BILLING.SUBSCRIPTION_UPDATED": "billing.subscription_updated",
111
115
  "BILLING.SUBSCRIPTION_RENEWED": "billing.subscription_renewed",
112
116
  "BILLING.SUBSCRIPTION_CANCELED": "billing.subscription_canceled",
113
- "BILLING.SUBSCRIPTION_EXPIRED": "billing.subscription_expired"
117
+ "BILLING.SUBSCRIPTION_EXPIRED": "billing.subscription_expired",
118
+ ///////////////////////////
119
+ // LEGEND EVENTS
120
+ "LEGEND_EVENTS.NEW_EVENT_CREATED": "legend_events.new_event_created",
121
+ "LEGEND_EVENTS.EVENT_STARTED": "legend_events.event_started",
122
+ "LEGEND_EVENTS.EVENT_ENDED": "legend_events.event_ended",
123
+ "LEGEND_EVENTS.PLAYER_REGISTERED": "legend_events.player_registered",
124
+ "LEGEND_EVENTS.PLAYER_JOINED_WAITLIST": "legend_events.player_joined_waitlist",
125
+ "LEGEND_EVENTS.SCORE_SUBMITTED": "legend_events.score_submitted",
126
+ "LEGEND_EVENTS.EVENTS_FINISHED": "legend_events.events_finished",
127
+ "LEGEND_EVENTS.INTERMEDIATE_REWARD": "legend_events.intermediate_reward",
128
+ "LEGEND_EVENTS.PARTICIPATION_REWARD": "legend_events.participation_reward"
114
129
  };
115
130
 
116
131
  // src/@types/rabbit-mq.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "legend-transactional",
3
- "version": "2.6.2",
3
+ "version": "2.6.4",
4
4
  "description": "A simple transactional, event-driven communication framework for microservices using RabbitMQ",
5
5
  "author": "Jorge Clavijo <jym272@gmail.com> (https://github.com/jym272)",
6
6
  "license": "MIT",