legend-transactional 2.6.1 → 2.6.2

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
@@ -16,10 +16,21 @@ declare const availableMicroservices: {
16
16
  * Represents the "Mint" test microservice.
17
17
  */
18
18
  readonly TestMint: "test-mint";
19
+ /**
20
+ * Represents the "audit-eda" microservice for event-driven architecture auditing.
21
+ * This microservice consumes audit events (audit.received, audit.processed, audit.dead_letter)
22
+ * to track event lifecycle and debugging purposes.
23
+ */
24
+ readonly AuditEda: "audit-eda";
19
25
  /**
20
26
  * Represents the "auth" microservice.
21
27
  */
22
28
  readonly Auth: "auth";
29
+ /**
30
+ * Represents the "legend-billing" microservice.
31
+ * Handles payment processing, subscriptions, and billing domain events.
32
+ */
33
+ readonly Billing: "billing";
23
34
  /**
24
35
  * Represents the "blockchain" microservice.
25
36
  */
@@ -52,30 +63,12 @@ declare const availableMicroservices: {
52
63
  * Represents the "legend-storage" microservice.
53
64
  */
54
65
  readonly Storage: "legend-storage";
55
- /**
56
- * Represents the "audit-eda" microservice for event-driven architecture auditing.
57
- * This microservice consumes audit events (audit.received, audit.processed, audit.dead_letter)
58
- * to track event lifecycle and debugging purposes.
59
- */
60
- readonly AuditEda: "audit-eda";
61
66
  };
62
67
  /**
63
68
  * Type of available microservices in the system.
64
69
  */
65
70
  type AvailableMicroservices = (typeof availableMicroservices)[keyof typeof availableMicroservices];
66
71
 
67
- /**
68
- * Types of Payment Email Types
69
- */
70
- declare const PaymentEmailTypes: {
71
- readonly PURCHASE: "purchase";
72
- readonly SUBSCRIPTION: "subscription";
73
- readonly NEW_SUBSCRIPTION: "new_subscription";
74
- };
75
- /**
76
- * Type of Payment Email Types
77
- */
78
- type PaymentEmailType = (typeof PaymentEmailTypes)[keyof typeof PaymentEmailTypes];
79
72
  /**
80
73
  * Represents the winners of a ranking with their respective rewards
81
74
  */
@@ -481,6 +474,114 @@ interface EventPayload {
481
474
  */
482
475
  event_id: string;
483
476
  };
477
+ /**
478
+ * Payment has been created and is pending
479
+ */
480
+ 'billing.payment_created': {
481
+ paymentId: string;
482
+ userId: string;
483
+ amount: number;
484
+ currency: string;
485
+ status: 'pending' | 'processing';
486
+ metadata: Record<string, string>;
487
+ occurredAt: string;
488
+ };
489
+ /**
490
+ * Payment completed successfully
491
+ */
492
+ 'billing.payment_succeeded': {
493
+ paymentId: string;
494
+ userId: string;
495
+ amount: number;
496
+ currency: string;
497
+ metadata: Record<string, string>;
498
+ occurredAt: string;
499
+ };
500
+ /**
501
+ * Payment failed
502
+ */
503
+ 'billing.payment_failed': {
504
+ paymentId: string;
505
+ userId: string;
506
+ amount: number;
507
+ currency: string;
508
+ failureReason: string | null;
509
+ metadata: Record<string, string>;
510
+ occurredAt: string;
511
+ };
512
+ /**
513
+ * Payment was refunded (fully or partially)
514
+ */
515
+ 'billing.payment_refunded': {
516
+ paymentId: string;
517
+ userId: string;
518
+ amount: number;
519
+ refundedAmount: number;
520
+ currency: string;
521
+ metadata: Record<string, string>;
522
+ occurredAt: string;
523
+ };
524
+ /**
525
+ * New subscription created
526
+ */
527
+ 'billing.subscription_created': {
528
+ subscriptionId: string;
529
+ userId: string;
530
+ planId: string;
531
+ planSlug: string;
532
+ status: 'pending' | 'active' | 'trialing';
533
+ periodStart: string;
534
+ periodEnd: string;
535
+ occurredAt: string;
536
+ };
537
+ /**
538
+ * Subscription was updated (plan change, status change, etc.)
539
+ */
540
+ 'billing.subscription_updated': {
541
+ subscriptionId: string;
542
+ userId: string;
543
+ planId: string;
544
+ planSlug: string;
545
+ status: 'active' | 'past_due' | 'unpaid' | 'paused' | 'trialing';
546
+ cancelAtPeriodEnd: boolean;
547
+ periodStart: string;
548
+ periodEnd: string;
549
+ occurredAt: string;
550
+ };
551
+ /**
552
+ * Subscription was renewed (new billing period started)
553
+ */
554
+ 'billing.subscription_renewed': {
555
+ subscriptionId: string;
556
+ userId: string;
557
+ planId: string;
558
+ planSlug: string;
559
+ periodStart: string;
560
+ periodEnd: string;
561
+ occurredAt: string;
562
+ };
563
+ /**
564
+ * Subscription was canceled (still active until period end)
565
+ */
566
+ 'billing.subscription_canceled': {
567
+ subscriptionId: string;
568
+ userId: string;
569
+ planId: string;
570
+ planSlug: string;
571
+ canceledAt: string;
572
+ occurredAt: string;
573
+ };
574
+ /**
575
+ * Subscription has expired (no longer active)
576
+ */
577
+ 'billing.subscription_expired': {
578
+ subscriptionId: string;
579
+ userId: string;
580
+ planId: string;
581
+ planSlug: string;
582
+ expiredAt: string;
583
+ occurredAt: string;
584
+ };
484
585
  }
