@eventcatalog/create-eventcatalog 4.2.2 → 4.2.3
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.js +1 -1
- package/package.json +1 -1
- package/templates/default/domains/Orders/services/InventoryService/events/InventoryAdjusted/examples/examples.config.yaml +15 -0
- package/templates/default/domains/Orders/services/InventoryService/events/InventoryAdjusted/examples/stock-decrease.json +23 -0
- package/templates/default/domains/Orders/services/InventoryService/events/InventoryAdjusted/examples/stock-increase.json +23 -0
- package/templates/default/domains/Orders/services/InventoryService/events/OutOfStock/examples/examples.config.yaml +7 -0
- package/templates/default/domains/Orders/services/InventoryService/events/OutOfStock/examples/product-depleted.json +19 -0
- package/templates/default/domains/Orders/services/OrdersService/events/OrderAmended/examples/address-change.json +36 -0
- package/templates/default/domains/Orders/services/OrdersService/events/OrderAmended/examples/examples.config.yaml +15 -0
- package/templates/default/domains/Orders/services/OrdersService/events/OrderAmended/examples/quantity-change.json +29 -0
- package/templates/default/domains/Orders/services/OrdersService/events/OrderCancelled/examples/customer-request.json +34 -0
- package/templates/default/domains/Orders/services/OrdersService/events/OrderCancelled/examples/examples.config.yaml +15 -0
- package/templates/default/domains/Orders/services/OrdersService/events/OrderCancelled/examples/out-of-stock.json +28 -0
- package/templates/default/domains/Orders/services/OrdersService/events/OrderConfirmed/examples/examples.config.yaml +15 -0
- package/templates/default/domains/Orders/services/OrdersService/events/OrderConfirmed/examples/gift-order.json +38 -0
- package/templates/default/domains/Orders/services/OrdersService/events/OrderConfirmed/examples/standard-order.json +42 -0
- package/templates/default/domains/Orders/services/ShippingService/events/DeliveryFailed/examples/address-not-found.json +23 -0
- package/templates/default/domains/Orders/services/ShippingService/events/DeliveryFailed/examples/customer-unavailable.json +40 -0
- package/templates/default/domains/Orders/services/ShippingService/events/DeliveryFailed/examples/damaged-in-transit.json +33 -0
- package/templates/default/domains/Orders/services/ShippingService/events/DeliveryFailed/examples/examples.config.yaml +23 -0
- package/templates/default/domains/Orders/services/ShippingService/events/ReturnInitiated/examples/defective-item.json +33 -0
- package/templates/default/domains/Orders/services/ShippingService/events/ReturnInitiated/examples/examples.config.yaml +15 -0
- package/templates/default/domains/Orders/services/ShippingService/events/ReturnInitiated/examples/wrong-item.json +51 -0
- package/templates/default/domains/Orders/services/ShippingService/events/ShipmentCreated/examples/examples.config.yaml +15 -0
- package/templates/default/domains/Orders/services/ShippingService/events/ShipmentCreated/examples/multi-package.json +76 -0
- package/templates/default/domains/Orders/services/ShippingService/events/ShipmentCreated/examples/single-package.json +51 -0
- package/templates/default/domains/Orders/services/ShippingService/events/ShipmentDelivered/examples/examples.config.yaml +15 -0
- package/templates/default/domains/Orders/services/ShippingService/events/ShipmentDelivered/examples/front-door-delivery.json +30 -0
- package/templates/default/domains/Orders/services/ShippingService/events/ShipmentDelivered/examples/signed-delivery.json +31 -0
- package/templates/default/domains/Orders/services/ShippingService/events/ShipmentDispatched/examples/examples.config.yaml +15 -0
- package/templates/default/domains/Orders/services/ShippingService/events/ShipmentDispatched/examples/express-shipping.json +33 -0
- package/templates/default/domains/Orders/services/ShippingService/events/ShipmentDispatched/examples/standard-shipping.json +32 -0
- package/templates/default/domains/Orders/services/ShippingService/events/ShipmentInTransit/examples/domestic-transit.json +48 -0
- package/templates/default/domains/Orders/services/ShippingService/events/ShipmentInTransit/examples/examples.config.yaml +15 -0
- package/templates/default/domains/Orders/services/ShippingService/events/ShipmentInTransit/examples/international-transit.json +61 -0
- package/templates/default/domains/Payment/services/FraudDetectionService/events/FraudCheckCompleted/examples/check-flagged.json +50 -0
- package/templates/default/domains/Payment/services/FraudDetectionService/events/FraudCheckCompleted/examples/check-passed.json +45 -0
- package/templates/default/domains/Payment/services/FraudDetectionService/events/FraudCheckCompleted/examples/examples.config.yaml +15 -0
- package/templates/default/domains/Payment/services/PaymentGatewayService/events/PaymentFailed/examples/card-declined.json +38 -0
- package/templates/default/domains/Payment/services/PaymentGatewayService/events/PaymentFailed/examples/examples.config.yaml +23 -0
- package/templates/default/domains/Payment/services/PaymentGatewayService/events/PaymentFailed/examples/expired-card.json +38 -0
- package/templates/default/domains/Payment/services/PaymentGatewayService/events/PaymentFailed/examples/insufficient-funds.json +38 -0
- package/templates/default/domains/Payment/services/PaymentService/events/PaymentInitiated/examples/examples.config.yaml +15 -0
- package/templates/default/domains/Payment/services/PaymentService/events/PaymentInitiated/examples/express-checkout.json +45 -0
- package/templates/default/domains/Payment/services/PaymentService/events/PaymentInitiated/examples/standard-checkout.json +52 -0
- package/templates/default/domains/Payment/services/PaymentService/events/PaymentProcessed/examples/examples.config.yaml +15 -0
- package/templates/default/domains/Payment/services/PaymentService/events/PaymentProcessed/examples/international-payment.json +48 -0
- package/templates/default/domains/Payment/services/PaymentService/events/PaymentProcessed/examples/successful-payment.json +48 -0
- package/templates/default/domains/Subscriptions/services/BillingService/events/SubscriptionPaymentDue/examples/examples.config.yaml +7 -0
- package/templates/default/domains/Subscriptions/services/BillingService/events/SubscriptionPaymentDue/examples/upcoming-renewal.json +28 -0
- package/templates/default/domains/Subscriptions/services/SubscriptionService/events/UserSubscriptionCancelled/examples/examples.config.yaml +15 -0
- package/templates/default/domains/Subscriptions/services/SubscriptionService/events/UserSubscriptionCancelled/examples/payment-failure.json +25 -0
- package/templates/default/domains/Subscriptions/services/SubscriptionService/events/UserSubscriptionCancelled/examples/voluntary-cancellation.json +23 -0
- package/templates/default/domains/Subscriptions/services/SubscriptionService/events/UserSubscriptionStarted/examples/annual-plan.json +26 -0
- package/templates/default/domains/Subscriptions/services/SubscriptionService/events/UserSubscriptionStarted/examples/examples.config.yaml +15 -0
- package/templates/default/domains/Subscriptions/services/SubscriptionService/events/UserSubscriptionStarted/examples/monthly-plan.json +25 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
standard-checkout.json:
|
|
2
|
+
name: Standard Checkout
|
|
3
|
+
summary: Payment initiated through the standard web checkout flow with a Visa credit card and multiple items.
|
|
4
|
+
usage: |
|
|
5
|
+
curl -X POST http://localhost:3000/events/publish \
|
|
6
|
+
-H "Content-Type: application/json" \
|
|
7
|
+
-d @standard-checkout.json
|
|
8
|
+
|
|
9
|
+
express-checkout.json:
|
|
10
|
+
name: Express Checkout
|
|
11
|
+
summary: Payment initiated via Apple Pay express checkout on mobile for a single item with a discount code applied.
|
|
12
|
+
usage: |
|
|
13
|
+
curl -X POST http://localhost:3000/events/publish \
|
|
14
|
+
-H "Content-Type: application/json" \
|
|
15
|
+
-d @express-checkout.json
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"eventId": "evt_pi_9f8e7d6c-5b4a-3f2e-1d0c-9b8a7f6e5d4c",
|
|
3
|
+
"timestamp": "2024-03-16T07:33:41.890Z",
|
|
4
|
+
"type": "PaymentInitiated",
|
|
5
|
+
"source": "payment-service",
|
|
6
|
+
"data": {
|
|
7
|
+
"paymentId": "pay_3e2d1c0b-9a8f-7e6d-5c4b-3a2f1e0d9c8b",
|
|
8
|
+
"orderId": "ord_92855010",
|
|
9
|
+
"customerId": "cust_55832",
|
|
10
|
+
"amount": 29.99,
|
|
11
|
+
"currency": "USD",
|
|
12
|
+
"paymentMethod": {
|
|
13
|
+
"type": "apple_pay",
|
|
14
|
+
"brand": "mastercard",
|
|
15
|
+
"last4": "7654",
|
|
16
|
+
"walletType": "apple_pay"
|
|
17
|
+
},
|
|
18
|
+
"checkoutType": "express",
|
|
19
|
+
"shippingAddress": {
|
|
20
|
+
"line1": "890 Broadway",
|
|
21
|
+
"city": "New York",
|
|
22
|
+
"state": "NY",
|
|
23
|
+
"postalCode": "10003",
|
|
24
|
+
"country": "US"
|
|
25
|
+
},
|
|
26
|
+
"items": [
|
|
27
|
+
{
|
|
28
|
+
"productId": "prod_8210",
|
|
29
|
+
"name": "Phone Case - Clear",
|
|
30
|
+
"quantity": 1,
|
|
31
|
+
"unitPrice": 29.99
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"discountCode": "SAVE10",
|
|
35
|
+
"taxAmount": 2.66,
|
|
36
|
+
"shippingCost": 0.0,
|
|
37
|
+
"initiatedAt": "2024-03-16T07:33:41.890Z"
|
|
38
|
+
},
|
|
39
|
+
"metadata": {
|
|
40
|
+
"correlationId": "corr_c3d4e5f6-a7b8-9012-cdef-345678901234",
|
|
41
|
+
"channel": "mobile_app",
|
|
42
|
+
"ipAddress": "10.0.0.201",
|
|
43
|
+
"sessionId": "sess_2r3s4t5u6v7w8x9y"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"eventId": "evt_pi_1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
|
|
3
|
+
"timestamp": "2024-03-15T10:58:22.104Z",
|
|
4
|
+
"type": "PaymentInitiated",
|
|
5
|
+
"source": "payment-service",
|
|
6
|
+
"data": {
|
|
7
|
+
"paymentId": "pay_4b5c6d7e-8f9a-0b1c-2d3e-4f5a6b7c8d9e",
|
|
8
|
+
"orderId": "ord_92840123",
|
|
9
|
+
"customerId": "cust_10482",
|
|
10
|
+
"amount": 189.97,
|
|
11
|
+
"currency": "USD",
|
|
12
|
+
"paymentMethod": {
|
|
13
|
+
"type": "credit_card",
|
|
14
|
+
"brand": "visa",
|
|
15
|
+
"last4": "4242",
|
|
16
|
+
"expiryMonth": 11,
|
|
17
|
+
"expiryYear": 2026
|
|
18
|
+
},
|
|
19
|
+
"checkoutType": "standard",
|
|
20
|
+
"shippingAddress": {
|
|
21
|
+
"line1": "123 Main Street",
|
|
22
|
+
"city": "San Francisco",
|
|
23
|
+
"state": "CA",
|
|
24
|
+
"postalCode": "94102",
|
|
25
|
+
"country": "US"
|
|
26
|
+
},
|
|
27
|
+
"items": [
|
|
28
|
+
{
|
|
29
|
+
"productId": "prod_5001",
|
|
30
|
+
"name": "Wireless Headphones",
|
|
31
|
+
"quantity": 1,
|
|
32
|
+
"unitPrice": 149.99
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"productId": "prod_5032",
|
|
36
|
+
"name": "USB-C Cable",
|
|
37
|
+
"quantity": 2,
|
|
38
|
+
"unitPrice": 19.99
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"discountCode": null,
|
|
42
|
+
"taxAmount": 15.58,
|
|
43
|
+
"shippingCost": 0.0,
|
|
44
|
+
"initiatedAt": "2024-03-15T10:58:22.104Z"
|
|
45
|
+
},
|
|
46
|
+
"metadata": {
|
|
47
|
+
"correlationId": "corr_b2c3d4e5-f6a7-8901-bcde-f23456789012",
|
|
48
|
+
"channel": "web",
|
|
49
|
+
"ipAddress": "192.168.1.42",
|
|
50
|
+
"sessionId": "sess_7k8l9m0n1o2p3q4r"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
successful-payment.json:
|
|
2
|
+
name: Successful Payment
|
|
3
|
+
summary: A standard credit card payment completed successfully for a domestic order with multiple items.
|
|
4
|
+
usage: |
|
|
5
|
+
curl -X POST http://localhost:3000/events/publish \
|
|
6
|
+
-H "Content-Type: application/json" \
|
|
7
|
+
-d @successful-payment.json
|
|
8
|
+
|
|
9
|
+
international-payment.json:
|
|
10
|
+
name: International Payment
|
|
11
|
+
summary: Payment processed for an international order in GBP with currency conversion details included.
|
|
12
|
+
usage: |
|
|
13
|
+
curl -X POST http://localhost:3000/events/publish \
|
|
14
|
+
-H "Content-Type: application/json" \
|
|
15
|
+
-d @international-payment.json
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"eventId": "evt_pp_d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f9a",
|
|
3
|
+
"timestamp": "2024-03-15T18:22:10.556Z",
|
|
4
|
+
"type": "PaymentProcessed",
|
|
5
|
+
"source": "payment-service",
|
|
6
|
+
"data": {
|
|
7
|
+
"paymentId": "pay_8f9a0b1c-2d3e-4f5a-6b7c-8d9e0f1a2b3c",
|
|
8
|
+
"orderId": "ord_92847892",
|
|
9
|
+
"customerId": "cust_44219",
|
|
10
|
+
"amount": 74.5,
|
|
11
|
+
"currency": "GBP",
|
|
12
|
+
"paymentMethod": {
|
|
13
|
+
"type": "credit_card",
|
|
14
|
+
"brand": "mastercard",
|
|
15
|
+
"last4": "3391"
|
|
16
|
+
},
|
|
17
|
+
"status": "completed",
|
|
18
|
+
"transactionId": "txn_Uk4Lm5Np6Qr7St8",
|
|
19
|
+
"processingFee": 2.46,
|
|
20
|
+
"netAmount": 72.04,
|
|
21
|
+
"currencyConversion": {
|
|
22
|
+
"originalCurrency": "GBP",
|
|
23
|
+
"originalAmount": 74.5,
|
|
24
|
+
"convertedCurrency": "USD",
|
|
25
|
+
"convertedAmount": 94.27,
|
|
26
|
+
"exchangeRate": 1.2654
|
|
27
|
+
},
|
|
28
|
+
"billingAddress": {
|
|
29
|
+
"line1": "45 Oxford Road",
|
|
30
|
+
"city": "London",
|
|
31
|
+
"postalCode": "W1D 2DZ",
|
|
32
|
+
"country": "GB"
|
|
33
|
+
},
|
|
34
|
+
"items": [
|
|
35
|
+
{
|
|
36
|
+
"productId": "prod_7820",
|
|
37
|
+
"name": "Running Shoes - Size 10",
|
|
38
|
+
"quantity": 1,
|
|
39
|
+
"unitPrice": 74.5
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"completedAt": "2024-03-15T18:22:10.556Z"
|
|
43
|
+
},
|
|
44
|
+
"metadata": {
|
|
45
|
+
"correlationId": "corr_e5f6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b",
|
|
46
|
+
"channel": "mobile_app"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"eventId": "evt_pp_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
3
|
+
"timestamp": "2024-03-15T11:04:33.218Z",
|
|
4
|
+
"type": "PaymentProcessed",
|
|
5
|
+
"source": "payment-service",
|
|
6
|
+
"data": {
|
|
7
|
+
"paymentId": "pay_4b5c6d7e-8f9a-0b1c-2d3e-4f5a6b7c8d9e",
|
|
8
|
+
"orderId": "ord_92840123",
|
|
9
|
+
"customerId": "cust_10482",
|
|
10
|
+
"amount": 189.97,
|
|
11
|
+
"currency": "USD",
|
|
12
|
+
"paymentMethod": {
|
|
13
|
+
"type": "credit_card",
|
|
14
|
+
"brand": "visa",
|
|
15
|
+
"last4": "4242"
|
|
16
|
+
},
|
|
17
|
+
"status": "completed",
|
|
18
|
+
"transactionId": "txn_XyZ1AbC2DeF3GhI",
|
|
19
|
+
"processingFee": 5.8,
|
|
20
|
+
"netAmount": 184.17,
|
|
21
|
+
"billingAddress": {
|
|
22
|
+
"line1": "123 Main Street",
|
|
23
|
+
"city": "San Francisco",
|
|
24
|
+
"state": "CA",
|
|
25
|
+
"postalCode": "94102",
|
|
26
|
+
"country": "US"
|
|
27
|
+
},
|
|
28
|
+
"items": [
|
|
29
|
+
{
|
|
30
|
+
"productId": "prod_5001",
|
|
31
|
+
"name": "Wireless Headphones",
|
|
32
|
+
"quantity": 1,
|
|
33
|
+
"unitPrice": 149.99
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"productId": "prod_5032",
|
|
37
|
+
"name": "USB-C Cable",
|
|
38
|
+
"quantity": 2,
|
|
39
|
+
"unitPrice": 19.99
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"completedAt": "2024-03-15T11:04:33.218Z"
|
|
43
|
+
},
|
|
44
|
+
"metadata": {
|
|
45
|
+
"correlationId": "corr_b2c3d4e5-f6a7-8901-bcde-f23456789012",
|
|
46
|
+
"channel": "web"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
upcoming-renewal.json:
|
|
2
|
+
name: Upcoming Renewal Payment
|
|
3
|
+
summary: A payment reminder generated 3 days before a Pro Monthly subscription renewal is due.
|
|
4
|
+
usage: |
|
|
5
|
+
curl -X POST http://localhost:3000/events/publish \
|
|
6
|
+
-H "Content-Type: application/json" \
|
|
7
|
+
-d @upcoming-renewal.json
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"eventId": "evt_pay_due_5a72bf",
|
|
3
|
+
"eventType": "SubscriptionPaymentDue",
|
|
4
|
+
"timestamp": "2024-04-12T06:00:00Z",
|
|
5
|
+
"data": {
|
|
6
|
+
"subscriptionId": "sub_9f84kd02",
|
|
7
|
+
"userId": "usr_28471",
|
|
8
|
+
"plan": {
|
|
9
|
+
"planId": "plan_monthly_pro",
|
|
10
|
+
"name": "Pro Monthly"
|
|
11
|
+
},
|
|
12
|
+
"amount": 32.39,
|
|
13
|
+
"currency": "USD",
|
|
14
|
+
"dueDate": "2024-04-15",
|
|
15
|
+
"billingPeriod": {
|
|
16
|
+
"start": "2024-04-15",
|
|
17
|
+
"end": "2024-05-15"
|
|
18
|
+
},
|
|
19
|
+
"paymentMethodId": "pm_card_4242",
|
|
20
|
+
"paymentMethodLast4": "4242",
|
|
21
|
+
"remindersSent": 1,
|
|
22
|
+
"daysUntilDue": 3
|
|
23
|
+
},
|
|
24
|
+
"metadata": {
|
|
25
|
+
"correlationId": "corr_due_001",
|
|
26
|
+
"version": "1.0.0"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
voluntary-cancellation.json:
|
|
2
|
+
name: Voluntary Cancellation
|
|
3
|
+
summary: A customer voluntarily cancels their Pro Monthly subscription, effective at the end of the current billing cycle.
|
|
4
|
+
usage: |
|
|
5
|
+
curl -X POST http://localhost:3000/events/publish \
|
|
6
|
+
-H "Content-Type: application/json" \
|
|
7
|
+
-d @voluntary-cancellation.json
|
|
8
|
+
|
|
9
|
+
payment-failure.json:
|
|
10
|
+
name: Payment Failure Cancellation
|
|
11
|
+
summary: System automatically cancels an Enterprise Annual subscription after 3 consecutive failed payment attempts.
|
|
12
|
+
usage: |
|
|
13
|
+
curl -X POST http://localhost:3000/events/publish \
|
|
14
|
+
-H "Content-Type: application/json" \
|
|
15
|
+
-d @payment-failure.json
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"eventId": "evt_sub_cancel_b19c3f",
|
|
3
|
+
"eventType": "UserSubscriptionCancelled",
|
|
4
|
+
"timestamp": "2024-07-03T08:12:55Z",
|
|
5
|
+
"data": {
|
|
6
|
+
"subscriptionId": "sub_7j21np48",
|
|
7
|
+
"userId": "usr_41839",
|
|
8
|
+
"plan": {
|
|
9
|
+
"planId": "plan_annual_enterprise",
|
|
10
|
+
"name": "Enterprise Annual"
|
|
11
|
+
},
|
|
12
|
+
"cancellationReason": "payment_failure",
|
|
13
|
+
"cancellationNote": "Automatic cancellation after 3 failed payment attempts",
|
|
14
|
+
"cancelledBy": "system",
|
|
15
|
+
"effectiveDate": "2024-07-03",
|
|
16
|
+
"refundAmount": 0,
|
|
17
|
+
"failedPaymentAttempts": 3,
|
|
18
|
+
"lastPaymentAttempt": "2024-07-02T23:00:00Z",
|
|
19
|
+
"subscriptionDurationDays": 182
|
|
20
|
+
},
|
|
21
|
+
"metadata": {
|
|
22
|
+
"correlationId": "corr_aa11bb22",
|
|
23
|
+
"version": "1.0.0"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"eventId": "evt_sub_cancel_4d82ea",
|
|
3
|
+
"eventType": "UserSubscriptionCancelled",
|
|
4
|
+
"timestamp": "2024-05-20T16:45:12Z",
|
|
5
|
+
"data": {
|
|
6
|
+
"subscriptionId": "sub_9f84kd02",
|
|
7
|
+
"userId": "usr_28471",
|
|
8
|
+
"plan": {
|
|
9
|
+
"planId": "plan_monthly_pro",
|
|
10
|
+
"name": "Pro Monthly"
|
|
11
|
+
},
|
|
12
|
+
"cancellationReason": "no_longer_needed",
|
|
13
|
+
"cancellationNote": "Switching to a competitor product",
|
|
14
|
+
"cancelledBy": "customer",
|
|
15
|
+
"effectiveDate": "2024-06-15",
|
|
16
|
+
"refundAmount": 0,
|
|
17
|
+
"subscriptionDurationDays": 67
|
|
18
|
+
},
|
|
19
|
+
"metadata": {
|
|
20
|
+
"correlationId": "corr_cd45ef67",
|
|
21
|
+
"version": "1.0.0"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"eventId": "evt_sub_start_e91f2a",
|
|
3
|
+
"eventType": "UserSubscriptionStarted",
|
|
4
|
+
"timestamp": "2024-06-01T14:05:33Z",
|
|
5
|
+
"data": {
|
|
6
|
+
"subscriptionId": "sub_3k72mf91",
|
|
7
|
+
"userId": "usr_55102",
|
|
8
|
+
"plan": {
|
|
9
|
+
"planId": "plan_annual_enterprise",
|
|
10
|
+
"name": "Enterprise Annual",
|
|
11
|
+
"billingCycle": "annual",
|
|
12
|
+
"price": 499.0,
|
|
13
|
+
"currency": "USD"
|
|
14
|
+
},
|
|
15
|
+
"trialPeriodDays": 0,
|
|
16
|
+
"startDate": "2024-06-01",
|
|
17
|
+
"nextBillingDate": "2025-06-01",
|
|
18
|
+
"paymentMethodId": "pm_card_1881",
|
|
19
|
+
"source": "sales_team",
|
|
20
|
+
"discountCode": "ENTERPRISE20"
|
|
21
|
+
},
|
|
22
|
+
"metadata": {
|
|
23
|
+
"correlationId": "corr_ff93aa12",
|
|
24
|
+
"version": "1.0.0"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
monthly-plan.json:
|
|
2
|
+
name: Monthly Plan Subscription
|
|
3
|
+
summary: A user subscribes to the Pro Monthly plan with a 14-day trial period via web checkout.
|
|
4
|
+
usage: |
|
|
5
|
+
curl -X POST http://localhost:3000/events/publish \
|
|
6
|
+
-H "Content-Type: application/json" \
|
|
7
|
+
-d @monthly-plan.json
|
|
8
|
+
|
|
9
|
+
annual-plan.json:
|
|
10
|
+
name: Annual Enterprise Plan
|
|
11
|
+
summary: A user subscribes to the Enterprise Annual plan through the sales team with a discount code applied.
|
|
12
|
+
usage: |
|
|
13
|
+
curl -X POST http://localhost:3000/events/publish \
|
|
14
|
+
-H "Content-Type: application/json" \
|
|
15
|
+
-d @annual-plan.json
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"eventId": "evt_sub_start_7a3b1c",
|
|
3
|
+
"eventType": "UserSubscriptionStarted",
|
|
4
|
+
"timestamp": "2024-03-15T09:22:41Z",
|
|
5
|
+
"data": {
|
|
6
|
+
"subscriptionId": "sub_9f84kd02",
|
|
7
|
+
"userId": "usr_28471",
|
|
8
|
+
"plan": {
|
|
9
|
+
"planId": "plan_monthly_pro",
|
|
10
|
+
"name": "Pro Monthly",
|
|
11
|
+
"billingCycle": "monthly",
|
|
12
|
+
"price": 29.99,
|
|
13
|
+
"currency": "USD"
|
|
14
|
+
},
|
|
15
|
+
"trialPeriodDays": 14,
|
|
16
|
+
"startDate": "2024-03-15",
|
|
17
|
+
"nextBillingDate": "2024-04-15",
|
|
18
|
+
"paymentMethodId": "pm_card_4242",
|
|
19
|
+
"source": "web_checkout"
|
|
20
|
+
},
|
|
21
|
+
"metadata": {
|
|
22
|
+
"correlationId": "corr_ab12cd34",
|
|
23
|
+
"version": "1.0.0"
|
|
24
|
+
}
|
|
25
|
+
}
|