@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
|
@@ -15,12 +15,20 @@ badges:
|
|
|
15
15
|
backgroundColor: yellow
|
|
16
16
|
textColor: yellow
|
|
17
17
|
schemaPath: schema.avro
|
|
18
|
+
channels:
|
|
19
|
+
- id: orders.{env}.events
|
|
20
|
+
parameters:
|
|
21
|
+
env: staging
|
|
18
22
|
---
|
|
19
23
|
|
|
24
|
+
import Footer from '@catalog/components/footer.astro';
|
|
25
|
+
|
|
20
26
|
## Overview
|
|
21
27
|
|
|
22
28
|
The OrderAmended event is triggered whenever an existing order is modified. This event ensures that all relevant services are notified of changes to an order, such as updates to order items, quantities, shipping information, or status. The event allows the system to maintain consistency and ensure that all dependent services can react appropriately to the amendments.
|
|
23
29
|
|
|
30
|
+
<NodeGraph />
|
|
31
|
+
|
|
24
32
|
## Example payload
|
|
25
33
|
|
|
26
34
|
```json title="Example Payload"
|
|
@@ -51,3 +59,4 @@ The OrderAmended event is triggered whenever an existing order is modified. This
|
|
|
51
59
|
|
|
52
60
|
<Schema file="schema.json" />
|
|
53
61
|
|
|
62
|
+
<Footer />
|
|
@@ -15,8 +15,12 @@ badges:
|
|
|
15
15
|
backgroundColor: yellow
|
|
16
16
|
textColor: yellow
|
|
17
17
|
schemaPath: 'schema.json'
|
|
18
|
+
channels:
|
|
19
|
+
- id: orders.{env}.events
|
|
18
20
|
---
|
|
19
21
|
|
|
22
|
+
import Footer from '@catalog/components/footer.astro';
|
|
23
|
+
|
|
20
24
|
## Overview
|
|
21
25
|
|
|
22
26
|
The OrderCancelled event is triggered whenever an existing order is cancelled. This event ensures that all relevant services are notified of the cancellation, allowing them to take appropriate actions such as updating inventory levels, refunding payments, and notifying the user. The event helps maintain consistency across the system by ensuring all dependent services are aware of the order cancellation.
|
|
@@ -48,4 +52,6 @@ The OrderCancelled event is triggered whenever an existing order is cancelled. T
|
|
|
48
52
|
|
|
49
53
|
JSON schema for the event.
|
|
50
54
|
|
|
51
|
-
<Schema title="JSON Schema" file="schema.json"/>
|
|
55
|
+
<Schema title="JSON Schema" file="schema.json"/>
|
|
56
|
+
|
|
57
|
+
<Footer />
|
|
@@ -15,8 +15,12 @@ badges:
|
|
|
15
15
|
backgroundColor: yellow
|
|
16
16
|
textColor: yellow
|
|
17
17
|
schemaPath: schema.json
|
|
18
|
+
channels:
|
|
19
|
+
- id: orders.{env}.events
|
|
18
20
|
---
|
|
19
21
|
|
|
22
|
+
import Footer from '@catalog/components/footer.astro';
|
|
23
|
+
|
|
20
24
|
## Overview
|
|
21
25
|
|
|
22
26
|
The OrderConfirmed event is triggered when an order has been successfully confirmed. This event notifies relevant services that the order is ready for further processing, such as inventory adjustment, payment finalization, and preparation for shipping.
|
|
@@ -48,4 +52,6 @@ The OrderConfirmed event is triggered when an order has been successfully confir
|
|
|
48
52
|
|
|
49
53
|
## Schema
|
|
50
54
|
|
|
51
|
-
<Schema file="schema.json"/>
|
|
55
|
+
<Schema file="schema.json"/>
|
|
56
|
+
|
|
57
|
+
<Footer />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: OrdersService
|
|
3
|
-
version: 0.0.
|
|
3
|
+
version: 0.0.3
|
|
4
4
|
name: Orders Service
|
|
5
5
|
summary: |
|
|
6
6
|
Service that handles orders
|
|
@@ -9,28 +9,37 @@ owners:
|
|
|
9
9
|
receives:
|
|
10
10
|
- id: InventoryAdjusted
|
|
11
11
|
version: 0.0.3
|
|
12
|
+
- id: GetOrder
|
|
12
13
|
sends:
|
|
14
|
+
- id: OrderAmended
|
|
15
|
+
- id: OrderCancelled
|
|
16
|
+
- id: OrderConfirmed
|
|
13
17
|
- id: AddInventory
|
|
14
18
|
version: 0.0.3
|
|
15
19
|
repository:
|
|
16
20
|
language: JavaScript
|
|
17
|
-
url: https://github.com/
|
|
21
|
+
url: https://github.com/event-catalog/pretend-shipping-service
|
|
18
22
|
schemaPath: "openapi.yml"
|
|
19
23
|
specifications:
|
|
24
|
+
asyncapiPath: order-service-asyncapi.yaml
|
|
20
25
|
openapiPath: openapi.yml
|
|
21
26
|
---
|
|
22
27
|
|
|
28
|
+
import Footer from '@catalog/components/footer.astro';
|
|
29
|
+
|
|
23
30
|
## Overview
|
|
24
31
|
|
|
25
32
|
The Orders Service is responsible for managing customer orders within the system. It handles order creation, updating, status tracking, and interactions with other services such as Inventory, Payment, and Notification services to ensure smooth order processing and fulfillment.
|
|
26
33
|
|
|
27
34
|
<Tiles >
|
|
28
35
|
<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" />
|
|
29
|
-
<Tile icon="UserGroupIcon" href="/docs/
|
|
36
|
+
<Tile icon="UserGroupIcon" href="/docs/teams/full-stack" title="Contact the team" description="Any questions? Feel free to contact the owners" />
|
|
30
37
|
<Tile icon="BoltIcon" href={`/visualiser/services/${frontmatter.id}/${frontmatter.version}`} title={`Sends ${frontmatter.sends.length} messages`} description="This service sends messages to downstream consumers" />
|
|
31
38
|
<Tile icon="BoltIcon" href={`/visualiser/services/${frontmatter.id}/${frontmatter.version}`} title={`Receives ${frontmatter.receives.length} messages`} description="This service receives messages from other services" />
|
|
32
39
|
</Tiles>
|
|
33
40
|
|
|
34
41
|
## Architecture diagram
|
|
35
42
|
|
|
36
|
-
<NodeGraph />
|
|
43
|
+
<NodeGraph />
|
|
44
|
+
|
|
45
|
+
<Footer />
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
openapi: 3.1.0
|
|
2
|
+
info:
|
|
3
|
+
title: Simple Task - API
|
|
4
|
+
version: 1.0.2
|
|
5
|
+
description: Simple Api
|
|
6
|
+
contact: {}
|
|
7
|
+
license:
|
|
8
|
+
name: apache 2.0
|
|
9
|
+
identifier: apache-2.0
|
|
10
|
+
url: https://www.apache.org/licenses/LICENSE-2.0.html
|
|
11
|
+
|
|
12
|
+
servers:
|
|
13
|
+
- url: https://example.com/
|
|
14
|
+
|
|
15
|
+
paths:
|
|
16
|
+
/v1/task/{id}:
|
|
17
|
+
put:
|
|
18
|
+
summary: Do Simple Task
|
|
19
|
+
operationId: DoSimpleTask
|
|
20
|
+
responses:
|
|
21
|
+
'200':
|
|
22
|
+
description: do a task by id
|
|
23
|
+
content:
|
|
24
|
+
application/json:
|
|
25
|
+
schema:
|
|
26
|
+
$ref: '#/components/schemas/Task'
|
|
27
|
+
'204':
|
|
28
|
+
description: No content
|
|
29
|
+
'400':
|
|
30
|
+
description: Problem with data
|
|
31
|
+
content:
|
|
32
|
+
application/json:
|
|
33
|
+
schema:
|
|
34
|
+
$ref: '#/components/schemas/Error'
|
|
35
|
+
'403':
|
|
36
|
+
description: Not Authorized
|
|
37
|
+
content:
|
|
38
|
+
application/json:
|
|
39
|
+
schema:
|
|
40
|
+
$ref: '#/components/schemas/Unauthorized'
|
|
41
|
+
'404':
|
|
42
|
+
description: not found
|
|
43
|
+
content:
|
|
44
|
+
application/json:
|
|
45
|
+
schema:
|
|
46
|
+
$ref: '#/components/schemas/Error'
|
|
47
|
+
'500':
|
|
48
|
+
description: Internal server error
|
|
49
|
+
content:
|
|
50
|
+
application/json:
|
|
51
|
+
schema:
|
|
52
|
+
$ref: '#/components/schemas/Error'
|
|
53
|
+
description: Allows to do a simple task
|
|
54
|
+
security:
|
|
55
|
+
- authorization: []
|
|
56
|
+
parameters:
|
|
57
|
+
- in: path
|
|
58
|
+
name: id
|
|
59
|
+
required: true
|
|
60
|
+
schema:
|
|
61
|
+
type: string
|
|
62
|
+
delete:
|
|
63
|
+
summary: Delete Task
|
|
64
|
+
operationId: DeleteTask
|
|
65
|
+
responses:
|
|
66
|
+
'204':
|
|
67
|
+
description: Task deleted
|
|
68
|
+
'400':
|
|
69
|
+
description: Problem with data
|
|
70
|
+
content:
|
|
71
|
+
application/json:
|
|
72
|
+
schema:
|
|
73
|
+
$ref: '#/components/schemas/Error'
|
|
74
|
+
'403':
|
|
75
|
+
description: Not Authorized
|
|
76
|
+
content:
|
|
77
|
+
application/json:
|
|
78
|
+
schema:
|
|
79
|
+
$ref: '#/components/schemas/Unauthorized'
|
|
80
|
+
'404':
|
|
81
|
+
description: not found
|
|
82
|
+
content:
|
|
83
|
+
application/json:
|
|
84
|
+
schema:
|
|
85
|
+
$ref: '#/components/schemas/Error'
|
|
86
|
+
'500':
|
|
87
|
+
description: Internal server error
|
|
88
|
+
content:
|
|
89
|
+
application/json:
|
|
90
|
+
schema:
|
|
91
|
+
$ref: '#/components/schemas/Error'
|
|
92
|
+
description: Delete a task
|
|
93
|
+
security:
|
|
94
|
+
- authorization: []
|
|
95
|
+
parameters:
|
|
96
|
+
- in: path
|
|
97
|
+
name: id
|
|
98
|
+
required: true
|
|
99
|
+
schema:
|
|
100
|
+
type: string
|
|
101
|
+
/v1/tasks:
|
|
102
|
+
get:
|
|
103
|
+
summary: Get List of Tasks
|
|
104
|
+
operationId: GetTaskList
|
|
105
|
+
responses:
|
|
106
|
+
'200':
|
|
107
|
+
description: Successfully retrieved list of tasks
|
|
108
|
+
content:
|
|
109
|
+
application/json:
|
|
110
|
+
schema:
|
|
111
|
+
type: array
|
|
112
|
+
items:
|
|
113
|
+
$ref: '#/components/schemas/Task'
|
|
114
|
+
'400':
|
|
115
|
+
description: Bad request
|
|
116
|
+
content:
|
|
117
|
+
application/json:
|
|
118
|
+
schema:
|
|
119
|
+
$ref: '#/components/schemas/Error'
|
|
120
|
+
'403':
|
|
121
|
+
description: Not Authorized
|
|
122
|
+
content:
|
|
123
|
+
application/json:
|
|
124
|
+
schema:
|
|
125
|
+
$ref: '#/components/schemas/Unauthorized'
|
|
126
|
+
'500':
|
|
127
|
+
description: Internal server error
|
|
128
|
+
content:
|
|
129
|
+
application/json:
|
|
130
|
+
schema:
|
|
131
|
+
$ref: '#/components/schemas/Error'
|
|
132
|
+
description: Retrieves a list of all tasks
|
|
133
|
+
security:
|
|
134
|
+
- authorization: []
|
|
135
|
+
parameters:
|
|
136
|
+
- in: query
|
|
137
|
+
name: limit
|
|
138
|
+
schema:
|
|
139
|
+
type: integer
|
|
140
|
+
minimum: 1
|
|
141
|
+
maximum: 100
|
|
142
|
+
default: 20
|
|
143
|
+
description: The maximum number of tasks to return
|
|
144
|
+
- in: query
|
|
145
|
+
name: offset
|
|
146
|
+
schema:
|
|
147
|
+
type: integer
|
|
148
|
+
minimum: 0
|
|
149
|
+
default: 0
|
|
150
|
+
description: The number of tasks to skip before starting to return results
|
|
151
|
+
|
|
152
|
+
components:
|
|
153
|
+
schemas:
|
|
154
|
+
Task:
|
|
155
|
+
properties:
|
|
156
|
+
comments:
|
|
157
|
+
type: string
|
|
158
|
+
creationDate:
|
|
159
|
+
type: string
|
|
160
|
+
taskId:
|
|
161
|
+
type: string
|
|
162
|
+
description:
|
|
163
|
+
type: string
|
|
164
|
+
lastUpdate:
|
|
165
|
+
type: string
|
|
166
|
+
type: object
|
|
167
|
+
additionalProperties: false
|
|
168
|
+
Error:
|
|
169
|
+
properties:
|
|
170
|
+
error:
|
|
171
|
+
type: string
|
|
172
|
+
required:
|
|
173
|
+
- error
|
|
174
|
+
type: object
|
|
175
|
+
Unauthorized:
|
|
176
|
+
properties:
|
|
177
|
+
message:
|
|
178
|
+
type: string
|
|
179
|
+
required:
|
|
180
|
+
- message
|
|
181
|
+
type: object
|
|
182
|
+
securitySchemes:
|
|
183
|
+
authorization:
|
|
184
|
+
type: http
|
|
185
|
+
scheme: bearer
|
|
@@ -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,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: GetOrder
|
|
3
|
+
name: Get order details
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
summary: |
|
|
6
|
+
GET request that will return detailed information about 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 `GetOrder` message is a query used to retrieve detailed information about a specific order, identified by its `orderId`. It provides information such as the order status (e.g., pending, completed, shipped), the items within the order, billing and shipping details, payment information, and the order's total amount. This query is commonly used by systems managing order processing, customer service, or order tracking functionalities.
|
|
21
|
+
|
|
22
|
+
This query can be applied in e-commerce systems, marketplaces, or any platform where users and systems need real-time order data for tracking, auditing, or managing customer purchases.
|
|
23
|
+
|
|
24
|
+
<NodeGraph />
|
|
25
|
+
|
|
26
|
+
<SchemaViewer file="schema.json" title="JSON Schema" maxHeight="500" />
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: OrdersService
|
|
3
|
+
version: 0.0.2
|
|
4
|
+
name: Orders Service
|
|
5
|
+
summary: |
|
|
6
|
+
Service that handles orders
|
|
7
|
+
owners:
|
|
8
|
+
- dboyne
|
|
9
|
+
receives:
|
|
10
|
+
- id: InventoryAdjusted
|
|
11
|
+
version: 0.0.3
|
|
12
|
+
sends:
|
|
13
|
+
- id: AddInventory
|
|
14
|
+
version: 0.0.3
|
|
15
|
+
repository:
|
|
16
|
+
language: JavaScript
|
|
17
|
+
url: https://github.com/event-catalog/pretend-shipping-service
|
|
18
|
+
schemaPath: "openapi.yml"
|
|
19
|
+
specifications:
|
|
20
|
+
asyncapiPath: order-service-asyncapi.yaml
|
|
21
|
+
openapiPath: openapi.yml
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
import Footer from '@catalog/components/footer.astro';
|
|
25
|
+
|
|
26
|
+
## Overview
|
|
27
|
+
|
|
28
|
+
The Orders Service is responsible for managing customer orders within the system. It handles order creation, updating, status tracking, and interactions with other services such as Inventory, Payment, and Notification services to ensure smooth order processing and fulfillment.
|
|
29
|
+
|
|
30
|
+
## Architecture diagram
|
|
31
|
+
|
|
32
|
+
<NodeGraph />
|
|
33
|
+
|
|
34
|
+
<Footer />
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
openapi: 3.1.0
|
|
2
|
+
info:
|
|
3
|
+
title: Simple Task - API
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
description: Simple Api
|
|
6
|
+
contact: {}
|
|
7
|
+
license:
|
|
8
|
+
name: apache 2.0
|
|
9
|
+
identifier: apache-2.0
|
|
10
|
+
url: https://www.apache.org/licenses/LICENSE-2.0.html
|
|
11
|
+
|
|
12
|
+
servers:
|
|
13
|
+
- url: https://example.com/
|
|
14
|
+
|
|
15
|
+
paths:
|
|
16
|
+
/v1/task/{id}:
|
|
17
|
+
put:
|
|
18
|
+
summary: Do Simple Task
|
|
19
|
+
operationId: DoSimpleTask
|
|
20
|
+
responses:
|
|
21
|
+
'200':
|
|
22
|
+
description: do a task by id
|
|
23
|
+
content:
|
|
24
|
+
application/json:
|
|
25
|
+
schema:
|
|
26
|
+
$ref: '#/components/schemas/Task'
|
|
27
|
+
'204':
|
|
28
|
+
description: No content
|
|
29
|
+
'400':
|
|
30
|
+
description: Problem with data
|
|
31
|
+
content:
|
|
32
|
+
application/json:
|
|
33
|
+
schema:
|
|
34
|
+
$ref: '#/components/schemas/Error'
|
|
35
|
+
'403':
|
|
36
|
+
description: Not Authorized
|
|
37
|
+
content:
|
|
38
|
+
application/json:
|
|
39
|
+
schema:
|
|
40
|
+
$ref: '#/components/schemas/Unauthorized'
|
|
41
|
+
'404':
|
|
42
|
+
description: not found
|
|
43
|
+
content:
|
|
44
|
+
application/json:
|
|
45
|
+
schema:
|
|
46
|
+
$ref: '#/components/schemas/Error'
|
|
47
|
+
'500':
|
|
48
|
+
description: Internal server error
|
|
49
|
+
content:
|
|
50
|
+
application/json:
|
|
51
|
+
schema:
|
|
52
|
+
$ref: '#/components/schemas/Error'
|
|
53
|
+
description: Allows to do a simple task
|
|
54
|
+
security:
|
|
55
|
+
- authorization: []
|
|
56
|
+
parameters:
|
|
57
|
+
- in: path
|
|
58
|
+
name: id
|
|
59
|
+
required: true
|
|
60
|
+
schema:
|
|
61
|
+
type: string
|
|
62
|
+
|
|
63
|
+
components:
|
|
64
|
+
schemas:
|
|
65
|
+
Task:
|
|
66
|
+
properties:
|
|
67
|
+
comments:
|
|
68
|
+
type: string
|
|
69
|
+
creationDate:
|
|
70
|
+
type: string
|
|
71
|
+
taskId:
|
|
72
|
+
type: string
|
|
73
|
+
description:
|
|
74
|
+
type: string
|
|
75
|
+
lastUpdate:
|
|
76
|
+
type: string
|
|
77
|
+
type: object
|
|
78
|
+
additionalProperties: false
|
|
79
|
+
Error:
|
|
80
|
+
properties:
|
|
81
|
+
error:
|
|
82
|
+
type: string
|
|
83
|
+
required:
|
|
84
|
+
- error
|
|
85
|
+
type: object
|
|
86
|
+
Unauthorized:
|
|
87
|
+
properties:
|
|
88
|
+
message:
|
|
89
|
+
type: string
|
|
90
|
+
required:
|
|
91
|
+
- message
|
|
92
|
+
type: object
|
|
93
|
+
securitySchemes:
|
|
94
|
+
authorization:
|
|
95
|
+
type: http
|
|
96
|
+
scheme: bearer
|