485
586
  /**
486
587
  * Represents the available events in the system.
@@ -513,6 +614,15 @@ declare const microserviceEvent: {
513
614
  readonly 'SOCIAL.NEW_USER': "social.new_user";
514
615
  readonly 'SOCIAL.UNBLOCK_CHAT': "social.unblock_chat";
515
616
  readonly 'SOCIAL.UPDATED_USER': "social.updated_user";
617
+ readonly 'BILLING.PAYMENT_CREATED': "billing.payment_created";
618
+ readonly 'BILLING.PAYMENT_SUCCEEDED': "billing.payment_succeeded";
619
+ readonly 'BILLING.PAYMENT_FAILED': "billing.payment_failed";
620
+ readonly 'BILLING.PAYMENT_REFUNDED': "billing.payment_refunded";
621
+ readonly 'BILLING.SUBSCRIPTION_CREATED': "billing.subscription_created";
622
+ readonly 'BILLING.SUBSCRIPTION_UPDATED': "billing.subscription_updated";
623
+ readonly 'BILLING.SUBSCRIPTION_RENEWED': "billing.subscription_renewed";
624
+ readonly 'BILLING.SUBSCRIPTION_CANCELED': "billing.subscription_canceled";
625
+ readonly 'BILLING.SUBSCRIPTION_EXPIRED': "billing.subscription_expired";
516
626
  };
517
627
  /**
518
628
  * Available microservices events in the system.
@@ -926,6 +1036,15 @@ declare const transactionalCommands: {};
926
1036
  */
927
1037
  type TransactionalCommands = (typeof transactionalCommands)[keyof typeof transactionalCommands];
928
1038
 
1039
+ /**
1040
+ * Different commands related to the "billing" microservice.
1041
+ */
1042
+ declare const billingCommands: {};
1043
+ /**
1044
+ * Available commands for the "billing" microservice.
1045
+ */
1046
+ type BillingCommands = (typeof billingCommands)[keyof typeof billingCommands];
1047
+
929
1048
  /**
930
1049
  * A map that defines the relationship between microservices and their corresponding commands.
931
1050
  */
