@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: InventoryAdjusted
|
|
3
3
|
name: Inventory adjusted
|
|
4
|
-
version:
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
summary: |
|
|
6
6
|
Indicates a change in inventory level
|
|
7
7
|
owners:
|
|
@@ -10,6 +10,8 @@ owners:
|
|
|
10
10
|
- asmith
|
|
11
11
|
- full-stack
|
|
12
12
|
- mobile-devs
|
|
13
|
+
channels:
|
|
14
|
+
- id: inventory.{env}.events
|
|
13
15
|
badges:
|
|
14
16
|
- content: Recently updated!
|
|
15
17
|
backgroundColor: green
|
|
@@ -20,10 +22,17 @@ badges:
|
|
|
20
22
|
schemaPath: 'schema.avro'
|
|
21
23
|
---
|
|
22
24
|
|
|
25
|
+
import Footer from '@catalog/components/footer.astro';
|
|
26
|
+
|
|
23
27
|
## Overview
|
|
24
28
|
|
|
25
29
|
The `Inventory Adjusted` event is triggered whenever there is a change in the inventory levels of a product. This could occur due to various reasons such as receiving new stock, sales, returns, or manual adjustments by the inventory management team. The event ensures that all parts of the system that rely on inventory data are kept up-to-date with the latest inventory levels.
|
|
26
30
|
|
|
31
|
+
<Tiles >
|
|
32
|
+
<Tile icon="UserGroupIcon" href="/docs/teams/full-stack" title="Contact the team" description="Any questions? Feel free to contact the owners" />
|
|
33
|
+
<Tile icon="DocumentIcon" href={`/generated/events/Inventory/${frontmatter.id}/schema.avro`} title="View the schema" description="View the schema directly in your browser" />
|
|
34
|
+
</Tiles>
|
|
35
|
+
|
|
27
36
|
## Architecture diagram
|
|
28
37
|
|
|
29
38
|
<NodeGraph />
|
|
@@ -32,7 +41,7 @@ The `Inventory Adjusted` event is triggered whenever there is a change in the in
|
|
|
32
41
|
|
|
33
42
|
## Payload example
|
|
34
43
|
|
|
35
|
-
Event example you
|
|
44
|
+
Event example you my see being published.
|
|
36
45
|
|
|
37
46
|
```json title="Payload example"
|
|
38
47
|
{
|
|
@@ -102,4 +111,6 @@ consumer = KafkaConsumer(
|
|
|
102
111
|
for message in consumer:
|
|
103
112
|
event_data = json.loads(message.value)
|
|
104
113
|
print(f"Received Inventory Adjusted event: {event_data}")
|
|
105
|
-
```
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
<Footer />
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Employee",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"description": "A record representing an employee",
|
|
6
|
+
"properties": {
|
|
7
|
+
"Name": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The name of the employee"
|
|
10
|
+
},
|
|
11
|
+
"Age": {
|
|
12
|
+
"type": "integer",
|
|
13
|
+
"description": "The age of the employee"
|
|
14
|
+
},
|
|
15
|
+
"Department": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "The department where the employee works"
|
|
18
|
+
},
|
|
19
|
+
"Position": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "The position or title of the employee within the department"
|
|
22
|
+
},
|
|
23
|
+
"Salary": {
|
|
24
|
+
"type": "number",
|
|
25
|
+
"format": "double",
|
|
26
|
+
"description": "The salary of the employee"
|
|
27
|
+
},
|
|
28
|
+
"JoinDate": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"format": "date",
|
|
31
|
+
"description": "The date when the employee joined the company"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"required": ["Name", "Age", "Department", "Position", "Salary", "JoinDate"]
|
|
35
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: OutOfStock
|
|
3
|
+
name: Inventory out of stock
|
|
4
|
+
version: 0.0.4
|
|
5
|
+
summary: |
|
|
6
|
+
Indicates inventory is out of stock
|
|
7
|
+
owners:
|
|
8
|
+
- dboyne
|
|
9
|
+
- msmith
|
|
10
|
+
- asmith
|
|
11
|
+
- full-stack
|
|
12
|
+
- mobile-devs
|
|
13
|
+
channels:
|
|
14
|
+
- id: inventory.{env}.events
|
|
15
|
+
badges:
|
|
16
|
+
- content: Recently updated!
|
|
17
|
+
backgroundColor: green
|
|
18
|
+
textColor: green
|
|
19
|
+
- content: Channel:Apache Kafka
|
|
20
|
+
backgroundColor: yellow
|
|
21
|
+
textColor: yellow
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
import Footer from '@catalog/components/footer.astro';
|
|
25
|
+
|
|
26
|
+
## Overview
|
|
27
|
+
|
|
28
|
+
The `Inventory Adjusted` event is triggered whenever there is a change in the inventory levels of a product. This could occur due to various reasons such as receiving new stock, sales, returns, or manual adjustments by the inventory management team. The event ensures that all parts of the system that rely on inventory data are kept up-to-date with the latest inventory levels.
|
|
29
|
+
|
|
30
|
+
<NodeGraph />
|
|
31
|
+
|
|
32
|
+
### Payload
|
|
33
|
+
The payload of the `Inventory Adjusted` event includes the following fields:
|
|
34
|
+
|
|
35
|
+
```json title="Example of payload" frame="terminal"
|
|
36
|
+
{
|
|
37
|
+
"event_id": "string",
|
|
38
|
+
"timestamp": "ISO 8601 date-time",
|
|
39
|
+
"product_id": "string",
|
|
40
|
+
"adjusted_quantity": "integer",
|
|
41
|
+
"new_quantity": "integer",
|
|
42
|
+
"adjustment_reason": "string",
|
|
43
|
+
"adjusted_by": "string"
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Producing the Event
|
|
48
|
+
|
|
49
|
+
To produce an Inventory Adjusted event, use the following example Kafka producer configuration in Python:
|
|
50
|
+
|
|
51
|
+
```python title="Produce event in Python" frame="terminal"
|
|
52
|
+
from kafka import KafkaProducer
|
|
53
|
+
import json
|
|
54
|
+
from datetime import datetime
|
|
55
|
+
|
|
56
|
+
# Kafka configuration
|
|
57
|
+
producer = KafkaProducer(
|
|
58
|
+
bootstrap_servers=['localhost:9092'],
|
|
59
|
+
value_serializer=lambda v: json.dumps(v).encode('utf-8')
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
# Event data
|
|
63
|
+
event_data = {
|
|
64
|
+
"event_id": "abc123",
|
|
65
|
+
"timestamp": datetime.utcnow().isoformat() + 'Z',
|
|
66
|
+
"product_id": "prod987",
|
|
67
|
+
"adjusted_quantity": 10,
|
|
68
|
+
"new_quantity": 150,
|
|
69
|
+
"adjustment_reason": "restock",
|
|
70
|
+
"adjusted_by": "user123"
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
# Send event to Kafka topic
|
|
74
|
+
producer.send('inventory.adjusted', event_data)
|
|
75
|
+
producer.flush()
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Consuming the Event
|
|
79
|
+
|
|
80
|
+
To consume an Inventory Adjusted event, use the following example Kafka consumer configuration in Python:
|
|
81
|
+
|
|
82
|
+
```python title="Consuming the event with python" frame="terminal"
|
|
83
|
+
from kafka import KafkaConsumer
|
|
84
|
+
import json
|
|
85
|
+
|
|
86
|
+
# Kafka configuration
|
|
87
|
+
consumer = KafkaConsumer(
|
|
88
|
+
'inventory.adjusted',
|
|
89
|
+
bootstrap_servers=['localhost:9092'],
|
|
90
|
+
auto_offset_reset='earliest',
|
|
91
|
+
enable_auto_commit=True,
|
|
92
|
+
group_id='inventory_group',
|
|
93
|
+
value_serializer=lambda v: json.dumps(v).encode('utf-8')
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
# Consume events
|
|
97
|
+
for message in consumer:
|
|
98
|
+
event_data = json.loads(message.value)
|
|
99
|
+
print(f"Received Inventory Adjusted event: {event_data}")
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
<Footer />
|
|
@@ -11,22 +11,29 @@ owners:
|
|
|
11
11
|
receives:
|
|
12
12
|
- id: OrderConfirmed
|
|
13
13
|
version: 0.0.1
|
|
14
|
-
- id:
|
|
14
|
+
- id: GetInventoryList
|
|
15
15
|
version: 0.0.1
|
|
16
16
|
- id: OrderAmended
|
|
17
|
-
version: 0.0.1
|
|
18
17
|
- id: UpdateInventory
|
|
19
18
|
version: 0.0.3
|
|
19
|
+
- id: AddInventory
|
|
20
|
+
- id: GetInventoryStatus
|
|
20
21
|
sends:
|
|
21
22
|
- id: InventoryAdjusted
|
|
22
23
|
version: 0.0.4
|
|
23
24
|
- id: OutOfStock
|
|
24
25
|
version: 0.0.3
|
|
26
|
+
- id: GetOrder
|
|
27
|
+
version: 0.0.1
|
|
25
28
|
repository:
|
|
26
29
|
language: JavaScript
|
|
27
|
-
url: https://github.com/
|
|
30
|
+
url: https://github.com/event-catalog/pretend-shipping-service
|
|
28
31
|
---
|
|
29
32
|
|
|
33
|
+
import Footer from '@catalog/components/footer.astro';
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
30
37
|
## Overview
|
|
31
38
|
|
|
32
39
|
The Inventory Service is a critical component of the system responsible for managing product stock levels, tracking inventory movements, and ensuring product availability. It interacts with other services to maintain accurate inventory records and supports operations such as order fulfillment, restocking, and inventory audits.
|
|
@@ -38,6 +45,44 @@ The Inventory Service is a critical component of the system responsible for mana
|
|
|
38
45
|
<Tile icon="BoltIcon" href={`/visualiser/services/${frontmatter.id}/${frontmatter.version}`} title={`Receives ${frontmatter.receives.length} messages`} description="This service receives messages from other services" />
|
|
39
46
|
</Tiles>
|
|
40
47
|
|
|
48
|
+
|
|
41
49
|
## Architecture diagram
|
|
42
50
|
|
|
43
|
-
<NodeGraph title="Hello world" />
|
|
51
|
+
<NodeGraph title="Hello world" />
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
<Steps title="How to connect to Inventory Service">
|
|
55
|
+
<Step title="Obtain API credentials">
|
|
56
|
+
Request API credentials from the Inventory Service team.
|
|
57
|
+
</Step>
|
|
58
|
+
<Step title="Install the SDK">
|
|
59
|
+
Run the following command in your project directory:
|
|
60
|
+
```bash
|
|
61
|
+
npm install inventory-service-sdk
|
|
62
|
+
```
|
|
63
|
+
</Step>
|
|
64
|
+
<Step title="Initialize the client">
|
|
65
|
+
Use the following code to initialize the Inventory Service client:
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
const InventoryService = require('inventory-service-sdk');
|
|
69
|
+
const client = new InventoryService.Client({
|
|
70
|
+
clientId: 'YOUR_CLIENT_ID',
|
|
71
|
+
clientSecret: 'YOUR_CLIENT_SECRET',
|
|
72
|
+
apiUrl: 'https://api.inventoryservice.com/v1'
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
</Step>
|
|
76
|
+
<Step title="Make API calls">
|
|
77
|
+
|
|
78
|
+
You can now use the client to make API calls. For example, to get all products:
|
|
79
|
+
|
|
80
|
+
```js
|
|
81
|
+
client.getProducts()
|
|
82
|
+
.then(products => console.log(products))
|
|
83
|
+
.catch(error => console.error(error));
|
|
84
|
+
```
|
|
85
|
+
</Step>
|
|
86
|
+
</Steps>
|
|
87
|
+
|
|
88
|
+
<Footer />
|
package/templates/default/domains/Orders/services/InventoryService/queries/GetInventoryList/index.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: GetInventoryList
|
|
3
|
+
name: List inventory list
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
summary: |
|
|
6
|
+
GET request that will return inventory list
|
|
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 GetInventoryList message is a query used to retrieve a comprehensive list of all available inventory items within a system. It is designed to return detailed information about each item, such as product names, quantities, availability status, and potentially additional metadata like categories or locations. This query is typically utilized by systems or services that require a real-time view of current stock, ensuring that downstream applications or users have accurate and up-to-date information for decision-making or operational purposes. The GetInventoryList is ideal for use cases such as order processing, stock management, or reporting, providing visibility into the full range of inventory data.
|
|
21
|
+
|
|
22
|
+
<NodeGraph />
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "GetInventoryList",
|
|
4
|
+
"description": "A query to retrieve a list of all available inventory items with their details.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"filters": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"description": "Optional filters to narrow down the inventory search.",
|
|
10
|
+
"properties": {
|
|
11
|
+
"category": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "Filter items by category (e.g., electronics, clothing, etc.)."
|
|
14
|
+
},
|
|
15
|
+
"location": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Filter items by storage location or warehouse."
|
|
18
|
+
},
|
|
19
|
+
"minStockLevel": {
|
|
20
|
+
"type": "integer",
|
|
21
|
+
"description": "Filter items with a stock level greater than or equal to this value."
|
|
22
|
+
},
|
|
23
|
+
"inStock": {
|
|
24
|
+
"type": "boolean",
|
|
25
|
+
"description": "Filter items that are currently in stock (true) or out of stock (false)."
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"additionalProperties": false
|
|
29
|
+
},
|
|
30
|
+
"pagination": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"description": "Pagination options for the query.",
|
|
33
|
+
"properties": {
|
|
34
|
+
"page": {
|
|
35
|
+
"type": "integer",
|
|
36
|
+
"description": "The current page of results.",
|
|
37
|
+
"minimum": 1,
|
|
38
|
+
"default": 1
|
|
39
|
+
},
|
|
40
|
+
"pageSize": {
|
|
41
|
+
"type": "integer",
|
|
42
|
+
"description": "The number of items per page.",
|
|
43
|
+
"minimum": 1,
|
|
44
|
+
"default": 10
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"required": ["page", "pageSize"]
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"required": [],
|
|
51
|
+
"additionalProperties": false
|
|
52
|
+
}
|
|
53
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: GetInventoryStatus
|
|
3
|
+
name: Get inventory status
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
summary: |
|
|
6
|
+
GET request that will return the current stock status for a specific product.
|
|
7
|
+
owners:
|
|
8
|
+
- dboyne
|
|
9
|
+
badges:
|
|
10
|
+
- content: GET Request
|
|
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 GetInventoryStatus message is a query designed to retrieve the current stock status for a specific product.
|
|
21
|
+
|
|
22
|
+
This query provides detailed information about the available quantity, reserved quantity, and the warehouse location where the product is stored. It is typically used by systems or services that need to determine the real-time availability of a product, enabling efficient stock management, order fulfillment, and inventory tracking processes.
|
|
23
|
+
|
|
24
|
+
This query is essential for ensuring accurate stock levels are reported to downstream systems, including e-commerce platforms, warehouse management systems, and sales channels.
|
|
25
|
+
|
|
26
|
+
<NodeGraph />
|
|
27
|
+
|
|
28
|
+
<SchemaViewer file="schema.json" title="JSON Schema" maxHeight="500" />
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Query using CURL
|
|
32
|
+
|
|
33
|
+
Use this snippet to query the inventory status
|
|
34
|
+
|
|
35
|
+
```sh title="Example CURL command"
|
|
36
|
+
curl -X GET "https://api.yourdomain.com/inventory/status" \
|
|
37
|
+
-H "Content-Type: application/json" \
|
|
38
|
+
-d '{
|
|
39
|
+
"productId": "12345"
|
|
40
|
+
}'
|
|
41
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "GetInventoryStatusResponse",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"productId": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"description": "The unique identifier for the product"
|
|
9
|
+
},
|
|
10
|
+
"availableQuantity": {
|
|
11
|
+
"type": "integer",
|
|
12
|
+
"description": "The quantity of the product currently available in stock",
|
|
13
|
+
"minimum": 0
|
|
14
|
+
},
|
|
15
|
+
"reservedQuantity": {
|
|
16
|
+
"type": "integer",
|
|
17
|
+
"description": "The quantity of the product that is reserved for pending orders",
|
|
18
|
+
"minimum": 0
|
|
19
|
+
},
|
|
20
|
+
"warehouseLocation": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "The location of the warehouse where the product is stored"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"required": ["productId", "availableQuantity", "reservedQuantity", "warehouseLocation"],
|
|
26
|
+
"additionalProperties": false
|
|
27
|
+
}
|
|
28
|
+
|
|
@@ -24,7 +24,7 @@ sends:
|
|
|
24
24
|
version: 0.0.3
|
|
25
25
|
repository:
|
|
26
26
|
language: JavaScript
|
|
27
|
-
url: https://github.com/
|
|
27
|
+
url: https://github.com/event-catalog/pretend-shipping-service
|
|
28
28
|
---
|
|
29
29
|
|
|
30
30
|
## Overview
|
|
@@ -33,4 +33,4 @@ The Inventory Service is a critical component of the system responsible for mana
|
|
|
33
33
|
|
|
34
34
|
## Architecture diagram
|
|
35
35
|
|
|
36
|
-
<NodeGraph title="Hello world" />
|
|
36
|
+
<NodeGraph title="Hello world" />
|
|
@@ -8,22 +8,37 @@ owners:
|
|
|
8
8
|
- dboyne
|
|
9
9
|
receives:
|
|
10
10
|
- id: InventoryAdjusted
|
|
11
|
-
version: 0.0
|
|
11
|
+
version: ">1.0.0"
|
|
12
|
+
- id: PaymentProcessed
|
|
13
|
+
version: ^1.0.0
|
|
14
|
+
- id: GetUserNotifications
|
|
15
|
+
version: x
|
|
16
|
+
- id: GetNotificationDetails
|
|
17
|
+
version: x
|
|
18
|
+
sends:
|
|
19
|
+
- id: OutOfStock
|
|
20
|
+
version: latest
|
|
21
|
+
- id: GetInventoryList
|
|
22
|
+
version: 0.0.x
|
|
12
23
|
repository:
|
|
13
24
|
language: JavaScript
|
|
14
|
-
url: https://github.com/
|
|
25
|
+
url: https://github.com/event-catalog/pretend-shipping-service
|
|
15
26
|
---
|
|
16
27
|
|
|
28
|
+
import Footer from '@catalog/components/footer.astro';
|
|
29
|
+
|
|
17
30
|
## Overview
|
|
18
31
|
|
|
19
32
|
The Notification Service is responsible for managing and delivering notifications to users and other services. It supports various notification channels such as email, SMS, push notifications, and in-app notifications. The service ensures reliable and timely delivery of messages and integrates with other services to trigger notifications based on specific events.
|
|
20
33
|
|
|
21
34
|
<Tiles >
|
|
22
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" />
|
|
23
|
-
<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" />
|
|
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" />
|
|
24
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" />
|
|
25
39
|
</Tiles>
|
|
26
40
|
|
|
41
|
+
|
|
27
42
|
## Architecture diagram
|
|
28
43
|
|
|
29
44
|
<NodeGraph />
|
|
@@ -39,4 +54,6 @@ The Notification Service is responsible for managing and delivering notification
|
|
|
39
54
|
- Description: The medium through which the notification is delivered (e.g., email, SMS, push notification).
|
|
40
55
|
- Attributes: channelId, name, provider, configuration
|
|
41
56
|
</Accordion>
|
|
42
|
-
</AccordionGroup>
|
|
57
|
+
</AccordionGroup>
|
|
58
|
+
|
|
59
|
+
<Footer />
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: GetNotificationDetails
|
|
3
|
+
name: Get notification details
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
summary: |
|
|
6
|
+
GET request that will return detailed information about a specific notification, identified by its notificationId.
|
|
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 `GetNotificationDetails` message is a query used to retrieve detailed information about a specific notification identified by its `notificationId`. It provides a comprehensive overview of the notification, including the title, message content, status (read/unread), the date it was created, and any additional metadata related to the notification, such as associated orders or system events. This query is helpful in scenarios where users or systems need detailed insights into a particular notification, such as retrieving full messages or auditing notifications sent to users.
|
|
21
|
+
|
|
22
|
+
Use cases include viewing detailed information about order updates, system notifications, or promotional messages, allowing users to view their full notification history and details.
|
|
23
|
+
|
|
24
|
+
<NodeGraph />
|
|
25
|
+
|
|
26
|
+
<SchemaViewer file="schema.json" title="JSON Schema" maxHeight="500" />
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
|
|
2
|
+
{
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"title": "GetNotificationDetailsResponse",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"notificationId": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The unique identifier for the notification."
|
|
10
|
+
},
|
|
11
|
+
"title": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "The title or subject of the notification."
|
|
14
|
+
},
|
|
15
|
+
"message": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "The content or message body of the notification."
|
|
18
|
+
},
|
|
19
|
+
"status": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"enum": ["unread", "read"],
|
|
22
|
+
"description": "The read status of the notification."
|
|
23
|
+
},
|
|
24
|
+
"userId": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "The unique identifier for the user who received the notification."
|
|
27
|
+
},
|
|
28
|
+
"createdAt": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"format": "date-time",
|
|
31
|
+
"description": "The date and time when the notification was created."
|
|
32
|
+
},
|
|
33
|
+
"type": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "The type of the notification, such as order or system."
|
|
36
|
+
},
|
|
37
|
+
"metadata": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"description": "Additional metadata related to the notification, such as order details.",
|
|
40
|
+
"properties": {
|
|
41
|
+
"orderId": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "The associated order ID, if applicable."
|
|
44
|
+
},
|
|
45
|
+
"shippingProvider": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"description": "The shipping provider for the associated order, if applicable."
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"required": ["orderId"],
|
|
51
|
+
"additionalProperties": false
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"required": ["notificationId", "title", "message", "status", "userId", "createdAt", "type"],
|
|
55
|
+
"additionalProperties": false
|
|
56
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: GetUserNotifications
|
|
3
|
+
name: Get user notifications
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
summary: |
|
|
6
|
+
GET request that will return a list of notifications for a specific user, with options to filter by status (unread or all).
|
|
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 `GetUserNotifications` message is a query used to retrieve a list of notifications for a specific user. It allows filtering by notification status, such as unread or all notifications. This query is typically utilized by notification services to display user-specific messages, such as order updates, promotional offers, or system notifications. It supports pagination through `limit` and `offset` parameters, ensuring that only a manageable number of notifications are retrieved at once. This query helps users stay informed about important events or updates related to their account, orders, or the platform.
|
|
21
|
+
|
|
22
|
+
Use cases include delivering notifications for order updates, promotional campaigns, or general system messages to keep the user informed.
|
|
23
|
+
|
|
24
|
+
<NodeGraph />
|
|
25
|
+
|
|
26
|
+
<SchemaViewer file="schema.json" title="JSON Schema" maxHeight="500" />
|
|
27
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "GetUserNotificationsResponse",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"userId": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"description": "The unique identifier for the user."
|
|
9
|
+
},
|
|
10
|
+
"notifications": {
|
|
11
|
+
"type": "array",
|
|
12
|
+
"description": "A list of notifications for the user.",
|
|
13
|
+
"items": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"properties": {
|
|
16
|
+
"notificationId": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "The unique identifier for the notification."
|
|
19
|
+
},
|
|
20
|
+
"title": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "The title or subject of the notification."
|
|
23
|
+
},
|
|
24
|
+
"message": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "The message body of the notification."
|
|
27
|
+
},
|
|
28
|
+
"status": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"enum": ["unread", "read"],
|
|
31
|
+
"description": "The read status of the notification."
|
|
32
|
+
},
|
|
33
|
+
"createdAt": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"format": "date-time",
|
|
36
|
+
"description": "The date and time when the notification was created."
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"required": ["notificationId", "title", "message", "status", "createdAt"],
|
|
40
|
+
"additionalProperties": false
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"required": ["userId", "notifications"],
|
|
45
|
+
"additionalProperties": false
|
|
46
|
+
}
|
|
47
|
+
|