@eventcatalog/create-eventcatalog 2.0.22 → 2.1.0
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/README.md +32 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/templates/default/channels/inventory.{env}.events/index.md +157 -0
- package/templates/default/channels/orders.{env}.events/index.md +82 -0
- package/templates/default/channels/payment.{env}.events/index.md +88 -0
- package/templates/default/components/footer.astro +8 -0
- package/templates/default/domains/Orders/index.md +19 -3
- package/templates/default/{commands → domains/Orders/services/InventoryService/commands}/AddInventory/index.md +10 -0
- package/templates/default/domains/Orders/services/InventoryService/commands/PlaceOrder/index.md +36 -0
- package/templates/default/domains/Orders/services/InventoryService/commands/PlaceOrder/schema.json +124 -0
- package/templates/default/{commands → domains/Orders/services/InventoryService/commands}/UpdateInventory/index.md +9 -0
- package/templates/default/{events/Inventory → domains/Orders/services/InventoryService/events}/InventoryAdjusted/index.md +14 -3
- package/templates/default/domains/Orders/services/InventoryService/events/InventoryAdjusted/schema.json +35 -0
- package/templates/default/{events/Inventory/InventoryAdjusted/versioned/0.0.3 → domains/Orders/services/InventoryService/events/InventoryAdjusted/versioned/1.0.0}/index.md +1 -1
- package/templates/default/domains/Orders/services/InventoryService/events/InventoryAdjusted/versioned/1.0.0/schema.avro +10 -0
- package/templates/default/domains/Orders/services/InventoryService/events/OutOfStock/index.md +102 -0
- package/templates/default/{events/Inventory/OutOfStock → domains/Orders/services/InventoryService/events/OutOfStock/versioned/0.0.1}/index.md +1 -1
- package/templates/default/{services → domains/Orders/services}/InventoryService/index.md +49 -4
- package/templates/default/domains/Orders/services/InventoryService/queries/GetInventoryList/index.md +22 -0
- package/templates/default/domains/Orders/services/InventoryService/queries/GetInventoryList/schema.json +53 -0
- package/templates/default/domains/Orders/services/InventoryService/queries/GetInventoryStatus/index.md +41 -0
- package/templates/default/domains/Orders/services/InventoryService/queries/GetInventoryStatus/schema.json +28 -0
- package/templates/default/{services → domains/Orders/services}/InventoryService/versioned/0.0.1/index.md +2 -2
- package/templates/default/{services → domains/Orders/services}/NotificationService/index.md +21 -4
- package/templates/default/domains/Orders/services/NotificationService/queries/GetNotificationDetails/index.md +26 -0
- package/templates/default/domains/Orders/services/NotificationService/queries/GetNotificationDetails/schema.json +56 -0
- package/templates/default/domains/Orders/services/NotificationService/queries/GetUserNotifications/index.md +27 -0
- package/templates/default/domains/Orders/services/NotificationService/queries/GetUserNotifications/schema.json +47 -0
- package/templates/default/domains/Orders/services/OrdersService/changelog.md +3 -0
- package/templates/default/{events/Order → domains/Orders/services/OrdersService/events}/OrderAmended/index.md +9 -0
- package/templates/default/{events/Order → domains/Orders/services/OrdersService/events}/OrderCancelled/index.md +7 -1
- package/templates/default/{events/Order → domains/Orders/services/OrdersService/events}/OrderConfirmed/index.md +7 -1
- package/templates/default/{services → domains/Orders/services}/OrdersService/index.md +13 -4
- package/templates/default/domains/Orders/services/OrdersService/openapi.yml +185 -0
- package/templates/default/domains/Orders/services/OrdersService/order-service-asyncapi.yaml +148 -0
- package/templates/default/domains/Orders/services/OrdersService/queries/GetOrder/index.md +26 -0
- package/templates/default/domains/Orders/services/OrdersService/versioned/0.0.2/changelog.md +3 -0
- package/templates/default/domains/Orders/services/OrdersService/versioned/0.0.2/index.md +34 -0
- package/templates/default/domains/Orders/services/OrdersService/versioned/0.0.2/openapi.yml +96 -0
- package/templates/default/domains/Orders/services/OrdersService/versioned/0.0.2/order-service-asyncapi.yaml +148 -0
- package/templates/default/domains/Orders/versioned/0.0.1/index.md +1 -0
- package/templates/default/domains/Orders/versioned/0.0.2/index.md +49 -0
- package/templates/default/domains/Payment/index.md +1 -6
- package/templates/default/{events/Payment → domains/Payment/services/PaymentService/events}/PaymentInitiated/index.md +9 -1
- package/templates/default/domains/Payment/services/PaymentService/events/PaymentProcessed/index.md +46 -0
- package/templates/default/{events/Payment/PaymentProcessed → domains/Payment/services/PaymentService/events/PaymentProcessed/versioned/0.0.1}/index.md +5 -1
- package/templates/default/{services → domains/Payment/services}/PaymentService/index.md +3 -8
- package/templates/default/domains/Payment/services/PaymentService/queries/GetPaymentStatus/index.md +26 -0
- package/templates/default/domains/Payment/services/PaymentService/queries/GetPaymentStatus/schema.json +40 -0
- package/templates/default/domains/Subscriptions/index.md +24 -0
- package/templates/default/domains/Subscriptions/services/SubscriptionService/commands/CancelSubscription/index.md +25 -0
- package/templates/default/domains/Subscriptions/services/SubscriptionService/commands/SubscribeUser/index.md +25 -0
- package/templates/default/domains/Subscriptions/services/SubscriptionService/events/UserSubscriptionCancelled/index.md +25 -0
- package/templates/default/domains/Subscriptions/services/SubscriptionService/events/UserSubscriptionStarted/index.md +25 -0
- package/templates/default/domains/Subscriptions/services/SubscriptionService/index.md +42 -0
- package/templates/default/domains/Subscriptions/services/SubscriptionService/queries/GetSubscriptionStatus/index.md +26 -0
- package/templates/default/domains/Subscriptions/services/SubscriptionService/queries/GetSubscriptionStatus/schema.json +46 -0
- package/templates/default/domains/Subscriptions/services/SubscriptionService/queries/GetSubscriptionStatus/versioned/0.0.1/index.md +26 -0
- package/templates/default/domains/Subscriptions/services/SubscriptionService/queries/GetSubscriptionStatus/versioned/0.0.1/schema.json +46 -0
- package/templates/default/eventcatalog.config.js +0 -6
- package/templates/default/events/Inventory/InventoryAdjusted/schema.json +0 -17
- package/templates/default/events/Inventory/InventoryAdjusted/versioned/0.0.3/schema.avro +0 -14
- package/templates/default/services/OrdersService/openapi.yml +0 -170
- /package/templates/default/{services → domains/Orders/services}/InventoryService/changelog.md +0 -0
- /package/templates/default/{commands → domains/Orders/services/InventoryService/commands}/AddInventory/schema.json +0 -0
- /package/templates/default/{commands → domains/Orders/services/InventoryService/commands}/UpdateInventory/schema.json +0 -0
- /package/templates/default/{events/Inventory → domains/Orders/services/InventoryService/events}/InventoryAdjusted/changelog.md +0 -0
- /package/templates/default/{events/Inventory → domains/Orders/services/InventoryService/events}/InventoryAdjusted/schema.avro +0 -0
- /package/templates/default/{events/Inventory → domains/Orders/services/InventoryService/events}/InventoryAdjusted/versioned/0.0.1/changelog.md +0 -0
- /package/templates/default/{events/Inventory → domains/Orders/services/InventoryService/events}/InventoryAdjusted/versioned/0.0.1/index.md +0 -0
- /package/templates/default/{events/Inventory → domains/Orders/services/InventoryService/events}/InventoryAdjusted/versioned/0.0.1/schema.avro +0 -0
- /package/templates/default/{events/Inventory/InventoryAdjusted/versioned/0.0.3 → domains/Orders/services/InventoryService/events/InventoryAdjusted/versioned/1.0.0}/changelog.md +0 -0
- /package/templates/default/{events/Order → domains/Orders/services/OrdersService/events}/OrderAmended/schema.avro +0 -0
- /package/templates/default/{events/Order → domains/Orders/services/OrdersService/events}/OrderAmended/schema.json +0 -0
- /package/templates/default/{events/Order → domains/Orders/services/OrdersService/events}/OrderCancelled/schema.json +0 -0
- /package/templates/default/{events/Order → domains/Orders/services/OrdersService/events}/OrderConfirmed/schema.json +0 -0
- /package/templates/default/{flows/Payment → domains/Payment/flows}/PaymentProcessed/index.md +0 -0
- /package/templates/default/{flows/Subscriptions → domains/Subscriptions/flows}/CancelSubscription/index.md +0 -0
- /package/templates/default/{flows/Subscriptions → domains/Subscriptions/flows}/CancelSubscription/versioned/0.0.1/index.md +0 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
asyncapi: 3.0.0
|
|
2
|
+
|
|
3
|
+
info:
|
|
4
|
+
title: Order service
|
|
5
|
+
description: |
|
|
6
|
+
This service is in charge of processing order events.
|
|
7
|
+
version: '1.0.0'
|
|
8
|
+
|
|
9
|
+
servers:
|
|
10
|
+
topic:
|
|
11
|
+
host: https://mytopic.com
|
|
12
|
+
description: Custom Topic.
|
|
13
|
+
protocol: HTTPS
|
|
14
|
+
|
|
15
|
+
defaultContentType: application/json
|
|
16
|
+
|
|
17
|
+
channels:
|
|
18
|
+
orderEventsChannel:
|
|
19
|
+
address: 'orders.{orderId}'
|
|
20
|
+
description: All Order related events are distributed and broadcasted for the interested consumers.
|
|
21
|
+
title: Order events channel
|
|
22
|
+
messages:
|
|
23
|
+
OrderConfirmed:
|
|
24
|
+
summary: Order confirmed event
|
|
25
|
+
$ref: '#/components/messages/OrderConfirmed'
|
|
26
|
+
OrderPlaced:
|
|
27
|
+
summary: Order placed event
|
|
28
|
+
$ref: '#/components/messages/OrderPlaced'
|
|
29
|
+
|
|
30
|
+
operations:
|
|
31
|
+
onOrderConfirmation:
|
|
32
|
+
summary: Action to confirm an order.
|
|
33
|
+
description: The product availability of an order will lead to the confirmation of the order.
|
|
34
|
+
title: Order Confirmed
|
|
35
|
+
channel:
|
|
36
|
+
$ref: '#/channels/orderEventsChannel'
|
|
37
|
+
action: send
|
|
38
|
+
onOrderPlacement:
|
|
39
|
+
summary: Action to place an order.
|
|
40
|
+
description: The reception and validation of an order will lead to the placement of the order.
|
|
41
|
+
title: Order Placed
|
|
42
|
+
channel:
|
|
43
|
+
$ref: '#/channels/orderEventsChannel'
|
|
44
|
+
action: send
|
|
45
|
+
|
|
46
|
+
components:
|
|
47
|
+
messages:
|
|
48
|
+
OrderConfirmed:
|
|
49
|
+
payload:
|
|
50
|
+
$ref: '#/components/schemas/OrderConfirmed'
|
|
51
|
+
|
|
52
|
+
OrderPlaced:
|
|
53
|
+
payload:
|
|
54
|
+
$ref: '#/components/schemas/OrderPlaced'
|
|
55
|
+
|
|
56
|
+
schemas:
|
|
57
|
+
orderId:
|
|
58
|
+
description: The unique identifier of an order
|
|
59
|
+
type: string
|
|
60
|
+
pattern: ^([A-Za-z0-9_-]{21})$
|
|
61
|
+
|
|
62
|
+
userId:
|
|
63
|
+
description: The unique identifier of a user
|
|
64
|
+
type: string
|
|
65
|
+
pattern: ^([A-Za-z0-9_-]{21})$
|
|
66
|
+
|
|
67
|
+
productId:
|
|
68
|
+
description: The product unique identifier
|
|
69
|
+
type: string
|
|
70
|
+
pattern: ^([A-Za-z0-9_-]{21})$
|
|
71
|
+
|
|
72
|
+
Order:
|
|
73
|
+
required:
|
|
74
|
+
- orderId
|
|
75
|
+
- userId
|
|
76
|
+
- productId
|
|
77
|
+
- price
|
|
78
|
+
- quantity
|
|
79
|
+
- orderDate
|
|
80
|
+
type: object
|
|
81
|
+
description: order model
|
|
82
|
+
properties:
|
|
83
|
+
orderId:
|
|
84
|
+
"$ref": "#/components/schemas/orderId"
|
|
85
|
+
orderDate:
|
|
86
|
+
description: Date of order submition.
|
|
87
|
+
type: string
|
|
88
|
+
format: date-time
|
|
89
|
+
userId:
|
|
90
|
+
"$ref": "#/components/schemas/userId"
|
|
91
|
+
productId:
|
|
92
|
+
"$ref": "#/components/schemas/productId"
|
|
93
|
+
price:
|
|
94
|
+
type: number
|
|
95
|
+
quantity:
|
|
96
|
+
type: integer
|
|
97
|
+
title: Order
|
|
98
|
+
|
|
99
|
+
EventEnvelope:
|
|
100
|
+
type: object
|
|
101
|
+
allOf:
|
|
102
|
+
- $ref: 'https://raw.githubusercontent.com/cloudevents/spec/v1.0.1/spec.json'
|
|
103
|
+
properties:
|
|
104
|
+
id:
|
|
105
|
+
type: string
|
|
106
|
+
format: uuid
|
|
107
|
+
idempotencykey:
|
|
108
|
+
type: string
|
|
109
|
+
format: uuid
|
|
110
|
+
correlationid:
|
|
111
|
+
type: string
|
|
112
|
+
format: uuid
|
|
113
|
+
causationid:
|
|
114
|
+
type: string
|
|
115
|
+
format: uuid
|
|
116
|
+
|
|
117
|
+
EventType:
|
|
118
|
+
type: string
|
|
119
|
+
enum:
|
|
120
|
+
- "order.placed"
|
|
121
|
+
- "order.confirmed"
|
|
122
|
+
|
|
123
|
+
OrderConfirmed:
|
|
124
|
+
type: object
|
|
125
|
+
additionalProperties: false
|
|
126
|
+
allOf:
|
|
127
|
+
- $ref: '#/components/schemas/EventEnvelope'
|
|
128
|
+
properties:
|
|
129
|
+
data:
|
|
130
|
+
$ref: '#/components/schemas/Order'
|
|
131
|
+
type:
|
|
132
|
+
$ref: '#/components/schemas/EventType'
|
|
133
|
+
|
|
134
|
+
required:
|
|
135
|
+
- data
|
|
136
|
+
|
|
137
|
+
OrderPlaced:
|
|
138
|
+
type: object
|
|
139
|
+
additionalProperties: false
|
|
140
|
+
allOf:
|
|
141
|
+
- $ref: '#/components/schemas/EventEnvelope'
|
|
142
|
+
properties:
|
|
143
|
+
data:
|
|
144
|
+
$ref: '#/components/schemas/Order'
|
|
145
|
+
type:
|
|
146
|
+
$ref: '#/components/schemas/EventType'
|
|
147
|
+
required:
|
|
148
|
+
- data
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: Orders
|
|
3
|
+
name: Orders
|
|
4
|
+
version: 0.0.2
|
|
5
|
+
owners:
|
|
6
|
+
- dboyne
|
|
7
|
+
services:
|
|
8
|
+
- id: InventoryService
|
|
9
|
+
version: 0.0.2
|
|
10
|
+
- id: NotificationService
|
|
11
|
+
version: 0.0.2
|
|
12
|
+
- id: OrdersService
|
|
13
|
+
version: 0.0.2
|
|
14
|
+
badges:
|
|
15
|
+
- content: New domain
|
|
16
|
+
backgroundColor: blue
|
|
17
|
+
textColor: blue
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Overview
|
|
21
|
+
|
|
22
|
+
The Orders domain handles all operations related to customer orders, from creation to fulfillment. This documentation provides an overview of the events and services involved in the Orders domain, helping developers and stakeholders understand the event-driven architecture.
|
|
23
|
+
|
|
24
|
+
<Admonition type="warning">Please ensure all services are updated to the latest version for compatibility and performance improvements.</Admonition>
|
|
25
|
+
|
|
26
|
+
## Bounded context
|
|
27
|
+
|
|
28
|
+
<NodeGraph />
|
|
29
|
+
|
|
30
|
+
### Order example (sequence diagram)
|
|
31
|
+
|
|
32
|
+
```mermaid
|
|
33
|
+
sequenceDiagram
|
|
34
|
+
participant Customer
|
|
35
|
+
participant OrdersService
|
|
36
|
+
participant InventoryService
|
|
37
|
+
participant NotificationService
|
|
38
|
+
|
|
39
|
+
Customer->>OrdersService: Place Order
|
|
40
|
+
OrdersService->>InventoryService: Check Inventory
|
|
41
|
+
InventoryService-->>OrdersService: Inventory Available
|
|
42
|
+
OrdersService->>InventoryService: Reserve Inventory
|
|
43
|
+
OrdersService->>NotificationService: Send Order Confirmation
|
|
44
|
+
NotificationService-->>Customer: Order Confirmation
|
|
45
|
+
OrdersService->>Customer: Order Placed Successfully
|
|
46
|
+
OrdersService->>InventoryService: Update Inventory
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: Payment
|
|
3
3
|
name: Payment
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.1
|
|
5
5
|
summary: |
|
|
6
6
|
Domain that contains payment related services and messages.
|
|
7
7
|
owners:
|
|
@@ -22,8 +22,3 @@ The Payment Domain encompasses all services and components related to handling f
|
|
|
22
22
|
## Bounded context
|
|
23
23
|
|
|
24
24
|
<NodeGraph />
|
|
25
|
-
|
|
26
|
-
### Payment processing flow
|
|
27
|
-
Documented flow when a user makes a payment within the order domain
|
|
28
|
-
|
|
29
|
-
<Flow id="PaymentFlow" version="latest" includeKey={false} />
|
|
@@ -5,8 +5,14 @@ version: 0.0.1
|
|
|
5
5
|
summary: Event is triggered when a user initiates a payment through the Payment Service
|
|
6
6
|
owners:
|
|
7
7
|
- dboyne
|
|
8
|
+
channels:
|
|
9
|
+
- id: payments.{env}.events
|
|
10
|
+
parameters:
|
|
11
|
+
env: staging
|
|
8
12
|
---
|
|
9
13
|
|
|
14
|
+
import Footer from '@catalog/components/footer.astro';
|
|
15
|
+
|
|
10
16
|
## Overview
|
|
11
17
|
|
|
12
18
|
The Payment Initiated event is triggered when a user initiates a payment through the Payment Service. This event signifies the beginning of the payment process and contains all necessary information to process the payment.
|
|
@@ -29,4 +35,6 @@ The Payment Initiated event is triggered when a user initiates a payment through
|
|
|
29
35
|
|
|
30
36
|
- **Authentication**: Ensure that only authenticated users can initiate a payment, and the userId in the payload matches the authenticated user.
|
|
31
37
|
- **Data Validation**: Validate all input data to prevent injection attacks or other malicious input.
|
|
32
|
-
- **Sensitive Data Handling**: Avoid including sensitive information (e.g., credit card numbers) in the event payload. Use secure channels and encryption for such data.
|
|
38
|
+
- **Sensitive Data Handling**: Avoid including sensitive information (e.g., credit card numbers) in the event payload. Use secure channels and encryption for such data.
|
|
39
|
+
|
|
40
|
+
<Footer />
|
package/templates/default/domains/Payment/services/PaymentService/events/PaymentProcessed/index.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: PaymentProcessed
|
|
3
|
+
name: Payment Processed
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
summary: Event is triggered after the payment has been successfully processed
|
|
6
|
+
owners:
|
|
7
|
+
- dboyne
|
|
8
|
+
channels:
|
|
9
|
+
- id: payments.{env}.events
|
|
10
|
+
parameters:
|
|
11
|
+
env: staging
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
import Footer from '@catalog/components/footer.astro';
|
|
15
|
+
|
|
16
|
+
## Overview
|
|
17
|
+
|
|
18
|
+
The PaymentProcessed event is triggered after the payment has been successfully processed by the Payment Service. This event signifies that a payment has been confirmed, and it communicates the outcome to other services and components within the system.
|
|
19
|
+
|
|
20
|
+
<NodeGraph />
|
|
21
|
+
|
|
22
|
+
### Payload Example
|
|
23
|
+
|
|
24
|
+
```json title="Payload example"
|
|
25
|
+
{
|
|
26
|
+
"transactionId": "123e4567-e89b-12d3-a456-426614174000",
|
|
27
|
+
"userId": "123e4567-e89b-12d3-a456-426614174000",
|
|
28
|
+
"orderId": "789e1234-b56c-78d9-e012-3456789fghij",
|
|
29
|
+
"amount": 100.50,
|
|
30
|
+
"paymentMethod": "CreditCard",
|
|
31
|
+
"status": "confirmed",
|
|
32
|
+
"confirmationDetails": {
|
|
33
|
+
"gatewayResponse": "Approved",
|
|
34
|
+
"transactionId": "abc123"
|
|
35
|
+
},
|
|
36
|
+
"timestamp": "2024-07-04T14:48:00Z"
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Security Considerations
|
|
41
|
+
|
|
42
|
+
- **Data Validation**: Ensure that all data in the event payload is validated before publishing to prevent injection attacks or other malicious activities.
|
|
43
|
+
- **Sensitive Data Handling**: Avoid including sensitive information (e.g., full credit card numbers) in the event payload. Use secure channels and encryption for such data.
|
|
44
|
+
- **Authentication and Authorization**: Ensure that only authorized services can publish or consume PaymentProcessed events.
|
|
45
|
+
|
|
46
|
+
<Footer />
|
|
@@ -7,6 +7,8 @@ owners:
|
|
|
7
7
|
- dboyne
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
import Footer from '@catalog/components/footer.astro';
|
|
11
|
+
|
|
10
12
|
## Overview
|
|
11
13
|
|
|
12
14
|
The PaymentProcessed event is triggered after the payment has been successfully processed by the Payment Service. This event signifies that a payment has been confirmed, and it communicates the outcome to other services and components within the system.
|
|
@@ -35,4 +37,6 @@ The PaymentProcessed event is triggered after the payment has been successfully
|
|
|
35
37
|
|
|
36
38
|
- **Data Validation**: Ensure that all data in the event payload is validated before publishing to prevent injection attacks or other malicious activities.
|
|
37
39
|
- **Sensitive Data Handling**: Avoid including sensitive information (e.g., full credit card numbers) in the event payload. Use secure channels and encryption for such data.
|
|
38
|
-
- **Authentication and Authorization**: Ensure that only authorized services can publish or consume PaymentProcessed events.
|
|
40
|
+
- **Authentication and Authorization**: Ensure that only authorized services can publish or consume PaymentProcessed events.
|
|
41
|
+
|
|
42
|
+
<Footer />
|
|
@@ -9,23 +9,18 @@ owners:
|
|
|
9
9
|
receives:
|
|
10
10
|
- id: PaymentInitiated
|
|
11
11
|
version: 0.0.1
|
|
12
|
+
- id: GetPaymentStatus
|
|
12
13
|
sends:
|
|
13
14
|
- id: PaymentProcessed
|
|
14
15
|
version: 0.0.1
|
|
16
|
+
- id: GetOrder
|
|
15
17
|
repository:
|
|
16
18
|
language: JavaScript
|
|
17
|
-
url: https://github.com/
|
|
19
|
+
url: https://github.com/event-catalog/pretend-shipping-service
|
|
18
20
|
---
|
|
19
21
|
|
|
20
22
|
The Payment Service is a crucial component of our system that handles all payment-related operations. It processes payments, manages transactions, and communicates with other services through events. Using an event-driven architecture, it ensures that all actions are asynchronous, decoupled, and scalable.
|
|
21
23
|
|
|
22
|
-
<Tiles >
|
|
23
|
-
<Tile icon="DocumentIcon" href={`/docs/services/${frontmatter.id}/${frontmatter.version}/changelog`} title="View the changelog" description="Want to know the history of this service? View the change logs" />
|
|
24
|
-
<Tile icon="UserGroupIcon" href="/docs/users/dboyne" title="Contact the owner" description="Any questions? Feel free to contact the owners" />
|
|
25
|
-
<Tile icon="BoltIcon" href={`/visualiser/services/${frontmatter.id}/${frontmatter.version}`} title={`Sends ${frontmatter.sends.length} messages`} description="This service sends messages to downstream consumers" />
|
|
26
|
-
<Tile icon="BoltIcon" href={`/visualiser/services/${frontmatter.id}/${frontmatter.version}`} title={`Receives ${frontmatter.receives.length} messages`} description="This service receives messages from other services" />
|
|
27
|
-
</Tiles>
|
|
28
|
-
|
|
29
24
|
<NodeGraph />
|
|
30
25
|
|
|
31
26
|
### Key Components
|
package/templates/default/domains/Payment/services/PaymentService/queries/GetPaymentStatus/index.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: GetPaymentStatus
|
|
3
|
+
name: Get payment status
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
summary: |
|
|
6
|
+
GET request that will return the payment status for a specific order, identified by its orderId.
|
|
7
|
+
owners:
|
|
8
|
+
- dboyne
|
|
9
|
+
badges:
|
|
10
|
+
- content: Recently updated!
|
|
11
|
+
backgroundColor: green
|
|
12
|
+
textColor: green
|
|
13
|
+
schemaPath: schema.json
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
import Footer from '@catalog/components/footer.astro';
|
|
17
|
+
|
|
18
|
+
## Overview
|
|
19
|
+
|
|
20
|
+
The `GetPaymentStatus` message is a query used to retrieve the payment status for a specific order, identified by its `orderId`. This query returns the current status of the payment, such as whether it is pending, completed, failed, or refunded. It is used by systems that need to track the lifecycle of payments associated with orders, ensuring that the payment has been successfully processed or identifying if any issues occurred during the transaction.
|
|
21
|
+
|
|
22
|
+
This query is useful in scenarios such as order management, refund processing, or payment auditing, ensuring that users or systems have real-time visibility into the payment status for a given order.
|
|
23
|
+
|
|
24
|
+
<NodeGraph />
|
|
25
|
+
|
|
26
|
+
<SchemaViewer file="schema.json" title="JSON Schema" maxHeight="500" />
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
{
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"title": "GetPaymentStatusResponse",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"orderId": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The unique identifier for the order."
|
|
10
|
+
},
|
|
11
|
+
"paymentStatus": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"enum": ["pending", "completed", "failed", "refunded"],
|
|
14
|
+
"description": "The current payment status of the order."
|
|
15
|
+
},
|
|
16
|
+
"amount": {
|
|
17
|
+
"type": "number",
|
|
18
|
+
"description": "The amount paid for the order."
|
|
19
|
+
},
|
|
20
|
+
"currency": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "The currency in which the payment was made (e.g., USD, EUR)."
|
|
23
|
+
},
|
|
24
|
+
"paymentMethod": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "The payment method used for the transaction (e.g., Credit Card, PayPal)."
|
|
27
|
+
},
|
|
28
|
+
"transactionId": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "The unique identifier for the payment transaction."
|
|
31
|
+
},
|
|
32
|
+
"paymentDate": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"format": "date-time",
|
|
35
|
+
"description": "The date and time when the payment was processed."
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"required": ["orderId", "paymentStatus", "amount", "currency", "paymentMethod", "transactionId", "paymentDate"],
|
|
39
|
+
"additionalProperties": false
|
|
40
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: Subscription
|
|
3
|
+
name: Subscription
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
summary: |
|
|
6
|
+
Domain that contains subscription related services and messages.
|
|
7
|
+
owners:
|
|
8
|
+
- dboyne
|
|
9
|
+
services:
|
|
10
|
+
- id: SubscriptionService
|
|
11
|
+
version: 0.0.1
|
|
12
|
+
badges:
|
|
13
|
+
- content: Payment Domain
|
|
14
|
+
backgroundColor: blue
|
|
15
|
+
textColor: blue
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Overview
|
|
19
|
+
|
|
20
|
+
The Payment Domain encompasses all services and components related to handling financial transactions within the system. It is responsible for managing payments, transactions, billing, and financial records. The domain ensures secure, reliable, and efficient processing of all payment-related activities
|
|
21
|
+
|
|
22
|
+
## Bounded context
|
|
23
|
+
|
|
24
|
+
<NodeGraph />
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: CancelSubscription
|
|
3
|
+
name: Cancel subscription
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
summary: |
|
|
6
|
+
Command that will try and cancel a users subscription
|
|
7
|
+
owners:
|
|
8
|
+
- dboyne
|
|
9
|
+
badges:
|
|
10
|
+
- content: New!
|
|
11
|
+
backgroundColor: green
|
|
12
|
+
textColor: green
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
import Footer from '@catalog/components/footer.astro';
|
|
16
|
+
|
|
17
|
+
## Overview
|
|
18
|
+
|
|
19
|
+
The `CancelSubscription` command will try and cancel a subscription for the user.
|
|
20
|
+
|
|
21
|
+
## Architecture diagram
|
|
22
|
+
|
|
23
|
+
<NodeGraph />
|
|
24
|
+
|
|
25
|
+
<Footer />
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: SubscribeUser
|
|
3
|
+
name: Subscribe user
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
summary: |
|
|
6
|
+
Command that will try and subscribe a given user
|
|
7
|
+
owners:
|
|
8
|
+
- dboyne
|
|
9
|
+
badges:
|
|
10
|
+
- content: New!
|
|
11
|
+
backgroundColor: green
|
|
12
|
+
textColor: green
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
import Footer from '@catalog/components/footer.astro';
|
|
16
|
+
|
|
17
|
+
## Overview
|
|
18
|
+
|
|
19
|
+
The `SubscribeUser` command represents when a new user wants to subscribe to our service.
|
|
20
|
+
|
|
21
|
+
## Architecture diagram
|
|
22
|
+
|
|
23
|
+
<NodeGraph />
|
|
24
|
+
|
|
25
|
+
<Footer />
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: UserSubscriptionCancelled
|
|
3
|
+
name: User subscription cancelled
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
summary: |
|
|
6
|
+
An event that is triggered when a users subscription has been cancelled
|
|
7
|
+
owners:
|
|
8
|
+
- dboyne
|
|
9
|
+
badges:
|
|
10
|
+
- content: New!
|
|
11
|
+
backgroundColor: green
|
|
12
|
+
textColor: green
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
import Footer from '@catalog/components/footer.astro';
|
|
16
|
+
|
|
17
|
+
## Overview
|
|
18
|
+
|
|
19
|
+
The `UserSubscriptionCancelled` event is triggered when a users subscription has been cancelled.
|
|
20
|
+
|
|
21
|
+
## Architecture diagram
|
|
22
|
+
|
|
23
|
+
<NodeGraph />
|
|
24
|
+
|
|
25
|
+
<Footer />
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: UserSubscriptionStarted
|
|
3
|
+
name: User subscription started
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
summary: |
|
|
6
|
+
An event that is triggered when a new user subscription has started
|
|
7
|
+
owners:
|
|
8
|
+
- dboyne
|
|
9
|
+
badges:
|
|
10
|
+
- content: New!
|
|
11
|
+
backgroundColor: green
|
|
12
|
+
textColor: green
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
import Footer from '@catalog/components/footer.astro';
|
|
16
|
+
|
|
17
|
+
## Overview
|
|
18
|
+
|
|
19
|
+
The `UserSubscriptionStarted` event is triggered when a user starts a new subscription with our service.
|
|
20
|
+
|
|
21
|
+
## Architecture diagram
|
|
22
|
+
|
|
23
|
+
<NodeGraph />
|
|
24
|
+
|
|
25
|
+
<Footer />
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: SubscriptionService
|
|
3
|
+
version: 0.0.1
|
|
4
|
+
name: Subscription Service
|
|
5
|
+
summary: |
|
|
6
|
+
Service that handles subscriptions
|
|
7
|
+
owners:
|
|
8
|
+
- dboyne
|
|
9
|
+
receives:
|
|
10
|
+
- id: SubscribeUser
|
|
11
|
+
version: 0.0.1
|
|
12
|
+
- id: CancelSubscription
|
|
13
|
+
version: 0.0.1
|
|
14
|
+
- id: GetSubscriptionStatus
|
|
15
|
+
sends:
|
|
16
|
+
- id: UserSubscriptionStarted
|
|
17
|
+
version: 0.0.1
|
|
18
|
+
- id: UserSubscriptionCancelled
|
|
19
|
+
version: 0.0.1
|
|
20
|
+
repository:
|
|
21
|
+
language: JavaScript
|
|
22
|
+
url: https://github.com/event-catalog/pretend-subscription-service
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
import Footer from '@catalog/components/footer.astro';
|
|
26
|
+
|
|
27
|
+
## Overview
|
|
28
|
+
|
|
29
|
+
The subscription Service is responsible for handling customer subscriptions in our system. It handles new subscriptions, cancelling subscriptions and updating them.
|
|
30
|
+
|
|
31
|
+
<Tiles >
|
|
32
|
+
<Tile icon="DocumentIcon" href={`/docs/services/${frontmatter.id}/${frontmatter.version}/changelog`} title="View the changelog" description="Want to know the history of this service? View the change logs" />
|
|
33
|
+
<Tile icon="UserGroupIcon" href="/docs/teams/full-stack" title="Contact the team" description="Any questions? Feel free to contact the owners" />
|
|
34
|
+
<Tile icon="BoltIcon" href={`/visualiser/services/${frontmatter.id}/${frontmatter.version}`} title={`Sends ${frontmatter.sends.length} messages`} description="This service sends messages to downstream consumers" />
|
|
35
|
+
<Tile icon="BoltIcon" href={`/visualiser/services/${frontmatter.id}/${frontmatter.version}`} title={`Receives ${frontmatter.receives.length} messages`} description="This service receives messages from other services" />
|
|
36
|
+
</Tiles>
|
|
37
|
+
|
|
38
|
+
## Architecture diagram
|
|
39
|
+
|
|
40
|
+
<NodeGraph />
|
|
41
|
+
|
|
42
|
+
<Footer />
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: GetSubscriptionStatus
|
|
3
|
+
name: Get subscription status
|
|
4
|
+
version: 0.0.2
|
|
5
|
+
summary: |
|
|
6
|
+
GET request that will return the current subscription status for a specific user, identified by their userId.
|
|
7
|
+
owners:
|
|
8
|
+
- dboyne
|
|
9
|
+
badges:
|
|
10
|
+
- content: Recently updated!
|
|
11
|
+
backgroundColor: green
|
|
12
|
+
textColor: green
|
|
13
|
+
schemaPath: schema.json
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
import Footer from '@catalog/components/footer.astro';
|
|
17
|
+
|
|
18
|
+
## Overview
|
|
19
|
+
|
|
20
|
+
The `GetSubscriptionStatus` message is a query used to retrieve the current subscription status for a specific user, identified by their `userId`. This query returns detailed information about the user's subscription, such as its current status (active, canceled, expired), the subscription tier or plan, and the next billing date. It is typically used by systems that manage user subscriptions, billing, and renewal processes to ensure that users are aware of their subscription details and any upcoming renewals.
|
|
21
|
+
|
|
22
|
+
This query is particularly useful in managing subscriptions for SaaS products, media services, or any recurring payment-based services where users need to manage and view their subscription information.
|
|
23
|
+
|
|
24
|
+
<NodeGraph />
|
|
25
|
+
|
|
26
|
+
<SchemaViewer file="schema.json" title="JSON Schema" maxHeight="500" />
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
{
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"title": "GetSubscriptionStatusResponse",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"userId": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The unique identifier for the user."
|
|
10
|
+
},
|
|
11
|
+
"subscriptionStatus": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"enum": ["active", "canceled", "expired", "pending"],
|
|
14
|
+
"description": "The current status of the user's subscription."
|
|
15
|
+
},
|
|
16
|
+
"subscriptionPlan": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "The name or tier of the subscription plan."
|
|
19
|
+
},
|
|
20
|
+
"nextBillingDate": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"format": "date-time",
|
|
23
|
+
"description": "The date and time of the next billing or renewal."
|
|
24
|
+
},
|
|
25
|
+
"billingFrequency": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"enum": ["monthly", "yearly"],
|
|
28
|
+
"description": "The frequency of the billing cycle."
|
|
29
|
+
},
|
|
30
|
+
"amount": {
|
|
31
|
+
"type": "number",
|
|
32
|
+
"description": "The amount to be billed for the subscription."
|
|
33
|
+
},
|
|
34
|
+
"currency": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "The currency in which the subscription is billed (e.g., USD, EUR)."
|
|
37
|
+
},
|
|
38
|
+
"lastPaymentDate": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"format": "date-time",
|
|
41
|
+
"description": "The date and time when the last payment was processed."
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"required": ["userId", "subscriptionStatus", "subscriptionPlan", "nextBillingDate", "billingFrequency", "amount", "currency", "lastPaymentDate"],
|
|
45
|
+
"additionalProperties": false
|
|
46
|
+
}
|