@eventcatalog/create-eventcatalog 2.0.22 → 2.1.1
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/ubiquitous-language.md +127 -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/Payment/ubiquitous-language.md +96 -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/domains/Subscriptions/ubiquitous-language.md +129 -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,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
dictionary:
|
|
3
|
+
- id: Payment
|
|
4
|
+
name: Payment
|
|
5
|
+
summary: "The act of paying for magical goods or services."
|
|
6
|
+
icon: Wand2
|
|
7
|
+
- id: Purchase Order
|
|
8
|
+
name: Purchase Order
|
|
9
|
+
summary: "A mystical document issued by a buyer to a seller indicating the types, quantities, and agreed prices for enchanted products or services."
|
|
10
|
+
description: |
|
|
11
|
+
A purchase order (PO) is a magical document that initiates the buying process between mystical entities. It protects both buyer and seller by clearly documenting the transaction details. Key components include:
|
|
12
|
+
|
|
13
|
+
- Unique PO number for tracking
|
|
14
|
+
- Detailed item specifications and quantities
|
|
15
|
+
- Agreed prices and payment terms
|
|
16
|
+
- Delivery requirements and timelines
|
|
17
|
+
- Terms and conditions of the purchase
|
|
18
|
+
|
|
19
|
+
POs are essential for budget control, audit trails, and inventory management. They help prevent unauthorized purchases and provide a clear record for accounting and reconciliation purposes.
|
|
20
|
+
icon: FileText
|
|
21
|
+
- id: Order Line
|
|
22
|
+
name: Order Line
|
|
23
|
+
summary: "An individual enchanted item within a purchase order, representing a specific magical product or service being ordered."
|
|
24
|
+
description: |
|
|
25
|
+
Order lines are the fundamental building blocks of any purchase order. Each line represents a distinct item or service and contains critical information for order fulfillment:
|
|
26
|
+
|
|
27
|
+
- Product identifier (SKU or part number)
|
|
28
|
+
- Quantity ordered
|
|
29
|
+
- Unit price and total line value
|
|
30
|
+
- Special handling instructions
|
|
31
|
+
- Required delivery date
|
|
32
|
+
|
|
33
|
+
Order lines drive warehouse picking operations, shipping processes, and financial calculations. They are essential for tracking partial shipments and managing order modifications.
|
|
34
|
+
icon: ListOrdered
|
|
35
|
+
- id: SKU
|
|
36
|
+
name: SKU
|
|
37
|
+
summary: "Sorcery Keeping Unit - A unique identifier for distinct magical products and their variants in inventory."
|
|
38
|
+
description: |
|
|
39
|
+
SKUs are the cornerstone of effective inventory management systems. Each SKU represents a unique combination of product attributes:
|
|
40
|
+
|
|
41
|
+
- Product variations (size, color, style)
|
|
42
|
+
- Storage location identifiers
|
|
43
|
+
- Supplier information
|
|
44
|
+
- Reorder points and quantities
|
|
45
|
+
|
|
46
|
+
SKUs enable precise inventory tracking, automated reordering, and detailed sales analytics. They are crucial for maintaining optimal stock levels and preventing stockouts or overstock situations.
|
|
47
|
+
icon: Tag
|
|
48
|
+
- id: Consignment
|
|
49
|
+
name: Consignment
|
|
50
|
+
summary: "A batch of enchanted goods destined for or delivered to someone."
|
|
51
|
+
description: |
|
|
52
|
+
A consignment represents the physical movement of goods through the supply chain. It encompasses all aspects of the shipping process:
|
|
53
|
+
|
|
54
|
+
- Packaging and labeling requirements
|
|
55
|
+
- Transportation method and routing
|
|
56
|
+
- Customs documentation for international shipments
|
|
57
|
+
- Tracking and proof of delivery
|
|
58
|
+
|
|
59
|
+
Consignments may combine multiple orders for efficient shipping and can be tracked as a single unit throughout the delivery process. They are crucial for managing logistics costs and ensuring timely delivery to customers.
|
|
60
|
+
icon: Package
|
|
61
|
+
- id: Invoice
|
|
62
|
+
name: Invoice
|
|
63
|
+
summary: "A document issued by a seller to a buyer, listing enchanted goods or services provided and the amount due."
|
|
64
|
+
description: |
|
|
65
|
+
Invoices are critical for financial transactions, serving as a request for payment from the buyer. They include:
|
|
66
|
+
|
|
67
|
+
- Invoice number for tracking
|
|
68
|
+
- List of products or services provided
|
|
69
|
+
- Total amount due and payment terms
|
|
70
|
+
- Seller and buyer contact information
|
|
71
|
+
- Due date for payment
|
|
72
|
+
|
|
73
|
+
Invoices are essential for accounting, tax purposes, and maintaining cash flow.
|
|
74
|
+
icon: Receipt
|
|
75
|
+
- id: Supplier
|
|
76
|
+
name: Supplier
|
|
77
|
+
summary: "An entity that provides enchanted goods or services to another organization."
|
|
78
|
+
description: |
|
|
79
|
+
Suppliers are key partners in the supply chain, responsible for delivering the necessary products or services. Key aspects include:
|
|
80
|
+
|
|
81
|
+
- Supplier identification and contact details
|
|
82
|
+
- Product or service offerings
|
|
83
|
+
- Pricing and payment terms
|
|
84
|
+
- Delivery schedules and reliability
|
|
85
|
+
|
|
86
|
+
Effective supplier management ensures quality, cost-effectiveness, and timely delivery.
|
|
87
|
+
icon: Truck
|
|
88
|
+
- id: Inventory
|
|
89
|
+
name: Inventory
|
|
90
|
+
summary: "The complete list of enchanted items held in stock by a business."
|
|
91
|
+
description: |
|
|
92
|
+
Inventory management is crucial for balancing supply and demand. It involves:
|
|
93
|
+
|
|
94
|
+
- Tracking stock levels and locations
|
|
95
|
+
- Managing reorder points and quantities
|
|
96
|
+
- Conducting regular stock audits
|
|
97
|
+
- Analyzing inventory turnover rates
|
|
98
|
+
|
|
99
|
+
Proper inventory management minimizes costs and maximizes service levels.
|
|
100
|
+
icon: Warehouse
|
|
101
|
+
- id: Fulfillment
|
|
102
|
+
name: Fulfillment
|
|
103
|
+
summary: "The process of completing an order and delivering it to the customer."
|
|
104
|
+
description: |
|
|
105
|
+
Fulfillment encompasses all steps from order receipt to delivery, including:
|
|
106
|
+
|
|
107
|
+
- Order processing and picking
|
|
108
|
+
- Packaging and shipping
|
|
109
|
+
- Delivery tracking and confirmation
|
|
110
|
+
- Handling returns and exchanges
|
|
111
|
+
|
|
112
|
+
Efficient fulfillment is key to customer satisfaction and operational efficiency.
|
|
113
|
+
icon: PackageCheck
|
|
114
|
+
- id: Return
|
|
115
|
+
name: Return
|
|
116
|
+
summary: "The process of sending back enchanted goods to the seller for a refund or exchange."
|
|
117
|
+
description: |
|
|
118
|
+
Returns management is an important aspect of customer service and inventory control. It involves:
|
|
119
|
+
|
|
120
|
+
- Processing return requests and authorizations
|
|
121
|
+
- Inspecting returned items for quality
|
|
122
|
+
- Restocking or disposing of returned goods
|
|
123
|
+
- Issuing refunds or exchanges
|
|
124
|
+
|
|
125
|
+
A streamlined returns process enhances customer loyalty and operational efficiency.
|
|
126
|
+
icon: PackageX
|
|
127
|
+
---
|
|
@@ -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,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
dictionary:
|
|
3
|
+
- id: Transaction
|
|
4
|
+
name: Transaction
|
|
5
|
+
summary: "The process of transferring funds from one party to another."
|
|
6
|
+
icon: CreditCard
|
|
7
|
+
- id: Invoice
|
|
8
|
+
name: Invoice
|
|
9
|
+
summary: "A document issued by a seller to a buyer, listing goods or services provided and the amount due."
|
|
10
|
+
description: |
|
|
11
|
+
Invoices are critical for financial transactions, serving as a request for payment from the buyer. They include:
|
|
12
|
+
|
|
13
|
+
- Invoice number for tracking
|
|
14
|
+
- List of products or services provided
|
|
15
|
+
- Total amount due and payment terms
|
|
16
|
+
- Seller and buyer contact information
|
|
17
|
+
- Due date for payment
|
|
18
|
+
|
|
19
|
+
Invoices are essential for accounting, tax purposes, and maintaining cash flow.
|
|
20
|
+
icon: CreditCard
|
|
21
|
+
- id: Payment Method
|
|
22
|
+
name: Payment Method
|
|
23
|
+
summary: "The means by which a payment is made, such as credit card or bank transfer."
|
|
24
|
+
description: |
|
|
25
|
+
Payment methods are the various ways customers can pay for goods or services. Common methods include:
|
|
26
|
+
|
|
27
|
+
- Credit and debit cards
|
|
28
|
+
- Bank transfers
|
|
29
|
+
- Digital wallets
|
|
30
|
+
- Cash on delivery
|
|
31
|
+
|
|
32
|
+
Offering multiple payment methods can enhance customer satisfaction and increase sales.
|
|
33
|
+
icon: Wallet
|
|
34
|
+
- id: Receipt
|
|
35
|
+
name: Receipt
|
|
36
|
+
summary: "A document acknowledging that a payment has been made."
|
|
37
|
+
description: |
|
|
38
|
+
Receipts serve as proof of payment and are important for record-keeping. They typically include:
|
|
39
|
+
|
|
40
|
+
- Receipt number
|
|
41
|
+
- Date and time of payment
|
|
42
|
+
- Amount paid
|
|
43
|
+
- Payment method used
|
|
44
|
+
- Details of the transaction
|
|
45
|
+
|
|
46
|
+
Receipts are essential for both customers and businesses to track financial transactions.
|
|
47
|
+
icon: Receipt
|
|
48
|
+
- id: Refund
|
|
49
|
+
name: Refund
|
|
50
|
+
summary: "The process of returning funds to a customer for a returned product or service."
|
|
51
|
+
description: |
|
|
52
|
+
Refunds are issued when a customer returns a product or cancels a service. The process involves:
|
|
53
|
+
|
|
54
|
+
- Verifying the return or cancellation
|
|
55
|
+
- Processing the refund through the original payment method
|
|
56
|
+
- Updating financial records
|
|
57
|
+
|
|
58
|
+
Efficient refund processes can improve customer satisfaction and loyalty.
|
|
59
|
+
icon: RotateCcw
|
|
60
|
+
- id: Currency
|
|
61
|
+
name: Currency
|
|
62
|
+
summary: "The system of money in general use in a particular country."
|
|
63
|
+
description: |
|
|
64
|
+
Currency is the medium of exchange for goods and services. Key aspects include:
|
|
65
|
+
|
|
66
|
+
- Currency code (e.g., USD, EUR)
|
|
67
|
+
- Exchange rates
|
|
68
|
+
- Currency symbols
|
|
69
|
+
|
|
70
|
+
Understanding currency is crucial for international transactions and financial reporting.
|
|
71
|
+
icon: DollarSign
|
|
72
|
+
- id: Payment Gateway
|
|
73
|
+
name: Payment Gateway
|
|
74
|
+
summary: "A service that authorizes and processes payments for online and offline transactions."
|
|
75
|
+
description: |
|
|
76
|
+
Payment gateways facilitate the transfer of payment information between the customer and the merchant. They ensure secure and efficient transactions by:
|
|
77
|
+
|
|
78
|
+
- Encrypting sensitive data
|
|
79
|
+
- Authorizing payments
|
|
80
|
+
- Providing transaction reports
|
|
81
|
+
|
|
82
|
+
Choosing a reliable payment gateway is essential for business operations.
|
|
83
|
+
icon: Server
|
|
84
|
+
- id: Chargeback
|
|
85
|
+
name: Chargeback
|
|
86
|
+
summary: "A demand by a credit card provider for a retailer to make good the loss on a fraudulent or disputed transaction."
|
|
87
|
+
description: |
|
|
88
|
+
Chargebacks occur when a customer disputes a transaction, and the funds are returned to their account. The process involves:
|
|
89
|
+
|
|
90
|
+
- Investigating the dispute
|
|
91
|
+
- Providing evidence to the payment processor
|
|
92
|
+
- Resolving the issue with the customer
|
|
93
|
+
|
|
94
|
+
Managing chargebacks effectively can prevent financial losses and maintain customer trust.
|
|
95
|
+
icon: AlertCircle
|
|
96
|
+
---
|
|
@@ -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 />
|