@@ -948,6 +1067,10 @@ interface CommandMap {
948
1067
  * Represents the mapping of "audit-eda" microservice commands.
949
1068
  */
950
1069
  [availableMicroservices.AuditEda]: AuditEdaCommands;
1070
+ /**
1071
+ * Represents the mapping of "legend-billing" microservice commands.
1072
+ */
1073
+ [availableMicroservices.Billing]: BillingCommands;
951
1074
  /**
952
1075
  * Represents the mapping of "blockchain" microservice commands.
953
1076
  */
@@ -1639,4 +1762,4 @@ declare const getEventObject: (event: MicroserviceEvent) => {
1639
1762
  */
1640
1763
  declare function extractMicroserviceFromQueue(queueName: string): string;
1641
1764
 
1642
- export { type AuditEdaCommands, type AuthCommands, type AvailableMicroservices, type BlockchainCommands, type CommandMap, type CommenceSaga, type CommenceSagaEvents, type CommenceSagaHandler, type CompletedRanking, type EventPayload, EventsConsumeChannel, type EventsHandler, type Exchange, type Gender, MAX_NACK_RETRIES, MAX_OCCURRENCE, type MicroserviceCommand, MicroserviceConsumeChannel, type MicroserviceConsumeEvents, type MicroserviceConsumeSagaEvents, type MicroserviceEvent, type MicroserviceHandler, NACKING_DELAY_MS, type Nack, type PaymentEmailType, PaymentEmailTypes, type QueueConsumerProps, type RankingWinners, type RankingsCommands, Saga, SagaCommenceConsumeChannel, type SagaCommencePayload, SagaConsumeChannel, type SagaConsumeSagaEvents, type SagaHandler, type SagaStep, type SagaStepDefaults, type SagaTitle, type SendEmailCommands, type ShowcaseCommands, type SocialCommands, type SocialUser, type Status, type StorageCommands, type TestImageCommands, type TestMintCommands, Transactional, type TransactionalCommands, type TransactionalConfig, type UserLocation, auditEdaCommands, authCommands, availableMicroservices, blockchainCommands, closeConsumeChannel, closeRabbitMQConn, closeSendChannel, commenceSaga, commenceSagaConsumeCallback, consume, createAuditLoggingResources, createConsumers, createHeaderConsumers, eventCallback, exchange, extractMicroserviceFromQueue, fibonacci, gender, getConsumeChannel, getEventKey, getEventObject, getQueueConsumer, getQueueName, getRabbitMQConn, getSendChannel, getStoredConfig, isConnectionHealthy, microserviceEvent, nodeDataDefaults, publishEvent, queue, rankingsCommands, sagaConsumeCallback, sagaStepCallback, sagaTitle, saveQueueForHealthCheck, sendEmailCommands, sendToQueue, showcaseCommands, socialCommands, status, stopRabbitMQ, storageCommands, testImageCommands, testMintCommands, transactionalCommands };
1765
+ export { type AuditEdaCommands, type AuthCommands, type AvailableMicroservices, type BlockchainCommands, type CommandMap, type CommenceSaga, type CommenceSagaEvents, type CommenceSagaHandler, type CompletedRanking, type EventPayload, EventsConsumeChannel, type EventsHandler, type Exchange, type Gender, MAX_NACK_RETRIES, MAX_OCCURRENCE, type MicroserviceCommand, MicroserviceConsumeChannel, type MicroserviceConsumeEvents, type MicroserviceConsumeSagaEvents, type MicroserviceEvent, type MicroserviceHandler, NACKING_DELAY_MS, type Nack, type QueueConsumerProps, type RankingWinners, type RankingsCommands, Saga, SagaCommenceConsumeChannel, type SagaCommencePayload, SagaConsumeChannel, type SagaConsumeSagaEvents, type SagaHandler, type SagaStep, type SagaStepDefaults, type SagaTitle, type SendEmailCommands, type ShowcaseCommands, type SocialCommands, type SocialUser, type Status, type StorageCommands, type TestImageCommands, type TestMintCommands, Transactional, type TransactionalCommands, type TransactionalConfig, type UserLocation, auditEdaCommands, authCommands, availableMicroservices, blockchainCommands, closeConsumeChannel, closeRabbitMQConn, closeSendChannel, commenceSaga, commenceSagaConsumeCallback, consume, createAuditLoggingResources, createConsumers, createHeaderConsumers, eventCallback, exchange, extractMicroserviceFromQueue, fibonacci, gender, getConsumeChannel, getEventKey, getEventObject, getQueueConsumer, getQueueName, getRabbitMQConn, getSendChannel, getStoredConfig, isConnectionHealthy, microserviceEvent, nodeDataDefaults, publishEvent, queue, rankingsCommands, sagaConsumeCallback, sagaStepCallback, sagaTitle, saveQueueForHealthCheck, sendEmailCommands, sendToQueue, showcaseCommands, socialCommands, status, stopRabbitMQ, storageCommands, testImageCommands, testMintCommands, transactionalCommands };
package/dist/index.d.ts CHANGED
@@ -16,10 +16,21 @@ declare const availableMicroservices: {
16
16
  * Represents the "Mint" test microservice.
17
17
  */
18
18
  readonly TestMint: "test-mint";
19
+ /**
20
+ * Represents the "audit-eda" microservice for event-driven architecture auditing.
21
+ * This microservice consumes audit events (audit.received, audit.processed, audit.dead_letter)
22
+ * to track event lifecycle and debugging purposes.
23
+ */
24
+ readonly AuditEda: "audit-eda";
19
25
  /**
20
26
  * Represents the "auth" microservice.
21
27
  */
22
28
  readonly Auth: "auth";
29
+ /**
30
+ * Represents the "legend-billing" microservice.
31
+ * Handles payment processing, subscriptions, and billing domain events.
32
+ */
33
+ readonly Billing: "billing";
23
34
  /**
24
35
  * Represents the "blockchain" microservice.
25
36
  */
@@ -52,30 +63,12 @@ declare const availableMicroservices: {
52
63
  * Represents the "legend-storage" microservice.
53
64
  */
54
65
  readonly Storage: "legend-storage";
55
- /**
56
- * Represents the "audit-eda" microservice for event-driven architecture auditing.
57
- * This microservice consumes audit events (audit.received, audit.processed, audit.dead_letter)
58
- * to track event lifecycle and debugging purposes.
59
- */
60
- readonly AuditEda: "audit-eda";
61
66
  };
62
67
  /**
63
68
  * Type of available microservices in the system.
64
69
  */
65
70
  type AvailableMicroservices = (typeof availableMicroservices)[keyof typeof availableMicroservices];
66
71
 
67
- /**
68
- * Types of Payment Email Types
69
- */
70
- declare const PaymentEmailTypes: {
71
- readonly PURCHASE: "purchase";
72
- readonly SUBSCRIPTION: "subscription";
73
- readonly NEW_SUBSCRIPTION: "new_subscription";
74
- };
75
- /**
76
- * Type of Payment Email Types
77
- */
78
- type PaymentEmailType = (typeof PaymentEmailTypes)[keyof typeof PaymentEmailTypes];
79
72
  /**
80
73
  * Represents the winners of a ranking with their respective rewards
81
74
  */
@@ -481,6 +474,114 @@ interface EventPayload {
481
474
  */
482
475
  event_id: string;
483
476
  };
477
+ /**
478
+ * Payment has been created and is pending
479
+ */
480
+ 'billing.payment_created': {
481
+ paymentId: string;
482
+ userId: string;
483
+ amount: number;
484
+ currency: string;
485
+ status: 'pending' | 'processing';
486
+ metadata: Record<string, string>;
487
+ occurredAt: string;
488
+ };
489
+ /**
490
+ * Payment completed successfully
491
+ */
492
+ 'billing.payment_succeeded': {
493
+ paymentId: string;
494
+ userId: string;
495
+ amount: number;
496
+ currency: string;
497
+ metadata: Record<string, string>;
498
+ occurredAt: string;
499
+ };
500
+ /**
501
+ * Payment failed
502
+ */
503
+ 'billing.payment_failed': {
504
+ paymentId: string;
505
+ userId: string;
506
+ amount: number;
507
+ currency: string;
508
+ failureReason: string | null;
509
+ metadata: Record<string, string>;
510
+ occurredAt: string;
511
+ };
512
+ /**
513
+ * Payment was refunded (fully or partially)
514
+ */
515
+ 'billing.payment_refunded': {
516
+ paymentId: string;
517
+ userId: string;
518
+ amount: number;
519
+ refundedAmount: number;
520
+ currency: string;
521
+ metadata: Record<string, string>;
522
+ occurredAt: string;
523
+ };
524
+ /**
525
+ * New subscription created
526
+ */
527
+ 'billing.subscription_created': {
528
+ subscriptionId: string;
529
+ userId: string;
530
+ planId: string;
531
+ planSlug: string;
532
+ status: 'pending' | 'active' | 'trialing';
533
+ periodStart: string;
534
+ periodEnd: string;
535
+ occurredAt: string;
536
+ };
537
+ /**
538
+ * Subscription was updated (plan change, status change, etc.)
539
+ */
540
+ 'billing.subscription_updated': {
541
+ subscriptionId: string;
542
+ userId: string;
543
+ planId: string;
544
+ planSlug: string;
545
+ status: 'active' | 'past_due' | 'unpaid' | 'paused' | 'trialing';
546
+ cancelAtPeriodEnd: boolean;
547
+ periodStart: string;
548
+ periodEnd: string;
549
+ occurredAt: string;
550
+ };
551
+ /**
552
+ * Subscription was renewed (new billing period started)
553
+ */
554
+ 'billing.subscription_renewed': {
555
+ subscriptionId: string;
556
+ userId: string;
557
+ planId: string;
558
+ planSlug: string;
559
+ periodStart: string;
560
+ periodEnd: string;
561
+ occurredAt: string;
562
+ };
563
+ /**
564
+ * Subscription was canceled (still active until period end)
565
+ */
566
+ 'billing.subscription_canceled': {
567
+ subscriptionId: string;
568
+ userId: string;
569
+ planId: string;
570
+ planSlug: string;
571
+ canceledAt: string;
572
+ occurredAt: string;
573
+ };
574
+ /**
575
+ * Subscription has expired (no longer active)
576
+ */
577
+ 'billing.subscription_expired': {
578
+ subscriptionId: string;
579
+ userId: string;
580
+ planId: string;
581
+ planSlug: string;
582
+ expiredAt: string;
583
+ occurredAt: string;
584
+ };
484
585
  }
485
586
  /**
486
587
  * Represents the available events in the system.
@@ -513,6 +614,15 @@ declare const microserviceEvent: {
513
614
  readonly 'SOCIAL.NEW_USER': "social.new_user";
514
615
  readonly 'SOCIAL.UNBLOCK_CHAT': "social.unblock_chat";
515
616
  readonly 'SOCIAL.UPDATED_USER': "social.updated_user";
617
+ readonly 'BILLING.PAYMENT_CREATED': "billing.payment_created";
618
+ readonly 'BILLING.PAYMENT_SUCCEEDED': "billing.payment_succeeded";
619
+ readonly 'BILLING.PAYMENT_FAILED': "billing.payment_failed";
620
+ readonly 'BILLING.PAYMENT_REFUNDED': "billing.payment_refunded";
621
+ readonly 'BILLING.SUBSCRIPTION_CREATED': "billing.subscription_created";
622
+ readonly 'BILLING.SUBSCRIPTION_UPDATED': "billing.subscription_updated";
623
+ readonly 'BILLING.SUBSCRIPTION_RENEWED': "billing.subscription_renewed";
624
+ readonly 'BILLING.SUBSCRIPTION_CANCELED': "billing.subscription_canceled";
625
+ readonly 'BILLING.SUBSCRIPTION_EXPIRED': "billing.subscription_expired";
516
626
  };
517
627
  /**
518
628
  * Available microservices events in the system.
@@ -926,6 +1036,15 @@ declare const transactionalCommands: {};
926
1036
  */
927
1037
  type TransactionalCommands = (typeof transactionalCommands)[keyof typeof transactionalCommands];
928
1038
 
1039
+ /**
1040
+ * Different commands related to the "billing" microservice.
1041
+ */
1042
+ declare const billingCommands: {};
1043
+ /**
1044
+ * Available commands for the "billing" microservice.
1045
+ */
1046
+ type BillingCommands = (typeof billingCommands)[keyof typeof billingCommands];
1047
+
929
1048
  /**
930
1049
  * A map that defines the relationship between microservices and their corresponding commands.
931
1050
  */
@@ -948,6 +1067,10 @@ interface CommandMap {
948
1067
  * Represents the mapping of "audit-eda" microservice commands.
949
1068
  */
950
1069
  [availableMicroservices.AuditEda]: AuditEdaCommands;
1070
+ /**
1071
+ * Represents the mapping of "legend-billing" microservice commands.
1072
+ */
1073
+ [availableMicroservices.Billing]: BillingCommands;
951
1074
  /**
952
1075
  * Represents the mapping of "blockchain" microservice commands.
953
1076
  */
@@ -1639,4 +1762,4 @@ declare const getEventObject: (event: MicroserviceEvent) => {
1639
1762
  */
1640
1763
  declare function extractMicroserviceFromQueue(queueName: string): string;
1641
1764
 
1642
- export { type AuditEdaCommands, type AuthCommands, type AvailableMicroservices, type BlockchainCommands, type CommandMap, type CommenceSaga, type CommenceSagaEvents, type CommenceSagaHandler, type CompletedRanking, type EventPayload, EventsConsumeChannel, type EventsHandler, type Exchange, type Gender, MAX_NACK_RETRIES, MAX_OCCURRENCE, type MicroserviceCommand, MicroserviceConsumeChannel, type MicroserviceConsumeEvents, type MicroserviceConsumeSagaEvents, type MicroserviceEvent, type MicroserviceHandler, NACKING_DELAY_MS, type Nack, type PaymentEmailType, PaymentEmailTypes, type QueueConsumerProps, type RankingWinners, type RankingsCommands, Saga, SagaCommenceConsumeChannel, type SagaCommencePayload, SagaConsumeChannel, type SagaConsumeSagaEvents, type SagaHandler, type SagaStep, type SagaStepDefaults, type SagaTitle, type SendEmailCommands, type ShowcaseCommands, type SocialCommands, type SocialUser, type Status, type StorageCommands, type TestImageCommands, type TestMintCommands, Transactional, type TransactionalCommands, type TransactionalConfig, type UserLocation, auditEdaCommands, authCommands, availableMicroservices, blockchainCommands, closeConsumeChannel, closeRabbitMQConn, closeSendChannel, commenceSaga, commenceSagaConsumeCallback, consume, createAuditLoggingResources, createConsumers, createHeaderConsumers, eventCallback, exchange, extractMicroserviceFromQueue, fibonacci, gender, getConsumeChannel, getEventKey, getEventObject, getQueueConsumer, getQueueName, getRabbitMQConn, getSendChannel, getStoredConfig, isConnectionHealthy, microserviceEvent, nodeDataDefaults, publishEvent, queue, rankingsCommands, sagaConsumeCallback, sagaStepCallback, sagaTitle, saveQueueForHealthCheck, sendEmailCommands, sendToQueue, showcaseCommands, socialCommands, status, stopRabbitMQ, storageCommands, testImageCommands, testMintCommands, transactionalCommands };
1765
+ export { type AuditEdaCommands, type AuthCommands, type AvailableMicroservices, type BlockchainCommands, type CommandMap, type CommenceSaga, type CommenceSagaEvents, type CommenceSagaHandler, type CompletedRanking, type EventPayload, EventsConsumeChannel, type EventsHandler, type Exchange, type Gender, MAX_NACK_RETRIES, MAX_OCCURRENCE, type MicroserviceCommand, MicroserviceConsumeChannel, type MicroserviceConsumeEvents, type MicroserviceConsumeSagaEvents, type MicroserviceEvent, type MicroserviceHandler, NACKING_DELAY_MS, type Nack, type QueueConsumerProps, type RankingWinners, type RankingsCommands, Saga, SagaCommenceConsumeChannel, type SagaCommencePayload, SagaConsumeChannel, type SagaConsumeSagaEvents, type SagaHandler, type SagaStep, type SagaStepDefaults, type SagaTitle, type SendEmailCommands, type ShowcaseCommands, type SocialCommands, type SocialUser, type Status, type StorageCommands, type TestImageCommands, type TestMintCommands, Transactional, type TransactionalCommands, type TransactionalConfig, type UserLocation, auditEdaCommands, authCommands, availableMicroservices, blockchainCommands, closeConsumeChannel, closeRabbitMQConn, closeSendChannel, commenceSaga, commenceSagaConsumeCallback, consume, createAuditLoggingResources, createConsumers, createHeaderConsumers, eventCallback, exchange, extractMicroserviceFromQueue, fibonacci, gender, getConsumeChannel, getEventKey, getEventObject, getQueueConsumer, getQueueName, getRabbitMQConn, getSendChannel, getStoredConfig, isConnectionHealthy, microserviceEvent, nodeDataDefaults, publishEvent, queue, rankingsCommands, sagaConsumeCallback, sagaStepCallback, sagaTitle, saveQueueForHealthCheck, sendEmailCommands, sendToQueue, showcaseCommands, socialCommands, status, stopRabbitMQ, storageCommands, testImageCommands, testMintCommands, transactionalCommands };
package/dist/index.js CHANGED
@@ -21,10 +21,21 @@ var availableMicroservices = {
21
21
  * Represents the "Mint" test microservice.
22
22
  */
23
23
  TestMint: "test-mint",
24
+ /**
25
+ * Represents the "audit-eda" microservice for event-driven architecture auditing.
26
+ * This microservice consumes audit events (audit.received, audit.processed, audit.dead_letter)
27
+ * to track event lifecycle and debugging purposes.
28
+ */
29
+ AuditEda: "audit-eda",
24
30
  /**
25
31
  * Represents the "auth" microservice.
26
32
  */
27
33
  Auth: "auth",
34
+ /**
35
+ * Represents the "legend-billing" microservice.
36
+ * Handles payment processing, subscriptions, and billing domain events.
37
+ */
38
+ Billing: "billing",
28
39
  /**
29
40
  * Represents the "blockchain" microservice.
30
41
  */
@@ -56,21 +67,10 @@ var availableMicroservices = {
56
67
  /**
57
68
  * Represents the "legend-storage" microservice.
58
69
  */
59
- Storage: "legend-storage",
60
- /**
61
- * Represents the "audit-eda" microservice for event-driven architecture auditing.
62
- * This microservice consumes audit events (audit.received, audit.processed, audit.dead_letter)
63
- * to track event lifecycle and debugging purposes.
64
- */
65
- AuditEda: "audit-eda"
70
+ Storage: "legend-storage"
66
71
  };
67
72
 
68
73
  // src/@types/event/events.ts
69
- var PaymentEmailTypes = {
70
- PURCHASE: "purchase",
71
- SUBSCRIPTION: "subscription",
72
- NEW_SUBSCRIPTION: "new_subscription"
73
- };
74
74
  var gender = {
75
75
  Male: "MALE",
76
76
  Female: "FEMALE",
@@ -106,7 +106,18 @@ var microserviceEvent = {
106
106
  "SOCIAL.BLOCK_CHAT": "social.block_chat",
107
107
  "SOCIAL.NEW_USER": "social.new_user",
108
108
  "SOCIAL.UNBLOCK_CHAT": "social.unblock_chat",
109
- "SOCIAL.UPDATED_USER": "social.updated_user"
109
+ "SOCIAL.UPDATED_USER": "social.updated_user",
110
+ ///////////////////////////
111
+ // BILLING EVENTS
112
+ "BILLING.PAYMENT_CREATED": "billing.payment_created",
113
+ "BILLING.PAYMENT_SUCCEEDED": "billing.payment_succeeded",
114
+ "BILLING.PAYMENT_FAILED": "billing.payment_failed",
115
+ "BILLING.PAYMENT_REFUNDED": "billing.payment_refunded",
116
+ "BILLING.SUBSCRIPTION_CREATED": "billing.subscription_created",
117
+ "BILLING.SUBSCRIPTION_UPDATED": "billing.subscription_updated",
118
+ "BILLING.SUBSCRIPTION_RENEWED": "billing.subscription_renewed",
119
+ "BILLING.SUBSCRIPTION_CANCELED": "billing.subscription_canceled",
120
+ "BILLING.SUBSCRIPTION_EXPIRED": "billing.subscription_expired"
110
121
  };
111
122
 
112
123
  // src/@types/rabbit-mq.ts
@@ -1118,7 +1129,6 @@ exports.MAX_NACK_RETRIES = MAX_NACK_RETRIES;
1118
1129
  exports.MAX_OCCURRENCE = MAX_OCCURRENCE;
1119
1130
  exports.MicroserviceConsumeChannel = MicroserviceConsumeChannel;
1120
1131
  exports.NACKING_DELAY_MS = NACKING_DELAY_MS;
1121
- exports.PaymentEmailTypes = PaymentEmailTypes;
1122
1132
  exports.Saga = Saga;
1123
1133
  exports.SagaCommenceConsumeChannel = SagaCommenceConsumeChannel;
1124
1134
  exports.SagaConsumeChannel = SagaConsumeChannel;
package/dist/index.mjs CHANGED
@@ -14,10 +14,21 @@ var availableMicroservices = {
14
14
  * Represents the "Mint" test microservice.
15
15
  */
16
16
  TestMint: "test-mint",
17
+ /**
18
+ * Represents the "audit-eda" microservice for event-driven architecture auditing.
19
+ * This microservice consumes audit events (audit.received, audit.processed, audit.dead_letter)
20
+ * to track event lifecycle and debugging purposes.
21
+ */
22
+ AuditEda: "audit-eda",
17
23
  /**
18
24
  * Represents the "auth" microservice.
19
25
  */
20
26
  Auth: "auth",
27
+ /**
28
+ * Represents the "legend-billing" microservice.
29
+ * Handles payment processing, subscriptions, and billing domain events.
30
+ */
31
+ Billing: "billing",
21
32
  /**
22
33
  * Represents the "blockchain" microservice.
23
34
  */
@@ -49,21 +60,10 @@ var availableMicroservices = {
49
60
  /**
50
61
  * Represents the "legend-storage" microservice.
51
62
  */
52
- Storage: "legend-storage",
53
- /**
54
- * Represents the "audit-eda" microservice for event-driven architecture auditing.
55
- * This microservice consumes audit events (audit.received, audit.processed, audit.dead_letter)
56
- * to track event lifecycle and debugging purposes.
57
- */
58
- AuditEda: "audit-eda"
63
+ Storage: "legend-storage"
59
64
  };
60
65
 
61
66
  // src/@types/event/events.ts
62
- var PaymentEmailTypes = {
63
- PURCHASE: "purchase",
64
- SUBSCRIPTION: "subscription",
65
- NEW_SUBSCRIPTION: "new_subscription"
66
- };
67
67
  var gender = {
68
68
  Male: "MALE",
69
69
  Female: "FEMALE",
@@ -99,7 +99,18 @@ var microserviceEvent = {
99
99
  "SOCIAL.BLOCK_CHAT": "social.block_chat",
100
100
  "SOCIAL.NEW_USER": "social.new_user",
101
101
  "SOCIAL.UNBLOCK_CHAT": "social.unblock_chat",
102
- "SOCIAL.UPDATED_USER": "social.updated_user"
102
+ "SOCIAL.UPDATED_USER": "social.updated_user",
103
+ ///////////////////////////
104
+ // BILLING EVENTS
105
+ "BILLING.PAYMENT_CREATED": "billing.payment_created",
106
+ "BILLING.PAYMENT_SUCCEEDED": "billing.payment_succeeded",
107
+ "BILLING.PAYMENT_FAILED": "billing.payment_failed",
108
+ "BILLING.PAYMENT_REFUNDED": "billing.payment_refunded",
109
+ "BILLING.SUBSCRIPTION_CREATED": "billing.subscription_created",
110
+ "BILLING.SUBSCRIPTION_UPDATED": "billing.subscription_updated",
111
+ "BILLING.SUBSCRIPTION_RENEWED": "billing.subscription_renewed",
112
+ "BILLING.SUBSCRIPTION_CANCELED": "billing.subscription_canceled",
113
+ "BILLING.SUBSCRIPTION_EXPIRED": "billing.subscription_expired"
103
114
  };
104
115
 
105
116
  // src/@types/rabbit-mq.ts
@@ -1106,4 +1117,4 @@ var publishEvent = async (msg, event) => {
1106
1117
  });
1107
1118
  };
1108
1119
 
1109
- export { EventsConsumeChannel, MAX_NACK_RETRIES, MAX_OCCURRENCE, MicroserviceConsumeChannel, NACKING_DELAY_MS, PaymentEmailTypes, Saga, SagaCommenceConsumeChannel, SagaConsumeChannel, Transactional, auditEdaCommands, authCommands, availableMicroservices, blockchainCommands, closeConsumeChannel, closeRabbitMQConn, closeSendChannel, commenceSaga, commenceSagaConsumeCallback, consume, createAuditLoggingResources, createConsumers, createHeaderConsumers, eventCallback, exchange, extractMicroserviceFromQueue, fibonacci, gender, getConsumeChannel, getEventKey, getEventObject, getQueueConsumer, getQueueName, getRabbitMQConn, getSendChannel, getStoredConfig, isConnectionHealthy, microserviceEvent, nodeDataDefaults, publishEvent, queue, rankingsCommands, sagaConsumeCallback, sagaStepCallback, sagaTitle, saveQueueForHealthCheck, sendEmailCommands, sendToQueue, showcaseCommands, socialCommands, status, stopRabbitMQ, storageCommands, testImageCommands, testMintCommands, transactionalCommands };
1120
+ export { EventsConsumeChannel, MAX_NACK_RETRIES, MAX_OCCURRENCE, MicroserviceConsumeChannel, NACKING_DELAY_MS, Saga, SagaCommenceConsumeChannel, SagaConsumeChannel, Transactional, auditEdaCommands, authCommands, availableMicroservices, blockchainCommands, closeConsumeChannel, closeRabbitMQConn, closeSendChannel, commenceSaga, commenceSagaConsumeCallback, consume, createAuditLoggingResources, createConsumers, createHeaderConsumers, eventCallback, exchange, extractMicroserviceFromQueue, fibonacci, gender, getConsumeChannel, getEventKey, getEventObject, getQueueConsumer, getQueueName, getRabbitMQConn, getSendChannel, getStoredConfig, isConnectionHealthy, microserviceEvent, nodeDataDefaults, publishEvent, queue, rankingsCommands, sagaConsumeCallback, sagaStepCallback, sagaTitle, saveQueueForHealthCheck, sendEmailCommands, sendToQueue, showcaseCommands, socialCommands, status, stopRabbitMQ, storageCommands, testImageCommands, testMintCommands, transactionalCommands };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "legend-transactional",
3
- "version": "2.6.1",
3
+ "version": "2.6.2",
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",