---
id: ConfiguracaoAtualizada
name: Configuração atualizada
version: 1.0.0
owners:
- full-stack
summary: "Evento publicado pelo domínio Programacao: uma configuração de programação é atualizada."
---
## Visão geral
O evento **Configuração atualizada** representa o fato de que uma configuração de programação é atualizada.
---
id: DeliveryFailed
name: Delivery failed
version: 0.0.1
summary: |
Event that is emitted when a shipment delivery fails.
owners:
- dboyne
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `DeliveryFailed` event is emitted when a shipment delivery fails. It provides information such as the shipment status (e.g., pending, completed, shipped), the items within the shipment, 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.
This event can be applied in e-commerce systems, marketplaces, or any platform where users and systems need real-time shipment data for tracking, auditing, or managing customer purchases.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"title": "DeliveryFailed",
"description": "Schema for delivery failed event",
"properties": {
"shipmentId": {
"type": "string",
"description": "Unique identifier for the shipment"
},
"orderId": {
"type": "string",
"description": "Identifier for the associated order"
}
},
"required": ["shipmentId", "orderId"]
}
---
id: EntregaFinalizada
name: Entrega finalizada
version: 1.0.0
owners:
- full-stack
summary: "Evento publicado pelo domínio Entregas: a entrega de um pedido é finalizada."
---
## Visão geral
O evento **Entrega finalizada** representa o fato de que a entrega de um pedido é finalizada.
---
id: FraudCheckCompleted
version: 0.0.1
name: Fraud Check Completed
summary: Emitted when a fraud check has been completed for a transaction
owners:
- dboyne
tags:
- payment
- fraud
- security
badges:
- content: New
backgroundColor: green
textColor: white
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `FraudCheckCompleted` event is emitted when the fraud detection service has completed its analysis of a payment transaction. This event contains the risk assessment results and recommendations.
## Schema
## Event Details
- **Risk Score**: A numerical score from 0-100 indicating fraud risk
- **Decision**: APPROVED, DECLINED, or MANUAL_REVIEW
- **Reasons**: Array of reasons for the decision
- **Confidence**: Confidence level of the fraud detection
## Example Payload
```json
{
"transactionId": "txn_1234567890",
"paymentId": "pay_9876543210",
"riskScore": 25,
"decision": "APPROVED",
"reasons": ["Low risk merchant", "Customer history positive"],
"confidence": 0.92,
"timestamp": "2024-01-15T10:30:00Z"
}
```
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"transactionId": {
"type": "string",
"description": "Unique identifier for the transaction"
},
"paymentId": {
"type": "string",
"description": "Unique identifier for the payment"
},
"riskScore": {
"type": "number",
"minimum": 0,
"maximum": 100,
"description": "Risk score from 0-100"
},
"decision": {
"type": "string",
"enum": ["APPROVED", "DECLINED", "MANUAL_REVIEW"],
"description": "Fraud check decision"
},
"reasons": {
"type": "array",
"items": {
"type": "string"
},
"description": "Reasons for the decision"
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "Confidence level of the decision"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "When the fraud check was completed"
}
},
"required": ["transactionId", "paymentId", "riskScore", "decision", "timestamp"]
}
---
id: InventoryAdjusted
name: Inventory adjusted
version: 0.0.1
schemaPath: schema.json
summary: |
Indicates a change in inventory level
owners:
- dboyne
badges:
- content: Recently updated!
backgroundColor: green
textColor: green
---
When firing this event make sure you set the `correlation-id` in the headers. Our schemas have standard metadata make sure you
read and follow it.
### Details
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"event_id": {
"type": "string",
"description": "Unique identifier for the event"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "Timestamp of the inventory adjustment"
},
"product_id": {
"type": "string",
"description": "Identifier of the adjusted product"
},
"adjusted_quantity": {
"type": "integer",
"description": "The quantity adjusted (positive or negative)"
},
"new_quantity": {
"type": "integer",
"description": "The new total inventory quantity"
},
"adjustment_reason": {
"type": "string",
"description": "Reason for the adjustment"
},
"adjusted_by": {
"type": "string",
"description": "Identifier of the user who made the adjustment"
}
},
"required": ["event_id", "timestamp", "product_id", "adjusted_quantity", "new_quantity"]
}
---
id: InventoryAdjusted
name: Inventory adjusted
version: 1.0.0
schemaPath: schema.json
summary: |
Indicates a change in inventory level
owners:
- dboyne
- msmith
- asmith
- full-stack
- mobile-devs
badges:
- content: Recently updated!
backgroundColor: green
textColor: green
- content: Channel:Apache Kafka
backgroundColor: yellow
textColor: yellow
---
## Overview
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.
## Event Details
### Event Name
`inventory.adjusted`
### Description
This event indicates that the inventory count for one or more products has been adjusted. The event carries the updated inventory details including the product ID, the new quantity, and the reason for the adjustment.
### Payload
The payload of the `Inventory Adjusted` event includes the following fields:
```json title="Example of payload" frame="terminal"
{
"event_id": "string",
"timestamp": "ISO 8601 date-time",
"product_id": "string",
"adjusted_quantity": "integer",
"new_quantity": "integer",
"adjustment_reason": "string",
"adjusted_by": "string"
}
```
### Producing the Event
To produce an Inventory Adjusted event, use the following example Kafka producer configuration in Python:
```python title="Produce event in Python" frame="terminal"
from kafka import KafkaProducer
import json
from datetime import datetime
# Kafka configuration
producer = KafkaProducer(
bootstrap_servers=['localhost:9092'],
value_serializer=lambda v: json.dumps(v).encode('utf-8')
)
# Event data
event_data = {
"event_id": "abc123",
"timestamp": datetime.utcnow().isoformat() + 'Z',
"product_id": "prod987",
"adjusted_quantity": 10,
"new_quantity": 150,
"adjustment_reason": "restock",
"adjusted_by": "user123"
}
# Send event to Kafka topic
producer.send('inventory.adjusted', event_data)
producer.flush()
```
### Consuming the Event
To consume an Inventory Adjusted event, use the following example Kafka consumer configuration in Python:
```python title="Consuming the event with python" frame="terminal"
from kafka import KafkaConsumer
import json
# Kafka configuration
consumer = KafkaConsumer(
'inventory.adjusted',
bootstrap_servers=['localhost:9092'],
auto_offset_reset='earliest',
enable_auto_commit=True,
group_id='inventory_group',
value_serializer=lambda v: json.dumps(v).encode('utf-8')
)
# Consume events
for message in consumer:
event_data = json.loads(message.value)
print(f"Received Inventory Adjusted event: {event_data}")
```
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"event_id": {
"type": "string",
"description": "Unique identifier for the event"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "Timestamp of the inventory adjustment"
},
"product_id": {
"type": "string",
"description": "Identifier of the adjusted product"
},
"adjusted_quantity": {
"type": "integer",
"description": "The quantity adjusted (positive or negative)"
},
"new_quantity": {
"type": "integer",
"description": "The new total inventory quantity"
},
"adjustment_reason": {
"type": "string",
"description": "Reason for the adjustment"
},
"adjusted_by": {
"type": "string",
"description": "Identifier of the user who made the adjustment"
}
},
"required": ["event_id", "timestamp", "product_id", "adjusted_quantity", "new_quantity"]
}
---
id: InventoryAdjusted
name: Inventory adjusted
version: 1.0.1
summary: |
Indicates a change in inventory level
owners:
- dboyne
- msmith
- asmith
- full-stack
- mobile-devs
badges:
- content: Recently updated!
backgroundColor: green
textColor: green
- content: 'Channel:Apache Kafka'
backgroundColor: yellow
textColor: yellow
schemaPath: schema.avro
---
import Footer from '@catalog/components/footer.astro';
## Overview
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.
## Architecture diagram
## Payload example
Event example you my see being published.
```json title="Payload example"
{
"Name": "John Doe",
"Age": 30,
"Department": "Engineering",
"Position": "Software Engineer",
"Salary": 85000.5,
"JoinDate": "2024-01-15"
}
```
## Schema (avro)
## Producing the Event
To produce an Inventory Adjusted event, use the following example Kafka producer configuration in Python:
```python title="Produce event in Python" frame="terminal"
from kafka import KafkaProducer
import json
from datetime import datetime
# Kafka configuration
producer = KafkaProducer(
bootstrap_servers=['localhost:9092'],
value_serializer=lambda v: json.dumps(v).encode('utf-8')
)
# Event data
event_data = {
"event_id": "abc123",
"timestamp": datetime.utcnow().isoformat() + 'Z',
"product_id": "prod987",
"adjusted_quantity": 10,
"new_quantity": 150,
"adjustment_reason": "restock",
"adjusted_by": "user123"
}
# Send event to Kafka topic
producer.send('inventory.adjusted', event_data)
producer.flush()
```
### Consuming the Event
To consume an Inventory Adjusted event, use the following example Kafka consumer configuration in Python:
```python title="Consuming the event with python" frame="terminal"
from kafka import KafkaConsumer
import json
# Kafka configuration
consumer = KafkaConsumer(
'inventory.adjusted',
bootstrap_servers=['localhost:9092'],
auto_offset_reset='earliest',
enable_auto_commit=True,
group_id='inventory_group',
value_serializer=lambda v: json.dumps(v).encode('utf-8')
)
# Consume events
for message in consumer:
event_data = json.loads(message.value)
print(f"Received Inventory Adjusted event: {event_data}")
```
## Raw Schema:schema.avro
{
"type" : "record",
"namespace" : "Tutorialspoint",
"name" : "Employee",
"fields" : [
{ "name" : "Name", "type" : "string" },
{ "name" : "Age", "type" : "int" },
{ "name" : "Department", "type" : "string" },
{ "name" : "Position", "type" : "string" },
{ "name" : "Salary", "type" : "double" },
{ "name" : "JoinDate", "type" : "string", "logicalType": "date" }
]
}
---
id: NovaProgramacaoCriada
name: Nova programação criada
version: 1.0.0
owners:
- full-stack
summary: "Evento publicado pelo domínio Programacao: uma nova programação é criada."
---
## Visão geral
O evento **Nova programação criada** representa o fato de que uma nova programação é criada.
---
id: OrderAmended
name: Order amended
version: 0.0.1
summary: |
Indicates an order has been changed
owners:
- dboyne
- msmith
badges:
- content: Recently updated!
backgroundColor: green
textColor: green
- content: 'Channel:Apache Kafka'
backgroundColor: yellow
textColor: yellow
schemaPath: schema.avro
---
import Footer from '@catalog/components/footer.astro';
## Overview
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.
## Example payload
```json title="Example Payload"
{
"orderId": "123e4567-e89b-12d3-a456-426614174000",
"userId": "123e4567-e89b-12d3-a456-426614174000",
"amendedItems": [
{
"productId": "789e1234-b56c-78d9-e012-3456789fghij",
"productName": "Example Product",
"oldQuantity": 2,
"newQuantity": 3,
"unitPrice": 29.99,
"totalPrice": 89.97
}
],
"orderStatus": "confirmed",
"totalAmount": 150.75,
"timestamp": "2024-07-04T14:48:00Z"
}
```
## Schema (Avro)
## Schema (JSON)
## Raw Schema:schema.avro
{
"type": "record",
"name": "OrderAmendedEvent",
"namespace": "com.example.events",
"fields": [
{
"name": "orderId",
"type": "string",
"doc": "The unique identifier of the order that was amended."
},
{
"name": "userId",
"type": "string",
"doc": "The unique identifier of the user who placed the order."
},
{
"name": "amendedItems",
"type": {
"type": "array",
"items": {
"type": "record",
"name": "AmendedItem",
"fields": [
{
"name": "productId",
"type": "string",
"doc": "The unique identifier of the product."
},
{
"name": "productName",
"type": "string",
"doc": "The name of the product."
},
{
"name": "oldQuantity",
"type": "int",
"doc": "The original quantity of the product ordered."
},
{
"name": "newQuantity",
"type": "int",
"doc": "The new quantity of the product ordered."
},
{
"name": "unitPrice",
"type": "double",
"doc": "The price per unit of the product."
},
{
"name": "totalPrice",
"type": "double",
"doc": "The total price for this order item (newQuantity * unitPrice)."
}
]
}
},
"doc": "A list of items that were amended in the order, each containing product details and updated quantities."
},
{
"name": "orderStatus",
"type": "string",
"doc": "The current status of the order after the amendment."
},
{
"name": "totalAmount",
"type": "double",
"doc": "The total amount of the order after the amendment."
},
{
"name": "timestamp",
"type": "string",
"doc": "The date and time when the order was amended, in ISO 8601 format."
}
]
}
---
id: OrderCancelled
name: Order cancelled
version: 0.0.1
summary: |
Indicates an order has been canceled
owners:
- dboyne
- msmith
badges:
- content: Recently updated!
backgroundColor: green
textColor: green
- content: 'Channel:Apache Kafka'
backgroundColor: yellow
textColor: yellow
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
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.
## Example payload
```json title="Example payload"
{
"orderId": "123e4567-e89b-12d3-a456-426614174000",
"userId": "123e4567-e89b-12d3-a456-426614174000",
"orderItems": [
{
"productId": "789e1234-b56c-78d9-e012-3456789fghij",
"productName": "Example Product",
"quantity": 2,
"unitPrice": 29.99,
"totalPrice": 59.98
}
],
"orderStatus": "cancelled",
"totalAmount": 59.98,
"cancellationReason": "Customer requested cancellation",
"timestamp": "2024-07-04T14:48:00Z"
}
```
## Schema
JSON schema for the event.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OrderCancelledEvent",
"type": "object",
"properties": {
"orderId": {
"type": "string",
"format": "uuid",
"description": "The unique identifier of the order that was cancelled."
},
"userId": {
"type": "string",
"format": "uuid",
"description": "The unique identifier of the user who placed the order."
},
"orderItems": {
"type": "array",
"description": "A list of items included in the cancelled order, each containing product details and quantities.",
"items": {
"type": "object",
"properties": {
"productId": {
"type": "string",
"format": "uuid",
"description": "The unique identifier of the product."
},
"productName": {
"type": "string",
"description": "The name of the product."
},
"quantity": {
"type": "integer",
"description": "The quantity of the product ordered."
},
"unitPrice": {
"type": "number",
"format": "float",
"description": "The price per unit of the product."
},
"totalPrice": {
"type": "number",
"format": "float",
"description": "The total price for this order item (quantity * unit price)."
}
},
"required": ["productId", "productName", "quantity", "unitPrice", "totalPrice"]
}
},
"orderStatus": {
"type": "string",
"description": "The current status of the order after cancellation.",
"enum": ["cancelled"]
},
"totalAmount": {
"type": "number",
"format": "float",
"description": "The total amount of the order that was cancelled."
},
"cancellationReason": {
"type": "string",
"description": "The reason for the order cancellation, if provided."
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "The date and time when the order was cancelled."
}
},
"required": ["orderId", "userId", "orderItems", "orderStatus", "totalAmount", "timestamp"],
"additionalProperties": false
}
---
id: OrderConfirmed
name: Order confirmed
version: 0.0.1
summary: |
Indicates an order has been confirmed
owners:
- dboyne
- msmith
badges:
- content: Recently updated!
backgroundColor: green
textColor: green
- content: 'Channel:Apache Kafka'
backgroundColor: yellow
textColor: yellow
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
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.
## Architecture Diagram
## Payload
```json title="Example payload"
{
"orderId": "123e4567-e89b-12d3-a456-426614174000",
"userId": "123e4567-e89b-12d3-a456-426614174000",
"orderItems": [
{
"productId": "789e1234-b56c-78d9-e012-3456789fghij",
"productName": "Example Product",
"quantity": 2,
"unitPrice": 29.99,
"totalPrice": 59.98
}
],
"orderStatus": "confirmed",
"totalAmount": 150.75,
"confirmationTimestamp": "2024-07-04T14:48:00Z"
}
```
## Schema
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OrderConfirmedEvent",
"type": "object",
"properties": {
"orderId": {
"type": "string",
"format": "uuid",
"description": "The unique identifier of the confirmed order."
},
"userId": {
"type": "string",
"format": "uuid",
"description": "The unique identifier of the user who placed the order."
},
"orderItems": {
"type": "array",
"description": "A list of items included in the confirmed order, each containing product details and quantities.",
"items": {
"type": "object",
"properties": {
"productId": {
"type": "string",
"format": "uuid",
"description": "The unique identifier of the product."
},
"productName": {
"type": "string",
"description": "The name of the product."
},
"quantity": {
"type": "integer",
"description": "The quantity of the product ordered."
},
"unitPrice": {
"type": "number",
"format": "float",
"description": "The price per unit of the product."
},
"totalPrice": {
"type": "number",
"format": "float",
"description": "The total price for this order item (quantity * unitPrice)."
}
},
"required": ["productId", "productName", "quantity", "unitPrice", "totalPrice"]
}
},
"orderStatus": {
"type": "string",
"description": "The current status of the order after confirmation."
},
"totalAmount": {
"type": "number",
"format": "float",
"description": "The total amount of the confirmed order."
},
"confirmationTimestamp": {
"type": "string",
"format": "date-time",
"description": "The date and time when the order was confirmed."
}
},
"required": ["orderId", "userId", "orderItems", "orderStatus", "totalAmount", "confirmationTimestamp"],
"additionalProperties": false
}
---
id: OutOfStock
name: Inventory out of stock
version: 0.0.1
schemaPath: schema.json
summary: |
Indicates inventory is out of stock
owners:
- dboyne
- msmith
- asmith
- full-stack
- mobile-devs
badges:
- content: Recently updated!
backgroundColor: green
textColor: green
- content: Channel:Apache Kafka
backgroundColor: yellow
textColor: yellow
---
## Overview
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.
### Payload
The payload of the `Inventory Adjusted` event includes the following fields:
```json title="Example of payload" frame="terminal"
{
"event_id": "string",
"timestamp": "ISO 8601 date-time",
"product_id": "string",
"adjusted_quantity": "integer",
"new_quantity": "integer",
"adjustment_reason": "string",
"adjusted_by": "string"
}
```
### Producing the Event
To produce an Inventory Adjusted event, use the following example Kafka producer configuration in Python:
```python title="Produce event in Python" frame="terminal"
from kafka import KafkaProducer
import json
from datetime import datetime
# Kafka configuration
producer = KafkaProducer(
bootstrap_servers=['localhost:9092'],
value_serializer=lambda v: json.dumps(v).encode('utf-8')
)
# Event data
event_data = {
"event_id": "abc123",
"timestamp": datetime.utcnow().isoformat() + 'Z',
"product_id": "prod987",
"adjusted_quantity": 10,
"new_quantity": 150,
"adjustment_reason": "restock",
"adjusted_by": "user123"
}
# Send event to Kafka topic
producer.send('inventory.adjusted', event_data)
producer.flush()
```
### Consuming the Event
To consume an Inventory Adjusted event, use the following example Kafka consumer configuration in Python:
```python title="Consuming the event with python" frame="terminal"
from kafka import KafkaConsumer
import json
# Kafka configuration
consumer = KafkaConsumer(
'inventory.adjusted',
bootstrap_servers=['localhost:9092'],
auto_offset_reset='earliest',
enable_auto_commit=True,
group_id='inventory_group',
value_serializer=lambda v: json.dumps(v).encode('utf-8')
)
# Consume events
for message in consumer:
event_data = json.loads(message.value)
print(f"Received Inventory Adjusted event: {event_data}")
```
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"event_id": {
"type": "string",
"description": "Unique identifier for the event"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "Timestamp when the out-of-stock condition was detected"
},
"product_id": {
"type": "string",
"description": "Identifier of the out-of-stock product"
},
"last_available_quantity": {
"type": "integer",
"description": "The last known available quantity before stock ran out"
},
"warehouse_id": {
"type": "string",
"description": "Identifier of the warehouse reporting the stock-out"
}
},
"required": ["event_id", "timestamp", "product_id"]
}
---
id: OutOfStock
name: Inventory out of stock
version: 0.0.4
schemaPath: schema.json
summary: |
Indicates inventory is out of stock
owners:
- dboyne
- msmith
- asmith
- full-stack
- mobile-devs
badges:
- content: Recently updated!
backgroundColor: green
textColor: green
- content: 'Channel:Apache Kafka'
backgroundColor: yellow
textColor: yellow
---
import Footer from '@catalog/components/footer.astro';
## Overview
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.
### Payload
The payload of the `Inventory Adjusted` event includes the following fields:
```json title="Example of payload" frame="terminal"
{
"event_id": "string",
"timestamp": "ISO 8601 date-time",
"product_id": "string",
"adjusted_quantity": "integer",
"new_quantity": "integer",
"adjustment_reason": "string",
"adjusted_by": "string"
}
```
### Producing the Event
To produce an Inventory Adjusted event, use the following example Kafka producer configuration in Python:
```python title="Produce event in Python" frame="terminal"
from kafka import KafkaProducer
import json
from datetime import datetime
# Kafka configuration
producer = KafkaProducer(
bootstrap_servers=['localhost:9092'],
value_serializer=lambda v: json.dumps(v).encode('utf-8')
)
# Event data
event_data = {
"event_id": "abc123",
"timestamp": datetime.utcnow().isoformat() + 'Z',
"product_id": "prod987",
"adjusted_quantity": 10,
"new_quantity": 150,
"adjustment_reason": "restock",
"adjusted_by": "user123"
}
# Send event to Kafka topic
producer.send('inventory.adjusted', event_data)
producer.flush()
```
### Consuming the Event
To consume an Inventory Adjusted event, use the following example Kafka consumer configuration in Python:
```python title="Consuming the event with python" frame="terminal"
from kafka import KafkaConsumer
import json
# Kafka configuration
consumer = KafkaConsumer(
'inventory.adjusted',
bootstrap_servers=['localhost:9092'],
auto_offset_reset='earliest',
enable_auto_commit=True,
group_id='inventory_group',
value_serializer=lambda v: json.dumps(v).encode('utf-8')
)
# Consume events
for message in consumer:
event_data = json.loads(message.value)
print(f"Received Inventory Adjusted event: {event_data}")
```
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"event_id": {
"type": "string",
"description": "Unique identifier for the event"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "Timestamp when the out-of-stock condition was detected"
},
"product_id": {
"type": "string",
"description": "Identifier of the out-of-stock product"
},
"last_available_quantity": {
"type": "integer",
"description": "The last known available quantity before stock ran out"
},
"warehouse_id": {
"type": "string",
"description": "Identifier of the warehouse reporting the stock-out"
}
},
"required": ["event_id", "timestamp", "product_id"]
}
---
id: PagamentoRecebido
name: Pagamento recebido
version: 1.0.0
owners:
- full-stack
summary: "Evento publicado pelo domínio Financeiro: um pagamento é recebido."
---
## Visão geral
O evento **Pagamento recebido** representa o fato de que um pagamento é recebido.
---
id: PaymentFailed
version: 0.0.1
name: Payment Failed
summary: Emitted when a payment attempt fails
owners:
- dboyne
badges:
- content: Error Event
backgroundColor: red
textColor: white
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `PaymentFailed` event is emitted when a payment attempt fails for any reason. This event is consumed by various services to handle payment failures appropriately.
## Consumers
This event is consumed by:
- **BillingService** (Subscriptions Domain) - To handle subscription payment failures
- **OrdersService** (Orders Domain) - To handle order payment failures
- **NotificationService** (Orders Domain) - To notify customers of payment failures
## Failure Reasons
Common failure reasons include:
- **insufficient_funds** - Card has insufficient funds
- **card_declined** - Card was declined by issuer
- **expired_card** - Card has expired
- **fraud_suspected** - Payment flagged as potentially fraudulent
- **network_error** - Payment gateway network error
- **invalid_payment_method** - Payment method is invalid
## Schema
## Example Payload
```json
{
"paymentId": "pay_123456",
"amount": 49.99,
"currency": "USD",
"failureReason": "insufficient_funds",
"failureMessage": "Your card has insufficient funds",
"metadata": {
"subscriptionId": "sub_ABC123",
"invoiceId": "inv_123456",
"customerId": "cust_XYZ789"
},
"canRetry": true,
"nextRetryAt": "2024-02-02T00:00:00Z",
"timestamp": "2024-02-01T10:30:00Z"
}
```
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"paymentId": {
"type": "string",
"description": "Unique identifier for the failed payment"
},
"amount": {
"type": "number",
"description": "Payment amount that failed"
},
"currency": {
"type": "string",
"description": "Currency code (ISO 4217)"
},
"failureReason": {
"type": "string",
"enum": [
"insufficient_funds",
"card_declined",
"expired_card",
"fraud_suspected",
"network_error",
"invalid_payment_method",
"authentication_required",
"other"
],
"description": "Reason for payment failure"
},
"failureMessage": {
"type": "string",
"description": "Human-readable failure message"
},
"metadata": {
"type": "object",
"properties": {
"subscriptionId": {
"type": "string"
},
"invoiceId": {
"type": "string"
},
"customerId": {
"type": "string"
},
"orderId": {
"type": "string"
}
}
},
"canRetry": {
"type": "boolean",
"description": "Whether this payment can be retried"
},
"nextRetryAt": {
"type": "string",
"format": "date-time",
"description": "Suggested time for next retry attempt"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "When the failure occurred"
}
},
"required": ["paymentId", "amount", "currency", "failureReason", "timestamp"]
}
---
id: PaymentInitiated
name: Payment Initiated
version: 0.0.1
schemaPath: schema.json
summary: Event is triggered when a user initiates a payment through the Payment Service
owners:
- dboyne
---
import Footer from '@catalog/components/footer.astro';
## Overview
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.
### Payload Example
```json title="Payload example"
{
"userId": "123e4567-e89b-12d3-a456-426614174000",
"orderId": "789e1234-b56c-78d9-e012-3456789fghij",
"amount": 100.5,
"paymentMethod": "CreditCard",
"timestamp": "2024-07-04T14:48:00Z"
}
```
### Security Considerations
- **Authentication**: Ensure that only authenticated users can initiate a payment, and the userId in the payload matches the authenticated user.
- **Data Validation**: Validate all input data to prevent injection attacks or other malicious input.
- **Sensitive Data Handling**: Avoid including sensitive information (e.g., credit card numbers) in the event payload. Use secure channels and encryption for such data.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"userId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier of the user initiating the payment"
},
"orderId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier of the associated order"
},
"amount": {
"type": "number",
"description": "Payment amount"
},
"paymentMethod": {
"type": "string",
"enum": ["CreditCard", "DebitCard", "BankTransfer", "PayPal"],
"description": "The payment method used"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "When the payment was initiated"
}
},
"required": ["userId", "orderId", "amount", "paymentMethod", "timestamp"]
}
---
id: PaymentProcessed
name: Payment Processed
version: 0.0.1
schemaPath: schema.json
summary: Event is triggered after the payment has been successfully processed
owners:
- dboyne
---
import Footer from '@catalog/components/footer.astro';
## Overview
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.
### Payload Example
```json title="Payload example"
{
"transactionId": "123e4567-e89b-12d3-a456-426614174000",
"userId": "123e4567-e89b-12d3-a456-426614174000",
"orderId": "789e1234-b56c-78d9-e012-3456789fghij",
"amount": 100.5,
"paymentMethod": "CreditCard",
"status": "confirmed",
"confirmationDetails": {
"gatewayResponse": "Approved",
"transactionId": "abc123"
},
"timestamp": "2024-07-04T14:48:00Z"
}
```
### Security Considerations
- **Data Validation**: Ensure that all data in the event payload is validated before publishing to prevent injection attacks or other malicious activities.
- **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.
- **Authentication and Authorization**: Ensure that only authorized services can publish or consume PaymentProcessed events.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"transactionId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier for the transaction"
},
"userId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier of the user"
},
"orderId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier of the associated order"
},
"amount": {
"type": "number",
"description": "Payment amount processed"
},
"paymentMethod": {
"type": "string",
"enum": ["CreditCard", "DebitCard", "BankTransfer", "PayPal"],
"description": "The payment method used"
},
"status": {
"type": "string",
"enum": ["confirmed", "pending", "failed"],
"description": "Status of the payment"
},
"confirmationDetails": {
"type": "object",
"properties": {
"gatewayResponse": {
"type": "string",
"description": "Response from the payment gateway"
},
"transactionId": {
"type": "string",
"description": "Gateway transaction identifier"
}
}
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "When the payment was processed"
}
},
"required": ["transactionId", "userId", "orderId", "amount", "status", "timestamp"]
}
---
id: PaymentProcessed
name: Payment Processed
version: 1.0.0
schemaPath: schema.json
summary: Event is triggered after the payment has been successfully processed
owners:
- dboyne
---
import Footer from '@catalog/components/footer.astro';
## Overview
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.
### Payload Example
```json title="Payload example"
{
"transactionId": "123e4567-e89b-12d3-a456-426614174000",
"userId": "123e4567-e89b-12d3-a456-426614174000",
"orderId": "789e1234-b56c-78d9-e012-3456789fghij",
"amount": 100.5,
"paymentMethod": "CreditCard",
"status": "confirmed",
"confirmationDetails": {
"gatewayResponse": "Approved",
"transactionId": "abc123"
},
"timestamp": "2024-07-04T14:48:00Z"
}
```
### Security Considerations
- **Data Validation**: Ensure that all data in the event payload is validated before publishing to prevent injection attacks or other malicious activities.
- **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.
- **Authentication and Authorization**: Ensure that only authorized services can publish or consume PaymentProcessed events.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"transactionId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier for the transaction"
},
"userId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier of the user"
},
"orderId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier of the associated order"
},
"amount": {
"type": "number",
"description": "Payment amount processed"
},
"paymentMethod": {
"type": "string",
"enum": ["CreditCard", "DebitCard", "BankTransfer", "PayPal"],
"description": "The payment method used"
},
"status": {
"type": "string",
"enum": ["confirmed", "pending", "failed"],
"description": "Status of the payment"
},
"confirmationDetails": {
"type": "object",
"properties": {
"gatewayResponse": {
"type": "string",
"description": "Response from the payment gateway"
},
"transactionId": {
"type": "string",
"description": "Gateway transaction identifier"
}
}
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "When the payment was processed"
}
},
"required": ["transactionId", "userId", "orderId", "amount", "status", "timestamp"]
}
---
id: PedidoCancelado
name: Pedido cancelado
version: 1.0.0
owners:
- full-stack
summary: "Evento publicado pelo domínio Comercial: um pedido é cancelado."
---
## Visão geral
O evento **Pedido cancelado** representa o fato de que um pedido é cancelado.
---
id: PedidoCriado
name: Pedido criado
version: 1.0.0
owners:
- full-stack
summary: "Evento publicado pelo domínio Comercial: um novo pedido é criado."
---
## Visão geral
O evento **Pedido criado** representa o fato de que um novo pedido é criado.
---
id: PedidoEditado
name: Pedido editado
version: 1.0.0
owners:
- full-stack
summary: "Evento publicado pelo domínio Comercial: os dados de um pedido são alterados."
---
## Visão geral
O evento **Pedido editado** representa o fato de que os dados de um pedido são alterados.
---
id: PlanilhamentoAtualizado
name: Planilhamento atualizado
version: 1.0.0
owners:
- full-stack
summary: "Evento publicado pelo domínio Planilhamento: um planilhamento é atualizado."
---
## Visão geral
O evento **Planilhamento atualizado** representa o fato de que um planilhamento é atualizado.
---
id: PlanilhamentoCriado
name: Planilhamento criado
version: 1.0.0
owners:
- full-stack
summary: "Evento publicado pelo domínio Planilhamento: um novo planilhamento é criado."
---
## Visão geral
O evento **Planilhamento criado** representa o fato de que um novo planilhamento é criado.
---
id: PlanilhamentoFinalizado
name: Planilhamento finalizado
version: 1.0.0
owners:
- full-stack
summary: "Evento publicado pelo domínio Planilhamento: um planilhamento é finalizado."
---
## Visão geral
O evento **Planilhamento finalizado** representa o fato de que um planilhamento é finalizado.
---
id: ProducaoAtualizada
name: Produção atualizada
version: 1.0.0
owners:
- full-stack
summary: "Evento publicado pelo domínio Producao: uma produção é atualizada."
---
## Visão geral
O evento **Produção atualizada** representa o fato de que uma produção é atualizada.
---
id: ProducaoFinalizada
name: Produção finalizada
version: 1.0.0
owners:
- full-stack
summary: "Evento publicado pelo domínio Producao: uma produção é finalizada."
---
## Visão geral
O evento **Produção finalizada** representa o fato de que uma produção é finalizada.
---
id: ProgramacaoEditada
name: Programação editada
version: 1.0.0
owners:
- full-stack
summary: "Evento publicado pelo domínio Programacao: os dados de uma programação são alterados."
---
## Visão geral
O evento **Programação editada** representa o fato de que os dados de uma programação são alterados.
---
id: ReturnInitiated
name: Return initiated
version: 0.0.1
summary: |
Event that is emitted when a return is initiated.
owners:
- dboyne
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `ReturnInitiated` event is emitted when a return is initiated. It provides information such as the shipment status (e.g., pending, completed, shipped), the items within the shipment, 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.
This event can be applied in e-commerce systems, marketplaces, or any platform where users and systems need real-time return data for tracking, auditing, or managing customer purchases.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"title": "ReturnInitiated",
"description": "Schema for return initiated event",
"properties": {
"shipmentId": {
"type": "string",
"description": "Unique identifier for the shipment"
},
"orderId": {
"type": "string",
"description": "Identifier for the associated order"
}
},
"required": ["shipmentId", "orderId"]
}
---
id: RomaneioCriado
name: Romaneio criado
version: 1.0.0
owners:
- full-stack
summary: "Evento publicado pelo domínio EtiquetaERomaneio: um novo romaneio é criado."
---
## Visão geral
O evento **Romaneio criado** representa o fato de que um novo romaneio é criado.
---
id: RomaneioEditado
name: Romaneio editado
version: 1.0.0
owners:
- full-stack
summary: "Evento publicado pelo domínio EtiquetaERomaneio: os dados de um romaneio são alterados."
---
## Visão geral
O evento **Romaneio editado** representa o fato de que os dados de um romaneio são alterados.
---
id: ShipmentCreated
name: Shipment created
version: 0.0.1
summary: |
Event that is emitted when a shipment is created.
owners:
- dboyne
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `ShipmentCreated` event is emitted when a shipment is created. It provides information such as the shipment status (e.g., pending, completed, shipped), the items within the shipment, 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.
This event can be applied in e-commerce systems, marketplaces, or any platform where users and systems need real-time shipment data for tracking, auditing, or managing customer purchases.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"title": "ShipmentCreated",
"description": "Schema for shipment created event",
"properties": {
"shipmentId": {
"type": "string",
"description": "Unique identifier for the shipment"
},
"orderId": {
"type": "string",
"description": "Identifier for the associated order"
},
"address": {
"type": "object",
"properties": {
"street": {
"type": "string",
"description": "Street address for the shipment"
},
"city": {
"type": "string",
"description": "City for the shipment"
},
"state": {
"type": "string",
"description": "State for the shipment"
},
"postalCode": {
"type": "string",
"description": "Postal code for the shipment"
},
"country": {
"type": "string",
"description": "Country for the shipment"
}
},
"required": ["street", "city", "state", "postalCode", "country"]
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"itemId": {
"type": "string",
"description": "Identifier for the item"
},
"quantity": {
"type": "integer",
"description": "Quantity of the item"
}
},
"required": ["itemId", "quantity"]
}
},
"shippingMethod": {
"type": "string",
"description": "Method of shipping (e.g., standard, express)"
}
},
"required": ["shipmentId", "orderId", "address", "items", "shippingMethod"]
}
---
id: ShipmentDelivered
name: Shipment delivered
version: 0.0.1
summary: |
Event that is emitted when a shipment is delivered.
owners:
- dboyne
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `ShipmentDelivered` event is emitted when a shipment is delivered. It provides information such as the shipment status (e.g., pending, completed, shipped), the items within the shipment, 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.
This event can be applied in e-commerce systems, marketplaces, or any platform where users and systems need real-time shipment data for tracking, auditing, or managing customer purchases.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"title": "ShipmentDelivered",
"description": "Schema for shipment delivered event",
"properties": {
"shipmentId": {
"type": "string",
"description": "Unique identifier for the shipment"
},
"orderId": {
"type": "string",
"description": "Identifier for the associated order"
}
},
"required": ["shipmentId", "orderId"]
}
---
id: ShipmentDispatched
name: Shipment dispatched
version: 0.0.1
summary: |
Event that is emitted when a shipment is dispatched.
owners:
- dboyne
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `ShipmentDispatched` event is emitted when a shipment is dispatched. It provides information such as the shipment status (e.g., pending, completed, shipped), the items within the shipment, 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.
This event can be applied in e-commerce systems, marketplaces, or any platform where users and systems need real-time shipment data for tracking, auditing, or managing customer purchases.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"title": "ShipmentDispatched",
"description": "Schema for shipment dispatched event",
"properties": {
"shipmentId": {
"type": "string",
"description": "Unique identifier for the shipment"
},
"orderId": {
"type": "string",
"description": "Identifier for the associated order"
}
},
"required": ["shipmentId", "orderId"]
}
---
id: ShipmentInTransit
name: Shipment in transit
version: 0.0.1
summary: |
Event that is emitted when a shipment is in transit.
owners:
- dboyne
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `ShipmentInTransit` event is emitted when a shipment is in transit. It provides information such as the shipment status (e.g., pending, completed, shipped), the items within the shipment, 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.
This event can be applied in e-commerce systems, marketplaces, or any platform where users and systems need real-time shipment data for tracking, auditing, or managing customer purchases.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"title": "ShipmentInTransit",
"description": "Schema for shipment in transit event",
"properties": {
"shipmentId": {
"type": "string",
"description": "Unique identifier for the shipment"
},
"orderId": {
"type": "string",
"description": "Identifier for the associated order"
}
},
"required": ["shipmentId", "orderId"]
}
---
id: SubscriptionPaymentDue
version: 0.0.1
name: Subscription Payment Due
summary: Emitted when a subscription payment is due for collection
owners:
- dboyne
tags:
- billing
- payment
- cross-domain
badges:
- content: Cross-Domain
backgroundColor: purple
textColor: white
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `SubscriptionPaymentDue` event is emitted by the Billing Service when a subscription's billing cycle is due for payment. This event triggers the payment collection process in the Payment domain.
## Cross-Domain Communication
This event facilitates communication between:
- **Source**: Subscriptions Domain (BillingService)
- **Target**: Payment Domain (PaymentService, FraudDetectionService)
## Schema
## Event Flow
1. BillingService calculates when payment is due
2. Emits `SubscriptionPaymentDue` event
3. PaymentService receives and initiates payment
4. FraudDetectionService performs risk assessment
5. Payment is processed through PaymentGatewayService
## Example Payload
```json
{
"subscriptionId": "sub_ABC123",
"customerId": "cust_XYZ789",
"invoiceId": "inv_123456",
"amount": 49.99,
"currency": "USD",
"dueDate": "2024-02-01T00:00:00Z",
"billingPeriod": {
"start": "2024-02-01",
"end": "2024-02-29"
},
"planId": "pro-monthly",
"retryAttempt": 0
}
```
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"subscriptionId": {
"type": "string",
"description": "Unique identifier for the subscription"
},
"customerId": {
"type": "string",
"description": "Unique identifier for the customer"
},
"invoiceId": {
"type": "string",
"description": "Unique identifier for the invoice"
},
"amount": {
"type": "number",
"description": "Amount due for payment"
},
"currency": {
"type": "string",
"description": "Currency code (ISO 4217)"
},
"dueDate": {
"type": "string",
"format": "date-time",
"description": "When the payment is due"
},
"billingPeriod": {
"type": "object",
"properties": {
"start": {
"type": "string",
"format": "date"
},
"end": {
"type": "string",
"format": "date"
}
},
"required": ["start", "end"]
},
"planId": {
"type": "string",
"description": "Subscription plan identifier"
},
"retryAttempt": {
"type": "integer",
"description": "Number of retry attempts for failed payments"
}
},
"required": ["subscriptionId", "customerId", "invoiceId", "amount", "currency", "dueDate"]
}
---
id: UserSubscriptionCancelled
name: User subscription cancelled
version: 0.0.1
schemaPath: schema.json
summary: |
An event that is triggered when a users subscription has been cancelled
owners:
- dboyne
badges:
- content: New!
backgroundColor: green
textColor: green
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `UserSubscriptionCancelled` event is triggered when a users subscription has been cancelled.
## Architecture diagram
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"subscriptionId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier of the cancelled subscription"
},
"userId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier of the user"
},
"planId": {
"type": "string",
"description": "Identifier of the subscription plan"
},
"cancellationReason": {
"type": "string",
"description": "Reason for the cancellation"
},
"effectiveDate": {
"type": "string",
"format": "date-time",
"description": "When the cancellation takes effect"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "When the cancellation event occurred"
}
},
"required": ["subscriptionId", "userId", "timestamp"]
}
---
id: UserSubscriptionStarted
name: User subscription started
version: 0.0.1
schemaPath: schema.json
summary: |
An event that is triggered when a new user subscription has started
owners:
- dboyne
badges:
- content: New!
backgroundColor: green
textColor: green
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `UserSubscriptionStarted` event is triggered when a user starts a new subscription with our service.
## Architecture diagram
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"subscriptionId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier of the new subscription"
},
"userId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier of the subscribed user"
},
"planId": {
"type": "string",
"description": "Identifier of the subscription plan"
},
"startDate": {
"type": "string",
"format": "date-time",
"description": "When the subscription started"
},
"billingCycle": {
"type": "string",
"enum": ["monthly", "quarterly", "yearly"],
"description": "The billing cycle for the subscription"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "When the subscription started event occurred"
}
},
"required": ["subscriptionId", "userId", "planId", "startDate", "timestamp"]
}
---
id: AddInventory
name: Add inventory
version: 0.0.3
summary: |
Command that will add item to a given inventory id
owners:
- dboyne
- msmith
- asmith
- full-stack
- mobile-devs
badges:
- content: Recently updated!
backgroundColor: green
textColor: green
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The AddInventory command is issued to add new stock to the inventory. This command is used by the inventory management system to update the quantity of products available in the warehouse or store.
## Architecture diagram
## Payload example
```json title="Payload example"
{
"productId": "789e1234-b56c-78d9-e012-3456789fghij",
"quantity": 50,
"warehouseId": "456e7891-c23d-45f6-b78a-123456789abc",
"timestamp": "2024-07-04T14:48:00Z"
}
```
## Schema
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "AddInventoryCommand",
"type": "object",
"properties": {
"productId": {
"type": "string",
"format": "uuid",
"description": "The unique identifier of the product being added to the inventory."
},
"quantity": {
"type": "integer",
"description": "The quantity of the product being added to the inventory."
},
"warehouseId": {
"type": "string",
"format": "uuid",
"description": "The unique identifier of the warehouse where the inventory is being added."
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "The date and time when the inventory was added."
}
},
"required": ["productId", "quantity", "warehouseId", "timestamp"],
"additionalProperties": false
}
---
id: CancelShipment
name: Cancel shipment
version: 0.0.1
summary: |
POST request that will cancel a shipment, identified by its shipmentId.
owners:
- dboyne
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `CancelShipment` message is a command used to cancel a shipment, identified by its `shipmentId`. It provides information such as the shipment status (e.g., pending, completed, shipped), the items within the shipment, 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.
This command can be applied in e-commerce systems, marketplaces, or any platform where users and systems need real-time shipment data for tracking, auditing, or managing customer purchases.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"title": "CancelShipment",
"description": "Schema for cancelling a shipment",
"properties": {
"shipmentId": {
"type": "string",
"description": "Unique identifier for the shipment"
}
},
"required": ["shipmentId"]
}
---
id: CancelSubscription
name: Cancel subscription
version: 0.0.1
schemaPath: schema.json
summary: |
Command that will try and cancel a users subscription
owners:
- dboyne
badges:
- content: New!
backgroundColor: green
textColor: green
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `CancelSubscription` command will try and cancel a subscription for the user.
## Architecture diagram
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"subscriptionId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier of the subscription to cancel"
},
"userId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier of the user requesting cancellation"
},
"reason": {
"type": "string",
"description": "Reason for cancellation"
},
"cancelImmediately": {
"type": "boolean",
"description": "Whether to cancel immediately or at end of billing period"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "When the cancellation was requested"
}
},
"required": ["subscriptionId", "userId", "timestamp"]
}
---
id: CreateReturnLabel
name: Create return label
version: 0.0.1
summary: |
POST request that will create a return label for a specific shipment, identified by its shipmentId.
owners:
- dboyne
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `CreateReturnLabel` message is a command used to create a return label for a specific shipment, identified by its `shipmentId`. It provides information such as the shipment status (e.g., pending, completed, shipped), the items within the shipment, 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.
This command can be applied in e-commerce systems, marketplaces, or any platform where users and systems need real-time shipment data for tracking, auditing, or managing customer purchases.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"title": "CreateReturnLabel",
"description": "Schema for creating a return shipping label",
"properties": {
"CreateReturnLabel": {
"type": "object",
"properties": {
"shipmentId": {
"type": "string",
"description": "Unique identifier for the shipment"
}
},
"required": ["shipmentId"]
}
},
"required": ["CreateReturnLabel"]
}
---
id: CreateShipment
name: Create shipment
version: 0.0.1
summary: |
POST request that will create a shipment for a specific order, identified by its orderId.
owners:
- dboyne
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `CreateShipment` message is a command used to create a shipment for 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.
This command 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.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"shipmentId": {
"type": "string",
"description": "Unique identifier for the shipment"
},
"orderId": {
"type": "string",
"description": "Identifier for the associated order"
},
"address": {
"type": "object",
"properties": {
"street": {
"type": "string",
"description": "Street address for the shipment"
},
"city": {
"type": "string",
"description": "City for the shipment"
},
"state": {
"type": "string",
"description": "State for the shipment"
},
"postalCode": {
"type": "string",
"description": "Postal code for the shipment"
},
"country": {
"type": "string",
"description": "Country for the shipment"
}
},
"required": ["street", "city", "state", "postalCode", "country"]
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"itemId": {
"type": "string",
"description": "Identifier for the item"
},
"quantity": {
"type": "integer",
"description": "Quantity of the item"
}
},
"required": ["itemId", "quantity"]
}
},
"shippingMethod": {
"type": "string",
"description": "Method of shipping (e.g., standard, express)"
}
},
"required": ["shipmentId", "orderId", "address", "items", "shippingMethod"]
}
---
id: PlaceOrder
name: Place Order
version: 0.0.1
summary: |
Command that will place an order
owners:
- dboyne
- msmith
- asmith
- full-stack
- mobile-devs
badges:
- content: Recently updated!
backgroundColor: green
textColor: green
schemaPath: 'schema.json'
---
import Footer from '@catalog/components/footer.astro';
## Overview
The Order Placement Command is a versatile and robust system designed to streamline the process of placing an order. This command takes care of all the essential details needed to complete a purchase, ensuring a smooth and efficient transaction from start to finish.
## Architecture diagram
## Schema
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Order",
"description": "A schema representing an order placed by a customer",
"type": "object",
"properties": {
"orderId": {
"description": "Unique identifier for the order",
"type": "string"
},
"customer": {
"description": "Information about the customer placing the order",
"type": "object",
"properties": {
"customerId": {
"description": "Unique identifier for the customer",
"type": "string"
},
"name": {
"description": "Name of the customer",
"type": "string"
},
"email": {
"description": "Email address of the customer",
"type": "string",
"format": "email"
},
"phone": {
"description": "Phone number of the customer",
"type": "string",
"pattern": "^[+]?[0-9]{10,15}$"
}
},
"required": ["customerId", "name", "email"]
},
"items": {
"description": "List of items in the order",
"type": "array",
"items": {
"type": "object",
"properties": {
"itemId": {
"description": "Unique identifier for the item",
"type": "string"
},
"name": {
"description": "Name of the item",
"type": "string"
},
"quantity": {
"description": "Quantity of the item ordered",
"type": "integer",
"minimum": 1
},
"price": {
"description": "Price per unit of the item",
"type": "number",
"minimum": 0
}
},
"required": ["itemId", "name", "quantity", "price"]
}
},
"shippingAddress": {
"description": "Address where the order will be shipped",
"type": "object",
"properties": {
"street": {
"description": "Street address",
"type": "string"
},
"city": {
"description": "City",
"type": "string"
},
"state": {
"description": "State or province",
"type": "string"
},
"zip": {
"description": "ZIP or postal code",
"type": "string"
},
"country": {
"description": "Country",
"type": "string"
}
},
"required": ["street", "city", "state", "zip", "country"]
},
"payment": {
"description": "Payment information for the order",
"type": "object",
"properties": {
"paymentMethod": {
"description": "Payment method used",
"type": "string",
"enum": ["Credit Card", "PayPal", "Bank Transfer"]
},
"transactionId": {
"description": "Transaction ID for the payment",
"type": "string"
},
"amount": {
"description": "Total amount paid",
"type": "number",
"minimum": 0
}
},
"required": ["paymentMethod", "transactionId", "amount"]
},
"orderDate": {
"description": "Date when the order was placed",
"type": "string",
"format": "date-time"
},
"status": {
"description": "Current status of the order",
"type": "string",
"enum": ["Pending", "Processing", "Shipped", "Delivered", "Cancelled"]
}
},
"required": ["orderId", "customer", "items", "shippingAddress", "payment", "orderDate", "status"]
}
---
id: ProcessPayment
version: 0.0.1
name: Process Payment
summary: Command to process a payment through the payment gateway
owners:
- dboyne
tags:
- payment
- command
- cross-domain
badges:
- content: Command
backgroundColor: blue
textColor: white
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `ProcessPayment` command is used to initiate payment processing through the payment gateway. This command can be triggered by various sources including the Billing Service for subscription payments.
## Command Sources
This command can be triggered by:
- **BillingService** (Subscriptions Domain) - For recurring subscription payments
- **OrdersService** (Orders Domain) - For one-time order payments
- **PaymentService** (Payment Domain) - For payment retries
## Command Flow
```mermaid
sequenceDiagram
participant BS as BillingService
participant PGS as PaymentGatewayService
participant FDS as FraudDetectionService
participant EXT as External Gateway
BS->>PGS: ProcessPayment
PGS->>FDS: Check Fraud
FDS-->>PGS: Risk Assessment
PGS->>EXT: Process Payment
EXT-->>PGS: Payment Result
PGS-->>BS: PaymentProcessed/Failed
```
## Schema
## Example Request
```json
{
"paymentId": "pay_123456",
"amount": 49.99,
"currency": "USD",
"paymentMethod": {
"type": "card",
"token": "tok_visa_4242"
},
"metadata": {
"subscriptionId": "sub_ABC123",
"invoiceId": "inv_123456",
"customerId": "cust_XYZ789"
},
"idempotencyKey": "sub_ABC123_2024_02",
"captureImmediately": true
}
```
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"paymentId": {
"type": "string",
"description": "Unique identifier for this payment"
},
"amount": {
"type": "number",
"description": "Payment amount"
},
"currency": {
"type": "string",
"description": "Currency code (ISO 4217)"
},
"paymentMethod": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["card", "bank_transfer", "paypal", "digital_wallet"]
},
"token": {
"type": "string",
"description": "Payment method token"
}
},
"required": ["type", "token"]
},
"metadata": {
"type": "object",
"properties": {
"subscriptionId": {
"type": "string"
},
"invoiceId": {
"type": "string"
},
"customerId": {
"type": "string"
},
"orderId": {
"type": "string"
}
}
},
"idempotencyKey": {
"type": "string",
"description": "Key to prevent duplicate payments"
},
"captureImmediately": {
"type": "boolean",
"description": "Whether to capture payment immediately or just authorize"
}
},
"required": ["paymentId", "amount", "currency", "paymentMethod", "idempotencyKey"]
}
---
id: SubscribeUser
name: Subscribe user
version: 0.0.1
schemaPath: schema.json
summary: |
Command that will try and subscribe a given user
owners:
- dboyne
badges:
- content: New!
backgroundColor: green
textColor: green
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `SubscribeUser` command represents when a new user wants to subscribe to our service.
## Architecture diagram
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"userId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier of the user to subscribe"
},
"planId": {
"type": "string",
"description": "Identifier of the subscription plan"
},
"paymentMethod": {
"type": "string",
"enum": ["CreditCard", "DebitCard", "BankTransfer", "PayPal"],
"description": "The payment method for the subscription"
},
"startDate": {
"type": "string",
"format": "date-time",
"description": "When the subscription should start"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "When the command was issued"
}
},
"required": ["userId", "planId", "paymentMethod", "timestamp"]
}
---
id: UpdateInventory
name: Update inventory
version: 0.0.3
summary: |
Command that will update a given inventory item
owners:
- dboyne
- msmith
- asmith
- full-stack
- mobile-devs
badges:
- content: Recently updated!
backgroundColor: green
textColor: green
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The UpdateInventory command is issued to update the existing stock levels of a product in the inventory. This command is used by the inventory management system to adjust the quantity of products available in the warehouse or store, either by increasing or decreasing the current stock levels.
## Architecture diagram
## Payload example
```json title="Payload example"
{
"productId": "789e1234-b56c-78d9-e012-3456789fghij",
"quantityChange": -10,
"warehouseId": "456e7891-c23d-45f6-b78a-123456789abc",
"timestamp": "2024-07-04T14:48:00Z"
}
```
## Schema (JSON schema)
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "UpdateInventoryCommand",
"type": "object",
"properties": {
"productId": {
"type": "string",
"format": "uuid",
"description": "The unique identifier of the product whose inventory is being updated."
},
"quantityChange": {
"type": "integer",
"description": "The change in quantity of the product in the inventory. Positive values indicate an increase, while negative values indicate a decrease."
},
"warehouseId": {
"type": "string",
"format": "uuid",
"description": "The unique identifier of the warehouse where the inventory is being updated."
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "The date and time when the inventory update occurred."
}
},
"required": ["productId", "quantityChange", "warehouseId", "timestamp"],
"additionalProperties": false
}
---
id: UpdateShipmentStatus
name: Update shipment status
version: 0.0.1
summary: |
POST request that will update the status of a shipment, identified by its shipmentId.
owners:
- dboyne
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `UpdateShipmentStatus` message is a command used to update the status of a shipment, identified by its `shipmentId`. It provides information such as the shipment status (e.g., pending, completed, shipped), the items within the shipment, 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.
This command can be applied in e-commerce systems, marketplaces, or any platform where users and systems need real-time shipment data for tracking, auditing, or managing customer purchases.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"title": "UpdateShipmentStatus",
"description": "Schema for updating a shipment's status",
"properties": {
"UpdateShipmentStatus": {
"type": "object",
"properties": {
"shipmentId": {
"type": "string",
"description": "Unique identifier for the shipment"
},
"status": {
"type": "string",
"enum": ["pending", "shipped", "delivered", "returned"],
"description": "Current status of the shipment"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"description": "Timestamp when the status was last updated"
}
},
"required": ["shipmentId", "status"]
}
},
"required": ["UpdateShipmentStatus"]
}
---
id: GetInventoryList
name: List inventory list
version: 0.0.1
summary: |
GET request that will return inventory list
owners:
- dboyne
badges:
- content: Recently updated!
backgroundColor: green
textColor: green
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
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.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "GetInventoryList",
"description": "A query to retrieve a list of all available inventory items with their details.",
"type": "object",
"properties": {
"filters": {
"type": "object",
"description": "Optional filters to narrow down the inventory search.",
"properties": {
"category": {
"type": "string",
"description": "Filter items by category (e.g., electronics, clothing, etc.)."
},
"location": {
"type": "string",
"description": "Filter items by storage location or warehouse."
},
"minStockLevel": {
"type": "integer",
"description": "Filter items with a stock level greater than or equal to this value."
},
"inStock": {
"type": "boolean",
"description": "Filter items that are currently in stock (true) or out of stock (false)."
}
},
"additionalProperties": false
},
"pagination": {
"type": "object",
"description": "Pagination options for the query.",
"properties": {
"page": {
"type": "integer",
"description": "The current page of results.",
"minimum": 1,
"default": 1
},
"pageSize": {
"type": "integer",
"description": "The number of items per page.",
"minimum": 1,
"default": 10
}
},
"required": ["page", "pageSize"]
}
},
"required": [],
"additionalProperties": false
}
---
id: GetInventoryStatus
name: Get inventory status
version: 0.0.1
summary: |
GET request that will return the current stock status for a specific product.
owners:
- dboyne
badges:
- content: GET Request
backgroundColor: green
textColor: green
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The GetInventoryStatus message is a query designed to retrieve the current stock status for a specific product.
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.
This query is essential for ensuring accurate stock levels are reported to downstream systems, including e-commerce platforms, warehouse management systems, and sales channels.
### Query using CURL
Use this snippet to query the inventory status
```sh title="Example CURL command"
curl -X GET "https://api.yourdomain.com/inventory/status" \
-H "Content-Type: application/json" \
-d '{
"productId": "12345"
}'
```
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "GetInventoryStatusResponse",
"type": "object",
"properties": {
"productId": {
"type": "string",
"description": "The unique identifier for the product"
},
"availableQuantity": {
"type": "integer",
"description": "The quantity of the product currently available in stock",
"minimum": 0
},
"reservedQuantity": {
"type": "integer",
"description": "The quantity of the product that is reserved for pending orders",
"minimum": 0
},
"warehouseLocation": {
"type": "string",
"description": "The location of the warehouse where the product is stored"
}
},
"required": ["productId", "availableQuantity", "reservedQuantity", "warehouseLocation"],
"additionalProperties": false
}
---
id: GetNotificationDetails
name: Get notification details
version: 0.0.1
summary: |
GET request that will return detailed information about a specific notification, identified by its notificationId.
owners:
- dboyne
badges:
- content: Recently updated!
backgroundColor: green
textColor: green
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
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.
Use cases include viewing detailed information about order updates, system notifications, or promotional messages, allowing users to view their full notification history and details.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "GetNotificationDetailsResponse",
"type": "object",
"properties": {
"notificationId": {
"type": "string",
"description": "The unique identifier for the notification."
},
"title": {
"type": "string",
"description": "The title or subject of the notification."
},
"message": {
"type": "string",
"description": "The content or message body of the notification."
},
"status": {
"type": "string",
"enum": ["unread", "read"],
"description": "The read status of the notification."
},
"userId": {
"type": "string",
"description": "The unique identifier for the user who received the notification."
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "The date and time when the notification was created."
},
"type": {
"type": "string",
"description": "The type of the notification, such as order or system."
},
"metadata": {
"type": "object",
"description": "Additional metadata related to the notification, such as order details.",
"properties": {
"orderId": {
"type": "string",
"description": "The associated order ID, if applicable."
},
"shippingProvider": {
"type": "string",
"description": "The shipping provider for the associated order, if applicable."
}
},
"required": ["orderId"],
"additionalProperties": false
}
},
"required": ["notificationId", "title", "message", "status", "userId", "createdAt", "type"],
"additionalProperties": false
}
---
id: GetOrder
name: Get order details
version: 0.0.1
summary: |
GET request that will return detailed information about a specific order, identified by its orderId.
owners:
- dboyne
badges:
- content: Recently updated!
backgroundColor: green
textColor: green
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
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.
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.
---
id: GetPaymentStatus
name: Get payment status
version: 0.0.1
summary: |
GET request that will return the payment status for a specific order, identified by its orderId.
owners:
- dboyne
badges:
- content: Recently updated!
backgroundColor: green
textColor: green
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
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.
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.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "GetPaymentStatusResponse",
"type": "object",
"properties": {
"orderId": {
"type": "string",
"description": "The unique identifier for the order."
},
"paymentStatus": {
"type": "string",
"enum": ["pending", "completed", "failed", "refunded"],
"description": "The current payment status of the order."
},
"amount": {
"type": "number",
"description": "The amount paid for the order."
},
"currency": {
"type": "string",
"description": "The currency in which the payment was made (e.g., USD, EUR)."
},
"paymentMethod": {
"type": "string",
"description": "The payment method used for the transaction (e.g., Credit Card, PayPal)."
},
"transactionId": {
"type": "string",
"description": "The unique identifier for the payment transaction."
},
"paymentDate": {
"type": "string",
"format": "date-time",
"description": "The date and time when the payment was processed."
}
},
"required": ["orderId", "paymentStatus", "amount", "currency", "paymentMethod", "transactionId", "paymentDate"],
"additionalProperties": false
}
---
id: GetSubscriptionStatus
name: Get subscription status
version: 0.0.1
summary: |
GET request that will return the current subscription status for a specific user, identified by their userId.
owners:
- dboyne
badges:
- content: Recently updated!
backgroundColor: green
textColor: green
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `GetSubscriptionStatus` message is a query used to retrieve the current subscription status for a specific user, identified by their `userId`. This query returns detailed information about the user's subscription, such as its current status (active, canceled, expired), the subscription tier or plan, and the next billing date. It is typically used by systems that manage user subscriptions, billing, and renewal processes to ensure that users are aware of their subscription details and any upcoming renewals.
This query is particularly useful in managing subscriptions for SaaS products, media services, or any recurring payment-based services where users need to manage and view their subscription information.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "GetSubscriptionStatusResponse",
"type": "object",
"properties": {
"userId": {
"type": "string",
"description": "The unique identifier for the user."
},
"subscriptionStatus": {
"type": "string",
"enum": ["active", "canceled", "expired", "pending"],
"description": "The current status of the user's subscription."
},
"subscriptionPlan": {
"type": "string",
"description": "The name or tier of the subscription plan."
},
"nextBillingDate": {
"type": "string",
"format": "date-time",
"description": "The date and time of the next billing or renewal."
},
"billingFrequency": {
"type": "string",
"enum": ["monthly", "yearly"],
"description": "The frequency of the billing cycle."
},
"amount": {
"type": "number",
"description": "The amount to be billed for the subscription."
},
"currency": {
"type": "string",
"description": "The currency in which the subscription is billed (e.g., USD, EUR)."
},
"lastPaymentDate": {
"type": "string",
"format": "date-time",
"description": "The date and time when the last payment was processed."
}
},
"required": [
"userId",
"subscriptionStatus",
"subscriptionPlan",
"nextBillingDate",
"billingFrequency",
"amount",
"currency",
"lastPaymentDate"
],
"additionalProperties": false
}
---
id: GetSubscriptionStatus
name: Get subscription status
version: 0.0.2
summary: |
GET request that will return the current subscription status for a specific user, identified by their userId.
owners:
- dboyne
badges:
- content: Recently updated!
backgroundColor: green
textColor: green
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
The `GetSubscriptionStatus` message is a query used to retrieve the current subscription status for a specific user, identified by their `userId`. This query returns detailed information about the user's subscription, such as its current status (active, canceled, expired), the subscription tier or plan, and the next billing date. It is typically used by systems that manage user subscriptions, billing, and renewal processes to ensure that users are aware of their subscription details and any upcoming renewals.
This query is particularly useful in managing subscriptions for SaaS products, media services, or any recurring payment-based services where users need to manage and view their subscription information.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "GetSubscriptionStatusResponse",
"type": "object",
"properties": {
"userId": {
"type": "string",
"description": "The unique identifier for the user."
},
"subscriptionStatus": {
"type": "string",
"enum": ["active", "canceled", "expired", "pending"],
"description": "The current status of the user's subscription."
},
"subscriptionPlan": {
"type": "string",
"description": "The name or tier of the subscription plan."
},
"nextBillingDate": {
"type": "string",
"format": "date-time",
"description": "The date and time of the next billing or renewal."
},
"billingFrequency": {
"type": "string",
"enum": ["monthly", "yearly"],
"description": "The frequency of the billing cycle."
},
"amount": {
"type": "number",
"description": "The amount to be billed for the subscription."
},
"currency": {
"type": "string",
"description": "The currency in which the subscription is billed (e.g., USD, EUR)."
},
"lastPaymentDate": {
"type": "string",
"format": "date-time",
"description": "The date and time when the last payment was processed."
}
},
"required": [
"userId",
"subscriptionStatus",
"subscriptionPlan",
"nextBillingDate",
"billingFrequency",
"amount",
"currency",
"lastPaymentDate"
],
"additionalProperties": false
}
---
id: GetUserNotifications
name: Get user notifications
version: 0.0.1
summary: |
GET request that will return a list of notifications for a specific user, with options to filter by status (unread or all).
owners:
- dboyne
badges:
- content: Recently updated!
backgroundColor: green
textColor: green
schemaPath: schema.json
---
import Footer from '@catalog/components/footer.astro';
## Overview
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.
Use cases include delivering notifications for order updates, promotional campaigns, or general system messages to keep the user informed.
## Raw Schema:schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "GetUserNotificationsResponse",
"type": "object",
"properties": {
"userId": {
"type": "string",
"description": "The unique identifier for the user."
},
"notifications": {
"type": "array",
"description": "A list of notifications for the user.",
"items": {
"type": "object",
"properties": {
"notificationId": {
"type": "string",
"description": "The unique identifier for the notification."
},
"title": {
"type": "string",
"description": "The title or subject of the notification."
},
"message": {
"type": "string",
"description": "The message body of the notification."
},
"status": {
"type": "string",
"enum": ["unread", "read"],
"description": "The read status of the notification."
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "The date and time when the notification was created."
}
},
"required": ["notificationId", "title", "message", "status", "createdAt"],
"additionalProperties": false
}
}
},
"required": ["userId", "notifications"],
"additionalProperties": false
}
---
id: AsaasApi
name: API Asaas
version: 1.0.0
summary: API externa utilizada pelo onboarding para criar subcontas.
owners:
- full-stack
externalSystem: true
---
## Visão geral
A API Asaas é um sistema externo consumido pelo BaaS para executar a criação de subcontas e retornar os dados da conta criada.
---
id: BillingService
version: 0.0.1
name: Billing Service
summary: >-
Manages billing cycles, invoice generation, and payment scheduling for
subscriptions
tags:
- billing
- subscriptions
- invoicing
repository:
url: 'https://github.com/eventcatalog/billing-service'
receives:
- id: PaymentProcessed
version: 0.0.1
from:
- id: 'payments.{env}.events'
parameters:
env: staging
sends:
- id: SubscriptionPaymentDue
version: 0.0.1
- id: ProcessPayment
version: 0.0.1
owners:
- dboyne
---
import Footer from '@catalog/components/footer.astro';
## Overview
The Billing Service is responsible for managing all billing-related operations for subscriptions. It calculates billing cycles, generates invoices, and coordinates with payment services to ensure timely payment collection.
## Key Features
- **Billing Cycle Management**: Handles daily, weekly, monthly, quarterly, and annual billing cycles
- **Invoice Generation**: Creates detailed invoices with line items and tax calculations
- **Payment Scheduling**: Schedules recurring payments based on billing cycles
- **Proration**: Calculates prorated charges for mid-cycle changes
- **Dunning Management**: Handles failed payment retry logic
## API Endpoints
### REST API
- `GET /api/billing/invoice/{subscriptionId}` - Get current invoice
- `GET /api/billing/history/{subscriptionId}` - Get billing history
- `POST /api/billing/preview` - Preview upcoming charges
- `PUT /api/billing/retry/{invoiceId}` - Retry failed payment
## Billing Cycle States
```mermaid
stateDiagram-v2
[*] --> Scheduled
Scheduled --> Processing
Processing --> Paid
Processing --> Failed
Failed --> Retrying
Retrying --> Paid
Retrying --> Suspended
Paid --> [*]
Suspended --> [*]
```
## Configuration
```yaml
billing_service:
cycles:
- daily
- weekly
- monthly
- quarterly
- annual
retry_attempts: 3
retry_interval_days: [1, 3, 7]
invoice_generation_lead_days: 7
```
---
id: FraudDetectionService
version: 0.0.1
name: Fraud Detection Service
summary: Analyzes payment transactions for fraudulent activity and risk assessment
repository:
url: 'https://github.com/eventcatalog/fraud-detection-service'
receives:
- id: PaymentInitiated
version: 0.0.1
from:
- id: 'payments.{env}.events'
parameters:
env: staging
- id: PaymentProcessed
version: 0.0.1
from:
- id: 'payments.{env}.events'
parameters:
env: staging
sends:
- id: FraudCheckCompleted
version: 0.0.1
owners:
- dboyne
---
import Footer from '@catalog/components/footer.astro';
## Overview
The Fraud Detection Service is responsible for analyzing payment transactions in real-time to detect potential fraudulent activity. It uses machine learning models and rule-based systems to assess risk and prevent financial losses.
## Key Features
- **Real-time Transaction Analysis**: Analyzes transactions as they occur
- **Machine Learning Models**: Uses ML to identify suspicious patterns
- **Risk Scoring**: Calculates risk scores for each transaction
- **Automated Blocking**: Can automatically block high-risk transactions
- **Manual Review Queue**: Flags medium-risk transactions for manual review
## API Endpoints
### REST API
- `POST /api/fraud/check` - Submit transaction for fraud check
- `GET /api/fraud/risk-score/{transactionId}` - Get risk score for transaction
- `PUT /api/fraud/override/{transactionId}` - Manual override of fraud decision
## Configuration
```yaml
fraud_detection:
risk_thresholds:
high: 80
medium: 50
low: 20
auto_block_threshold: 90
ml_model_version: '2.3.1'
```
---
id: InventoryService
version: 0.0.1
name: Inventory Service
summary: |
Service that handles the inventory
owners:
- dboyne
- full-stack
- mobile-devs
receives:
- id: OrderConfirmed
version: 0.0.1
from:
- id: 'orders.{env}.events'
- id: OrderCancelled
version: 0.0.1
from:
- id: 'orders.{env}.events'
- id: OrderAmended
version: 0.0.1
from:
- id: 'orders.{env}.events'
parameters:
env: staging
- id: UpdateInventory
version: 0.0.3
from:
- id: 'inventory.{env}.events'
parameters:
env: staging
sends:
- id: InventoryAdjusted
version: 1.0.1
to:
- id: 'inventory.{env}.events'
- id: OutOfStock
version: 0.0.4
to:
- id: 'inventory.{env}.events'
repository:
language: JavaScript
url: 'https://github.com/event-catalog/pretend-shipping-service'
---
## Overview
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.
## Architecture diagram
---
id: InventoryService
version: 0.0.2
name: Inventory Service
summary: |
Service that handles the inventory
owners:
- dboyne
- full-stack
- mobile-devs
receives:
- id: OrderConfirmed
version: 0.0.1
from:
- id: inventory-queue
- id: OrderAmended
from:
- id: inventory-queue
- id: UpdateInventory
version: 0.0.3
from:
- id: 'inventory.{env}.events'
parameters:
env: staging
- id: AddInventory
from:
- id: 'inventory.{env}.events'
parameters:
env: staging
- id: GetInventoryStatus
- id: GetInventoryList
sends:
- id: InventoryAdjusted
version: 1.0.1
to:
- id: 'inventory.{env}.events'
- id: OutOfStock
version: 0.0.4
to:
- id: 'inventory.{env}.events'
repository:
language: JavaScript
url: 'https://github.com/event-catalog/pretend-shipping-service'
---
import Footer from '@catalog/components/footer.astro';
## Overview
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.
## Architecture diagram
Request API credentials from the Inventory Service team.
Run the following command in your project directory:
```bash
npm install inventory-service-sdk
```
Use the following code to initialize the Inventory Service client:
```js
const InventoryService = require('inventory-service-sdk');
const client = new InventoryService.Client({
clientId: 'YOUR_CLIENT_ID',
clientSecret: 'YOUR_CLIENT_SECRET',
apiUrl: 'https://api.inventoryservice.com/v1',
});
```
You can now use the client to make API calls. For example, to get all products:
```js
client
.getProducts()
.then((products) => console.log(products))
.catch((error) => console.error(error));
```
---
id: NotificationService
version: 0.0.2
name: Notifications
summary: |
Service that handles orders
owners:
- dboyne
receives:
- id: InventoryAdjusted
version: '>1.0.0'
from:
- id: 'inventory.{env}.events'
- id: PaymentProcessed
version: ^1.0.0
from:
- id: 'payments.{env}.events'
parameters:
env: staging
- id: GetNotificationDetails
- id: GetUserNotifications
sends:
- id: OutOfStock
version: latest
to:
- id: 'inventory.{env}.events'
repository:
language: JavaScript
url: 'https://github.com/event-catalog/pretend-shipping-service'
---
import Footer from '@catalog/components/footer.astro';
## Overview
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.
## Architecture diagram
## Core Concepts
- Description: A message that is sent to a user or a service. - Attributes: notificationId, type, recipient, content, channel,
status, timestamp
- Description: The medium through which the notification is delivered (e.g., email, SMS, push notification). - Attributes:
channelId, name, provider, configuration
---
id: OnboardingFunction
name: Onboarding Function
version: 1.0.0
summary: Azure Function que orquestra as operações de onboarding e integra o BaaS com a API Asaas.
owners:
- full-stack
writesTo:
- id: OnboardingSqlServer
version: 1.0.0
---
## Visão geral
A Onboarding Function é acionada pelo Azure API Management na rota `POST /criar-subconta`. Ela chama a API Asaas para criar a subconta, recebe os dados da conta e persiste o resultado no SQL Server.
---
id: OrdersService
version: 0.0.2
name: Orders Service
summary: |
Service that handles orders
owners:
- dboyne
receives:
- id: InventoryAdjusted
version: 1.0.1
from:
- id: 'inventory.{env}.events'
sends:
- id: AddInventory
version: 0.0.3
to:
- id: 'inventory.{env}.events'
parameters:
env: staging
repository:
language: JavaScript
url: 'https://github.com/event-catalog/pretend-shipping-service'
schemaPath: openapi.yml
specifications:
asyncapiPath: order-service-asyncapi.yaml
openapiPath: openapi.yml
---
import Footer from '@catalog/components/footer.astro';
## Overview
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.
## Architecture diagram
## Raw Schema:openapi.yml
openapi: 3.1.0
info:
title: Simple Task - API
version: 1.0.0
description: Simple Api
contact: {}
license:
name: apache 2.0
identifier: apache-2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: https://example.com/
paths:
/v1/task/{id}:
put:
summary: Do Simple Task
operationId: DoSimpleTask
responses:
'200':
description: do a task by id
content:
application/json:
schema:
$ref: '#/components/schemas/Task'
'204':
description: No content
'400':
description: Problem with data
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Not Authorized
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
'404':
description: not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: Allows to do a simple task
security:
- authorization: []
parameters:
- in: path
name: id
required: true
schema:
type: string
components:
schemas:
Task:
properties:
comments:
type: string
creationDate:
type: string
taskId:
type: string
description:
type: string
lastUpdate:
type: string
type: object
additionalProperties: false
Error:
properties:
error:
type: string
required:
- error
type: object
Unauthorized:
properties:
message:
type: string
required:
- message
type: object
securitySchemes:
authorization:
type: http
scheme: bearer
---
id: OrdersService
version: 0.0.3
name: Orders Service
summary: |
Service that handles orders
owners:
- dboyne
receives:
- id: InventoryAdjusted
version: 1.0.1
from:
- id: 'inventory.{env}.events'
- id: CreateReturnLabel
- id: PlaceOrder
- id: GetOrder
sends:
- id: OrderAmended
to:
- id: 'orders.{env}.events'
parameters:
env: staging
- id: OrderCancelled
to:
- id: 'orders.{env}.events'
- id: OrderConfirmed
to:
- id: 'orders.{env}.events'
- id: AddInventory
version: 0.0.3
to:
- id: 'inventory.{env}.events'
parameters:
env: staging
repository:
language: JavaScript
url: 'https://github.com/event-catalog/pretend-shipping-service'
schemaPath: openapi.yml
specifications:
asyncapiPath: order-service-asyncapi.yaml
openapiPath: openapi.yml
---
import Footer from '@catalog/components/footer.astro';
## Overview
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.
## Architecture diagram
## Raw Schema:openapi.yml
openapi: 3.1.0
info:
title: Simple Task - API
version: 1.0.2
description: Simple Api
contact: {}
license:
name: apache 2.0
identifier: apache-2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: https://example.com/
paths:
/v1/task/{id}:
put:
summary: Do Simple Task
operationId: DoSimpleTask
responses:
'200':
description: do a task by id
content:
application/json:
schema:
$ref: '#/components/schemas/Task'
'204':
description: No content
'400':
description: Problem with data
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Not Authorized
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
'404':
description: not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: Allows to do a simple task
security:
- authorization: []
parameters:
- in: path
name: id
required: true
schema:
type: string
delete:
summary: Delete Task
operationId: DeleteTask
responses:
'204':
description: Task deleted
'400':
description: Problem with data
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Not Authorized
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
'404':
description: not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: Delete a task
security:
- authorization: []
parameters:
- in: path
name: id
required: true
schema:
type: string
/v1/tasks:
get:
summary: Get List of Tasks
operationId: GetTaskList
responses:
'200':
description: Successfully retrieved list of tasks
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Task'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Not Authorized
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: Retrieves a list of all tasks
security:
- authorization: []
parameters:
- in: query
name: limit
schema:
type: integer
minimum: 1
maximum: 100
default: 20
description: The maximum number of tasks to return
- in: query
name: offset
schema:
type: integer
minimum: 0
default: 0
description: The number of tasks to skip before starting to return results
components:
schemas:
Task:
properties:
comments:
type: string
creationDate:
type: string
taskId:
type: string
description:
type: string
lastUpdate:
type: string
type: object
additionalProperties: false
Error:
properties:
error:
type: string
required:
- error
type: object
Unauthorized:
properties:
message:
type: string
required:
- message
type: object
securitySchemes:
authorization:
type: http
scheme: bearer
---
id: PaymentGatewayService
version: 0.0.1
name: Payment Gateway Service
summary: Manages integration with external payment processors (Stripe, PayPal, etc.)
tags:
- payment
- gateway
- integration
repository:
url: https://github.com/eventcatalog/payment-gateway-service
receives:
- id: ProcessPayment
version: 0.0.1
- id: FraudCheckCompleted
version: 0.0.1
sends:
- id: PaymentFailed
version: 0.0.1
owners:
- dboyne
---
import Footer from '@catalog/components/footer.astro';
## Overview
The Payment Gateway Service acts as an abstraction layer between our payment system and external payment processors. It handles the complexity of integrating with multiple payment providers and provides a unified interface for payment operations.
## Supported Payment Providers
- **Stripe**: Credit/debit cards, digital wallets
- **PayPal**: PayPal accounts, PayPal Credit
- **Square**: In-person and online payments
- **Adyen**: Global payment processing
- **Braintree**: Multiple payment methods
## Key Features
- **Multi-provider Support**: Switch between providers seamlessly
- **Retry Logic**: Automatic retry for failed transactions
- **Tokenization**: Secure card data handling
- **Webhook Management**: Handles provider webhooks
- **Currency Conversion**: Support for 150+ currencies
## API Endpoints
### REST API
- `POST /api/gateway/authorize` - Authorize a payment
- `POST /api/gateway/capture` - Capture an authorized payment
- `POST /api/gateway/refund` - Process a refund
- `GET /api/gateway/status/{transactionId}` - Get transaction status
## Configuration
```yaml
payment_gateway:
providers:
stripe:
api_key: ${STRIPE_API_KEY}
webhook_secret: ${STRIPE_WEBHOOK_SECRET}
paypal:
client_id: ${PAYPAL_CLIENT_ID}
client_secret: ${PAYPAL_CLIENT_SECRET}
retry:
max_attempts: 3
backoff_ms: 1000
```
---
id: PaymentService
name: Payment Service
version: 0.0.1
summary: |
Service that handles payments
owners:
- dboyne
receives:
- id: PaymentInitiated
version: 0.0.1
from:
- id: 'payments.{env}.events'
parameters:
env: staging
- id: GetPaymentStatus
sends:
- id: PaymentProcessed
version: 0.0.1
to:
- id: 'payments.{env}.events'
parameters:
env: staging
repository:
language: JavaScript
url: 'https://github.com/event-catalog/pretend-shipping-service'
---
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.
### Key Components
- Payment API: Exposes endpoints for initiating payments and querying payment status.
- Payment Processor: Handles the core payment processing logic.
- Event Bus: Manages the communication between services using events.
- Payment Gateway: Interfaces with external payment providers.
- Transaction Service: Manages transaction records and states.
- Notification Service: Sends notifications related to payment status changes.
- Database: Stores transaction data and payment status.
---
id: PlanManagementService
version: 0.0.1
name: Plan Management Service
summary: Manages subscription plans, features, pricing tiers, and plan migrations
tags:
- plans
- pricing
- subscriptions
repository:
url: https://github.com/eventcatalog/plan-management-service
receives: []
sends: []
owners:
- dboyne
---
import Footer from '@catalog/components/footer.astro';
## Overview
The Plan Management Service handles the definition and management of subscription plans, including pricing, features, and plan migrations. It serves as the source of truth for what features and limits apply to each subscription tier.
## Key Features
- **Plan Definition**: Create and manage subscription plans with different tiers
- **Feature Flags**: Control feature access based on subscription plans
- **Usage Limits**: Define and enforce usage limits per plan
- **Plan Migration**: Handle upgrades and downgrades between plans
- **Pricing Management**: Manage pricing, discounts, and promotional offers
## Supported Plan Types
### Basic Plan
- Essential features
- Limited usage quotas
- Email support
### Professional Plan
- All Basic features
- Higher usage quotas
- Priority support
- Advanced analytics
### Enterprise Plan
- All Professional features
- Unlimited usage
- Dedicated support
- Custom integrations
- SLA guarantees
## API Endpoints
### REST API
- `GET /api/plans` - List all available plans
- `GET /api/plans/{planId}` - Get plan details
- `POST /api/plans` - Create new plan
- `PUT /api/plans/{planId}` - Update plan
- `POST /api/plans/migrate` - Migrate subscription to different plan
## Plan Structure
```json
{
"id": "pro-monthly",
"name": "Professional Monthly",
"price": 49.99,
"currency": "USD",
"interval": "monthly",
"features": {
"api_calls": 10000,
"storage_gb": 100,
"team_members": 10,
"priority_support": true
}
}
```
---
id: ShippingService
version: 0.0.1
name: Shipping Service
summary: |
Service that handles shipping
owners:
- dboyne
receives:
- id: PaymentProcessed
from:
- id: 'payments.{env}.events'
parameters:
env: staging
- id: CancelShipment
- id: CreateShipment
- id: UpdateShipmentStatus
sends:
- id: ShipmentCreated
- id: ReturnInitiated
- id: ShipmentDispatched
- id: ShipmentInTransit
- id: ShipmentDelivered
- id: DeliveryFailed
repository:
language: JavaScript
url: 'https://github.com/event-catalog/pretend-shipping-service'
---
import Footer from '@catalog/components/footer.astro';
## Overview
The Shipping Service is responsible for managing shipping 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.
### Core features
The Shipping Service is responsible for managing shipping 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.
## Architecture diagram
---
id: SubscriptionService
version: 0.0.1
name: Subscription Service
summary: |
Service that handles subscriptions
owners:
- dboyne
receives:
- id: SubscribeUser
version: 0.0.1
- id: CancelSubscription
version: 0.0.1
- id: GetSubscriptionStatus
sends:
- id: UserSubscriptionStarted
version: 0.0.1
- id: UserSubscriptionCancelled
version: 0.0.1
repository:
language: JavaScript
url: https://github.com/event-catalog/pretend-subscription-service
---
import Footer from '@catalog/components/footer.astro';
## Overview
The subscription Service is responsible for handling customer subscriptions in our system. It handles new subscriptions, cancelling subscriptions and updating them.
## Architecture diagram
---
id: BakingAsAService
name: Baking as a Service
summary: Domínio que reúne as capacidades de Banking as a Service oferecidas pela plataforma.
version: 1.0.0
owners:
- full-stack
domains:
- id: Onboarding
- id: Credito
- id: Tesouraria
- id: Webhooks
- id: Recebimentos
---
## Visão geral
O domínio Baking as a Service organiza as capacidades financeiras disponibilizadas como serviço, incluindo entrada de clientes, crédito, tesouraria, recebimentos e integrações por webhooks.
---
id: Comercial
name: Comercial
summary: Domínio responsável pela criação de orçamentos, solicitações e pedidos.
version: 1.0.0
owners:
- Fernando Longuini
domains:
- id: Orders
- id: Payment
- id: Subscription
sends:
- id: PedidoCriado
version: 1.0.0
- id: PedidoEditado
version: 1.0.0
- id: PedidoCancelado
version: 1.0.0
badges:
- content: Core domain
backgroundColor: blue
textColor: blue
icon: RectangleGroupIcon
- content: Business Critical
backgroundColor: yellow
textColor: yellow
icon: ShieldCheckIcon
---
import Footer from '@catalog/components/footer.astro';
O domínio do financeiro é responsável por gerenciar contas a pagar, contas a receber, emissão de notas fiscais, conciliação contábil e realizar a gestão do fluxo de caixa da empresa.
---
id: Core
name: Core
summary: Domínio responsável pelas regras de negócio em comum entre mais de domínio que dependem do realm
version: 1.0.0
owners:
- Fernando Longuini
domains:
- id: Orders
- id: Payment
- id: Subscription
badges:
- content: Core domain
backgroundColor: blue
textColor: blue
icon: RectangleGroupIcon
- content: Business Critical
backgroundColor: yellow
textColor: yellow
icon: ShieldCheckIcon
---
import Footer from '@catalog/components/footer.astro';
O domínio do financeiro é responsável por gerenciar contas a pagar, contas a receber, emissão de notas fiscais, conciliação contábil e realizar a gestão do fluxo de caixa da empresa.
---
id: Credito
name: Crédito
summary: Subdomínio responsável pelas capacidades de crédito do Banking as a Service.
version: 1.0.0
owners:
- full-stack
---
## Visão geral
O subdomínio Crédito concentra as capacidades relacionadas à oferta e à gestão de produtos e operações de crédito.
---
id: E-Commerce
name: E-Commerce
summary: Core business domain orchestrating FlowMart's digital marketplace operations
version: 1.0.0
owners:
- dboyne
- full-stack
domains:
- id: Orders
- id: Payment
- id: Subscription
badges:
- content: Core domain
backgroundColor: blue
textColor: blue
icon: RectangleGroupIcon
- content: Business Critical
backgroundColor: yellow
textColor: yellow
icon: ShieldCheckIcon
---
import Footer from '@catalog/components/footer.astro';
The E-Commerce domain is the core business domain of FlowMart, our modern digital marketplace. This domain orchestrates all critical business operations from product discovery to order fulfillment, handling millions of transactions monthly across our global customer base.
## Domain Overview
FlowMart's E-Commerce domain is built on event-driven microservices architecture, enabling:
- Real-time inventory management across multiple warehouses
- Seamless payment processing with multiple providers
- Smart order routing and fulfillment
- Personalized customer notifications
- Subscription-based shopping experiences
- Advanced fraud detection and prevention
## Sub domains
The E-Commerce domain is built on the following sub domains:
-
Orders
- Core domain for order management
-
Payment
- A generic domain for payment processing using Stripe as a payment provider
-
Subscription
- Generic subscription domain handling users subscriptions
## Architecture
Our current event-driven architecture powering FlowMart's shopping experience:
### Order Processing Flow
```mermaid
sequenceDiagram
participant Customer
participant OrdersService
participant InventoryService
participant PaymentService
participant NotificationService
participant ShippingService
Customer->>OrdersService: Place Order
OrdersService->>InventoryService: Check Stock Availability
InventoryService-->>OrdersService: Stock Confirmed
OrdersService->>PaymentService: Process Payment
PaymentService-->>OrdersService: Payment Successful
OrdersService->>InventoryService: Reserve Inventory
OrdersService->>ShippingService: Create Shipping Label
ShippingService-->>OrdersService: Shipping Label Generated
OrdersService->>NotificationService: Send Order Confirmation
NotificationService-->>Customer: Order & Tracking Details
```
## Key Business Flows
### Subscription Management
Our subscription service powers FlowMart's popular "Subscribe & Save" feature:
### Payment Processing
Secure, multi-provider payment processing with fraud detection:
## Core Services
These services form the backbone of FlowMart's e-commerce operations:
## Performance SLAs
- Order Processing: < 2 seconds
- Payment Processing: < 3 seconds
- Inventory Updates: Real-time
- Notification Delivery: < 30 seconds
## Monitoring & Alerts
- Real-time order volume monitoring
- Payment gateway health checks
- Inventory level alerts
- Customer experience metrics
- System performance dashboards
---
id: Entregas
name: Entregas
summary: Domínio responsável pelo gerenciamento da entregas e finalização do pedido
version: 1.0.0
owners:
- Fernando Longuini
domains:
- id: Orders
- id: Payment
- id: Subscription
sends:
- id: EntregaFinalizada
version: 1.0.0
badges:
- content: Core domain
backgroundColor: blue
textColor: blue
icon: RectangleGroupIcon
- content: Business Critical
backgroundColor: yellow
textColor: yellow
icon: ShieldCheckIcon
---
import Footer from '@catalog/components/footer.astro';
---
id: EtiquetaERomaneio
name: Etiqueta e Romaneio
summary: Domínio responsável pela criação e manutenção de etiquetas e romaneios.
version: 1.0.0
owners:
- full-stack
sends:
- id: RomaneioCriado
version: 1.0.0
- id: RomaneioEditado
version: 1.0.0
---
## Visão geral
O domínio Etiqueta e Romaneio reúne as capacidades de criação e manutenção de romaneios e etiquetas operacionais.
---
id: Financeiro
name: Financeiro
summary: Domínio responsável pela área financeira do ERP. Contém as regras de contas a pagar, contas a receber, NF e fluxo de caixa
version: 1.0.0
owners:
- JV
- JP
domains:
- id: Orders
- id: Payment
- id: Subscription
sends:
- id: PagamentoRecebido
version: 1.0.0
badges:
- content: Core domain
backgroundColor: blue
textColor: blue
icon: RectangleGroupIcon
- content: Business Critical
backgroundColor: yellow
textColor: yellow
icon: ShieldCheckIcon
---
import Footer from '@catalog/components/footer.astro';
O domínio do financeiro é responsável por gerenciar contas a pagar, contas a receber, emissão de notas fiscais, conciliação contábil e realizar a gestão do fluxo de caixa da empresa.
---
id: Keycloak
name: Keycloak
summary: Domínio responsável pelo CIAM
version: 1.0.0
owners:
- Fernando Longuini
domains:
- id: Orders
- id: Payment
- id: Subscription
badges:
- content: Core domain
backgroundColor: blue
textColor: blue
icon: RectangleGroupIcon
- content: Business Critical
backgroundColor: yellow
textColor: yellow
icon: ShieldCheckIcon
---
import Footer from '@catalog/components/footer.astro';
O domínio do financeiro é responsável por gerenciar contas a pagar, contas a receber, emissão de notas fiscais, conciliação contábil e realizar a gestão do fluxo de caixa da empresa.
---
id: Onboarding
name: Onboarding
summary: Subdomínio responsável pela entrada e habilitação de clientes no Banking as a Service.
version: 1.0.0
owners:
- full-stack
services:
- id: OnboardingFunction
version: 1.0.0
- id: AsaasApi
version: 1.0.0
containers:
- id: OnboardingSqlServer
version: 1.0.0
diagrams:
- id: onboarding-architecture
version: 1.0.0
---
## Visão geral
O subdomínio Onboarding concentra as capacidades relacionadas ao cadastro, à habilitação e à preparação de clientes para uso dos serviços financeiros.
---
id: Orders
name: Orders
version: 0.0.1
summary: |
Domain for everything shopping
owners:
- dboyne
- full-stack
services:
- id: InventoryService
version: 0.0.2
badges:
- content: New domain
backgroundColor: blue
textColor: blue
---
## Overview
---
id: Orders
name: Orders
summary: Handles all operations related to customer orders, from creation to fulfillment
version: 0.0.2
owners:
- dboyne
services:
- id: InventoryService
version: 0.0.2
- id: NotificationService
version: 0.0.2
- id: OrdersService
version: 0.0.2
badges:
- content: New domain
backgroundColor: blue
textColor: blue
---
## Overview
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.
Please ensure all services are updated to the latest version for compatibility and performance improvements.
## Bounded context
### Order example (sequence diagram)
```mermaid
sequenceDiagram
participant Customer
participant OrdersService
participant InventoryService
participant NotificationService
Customer->>OrdersService: Place Order
OrdersService->>InventoryService: Check Inventory
InventoryService-->>OrdersService: Inventory Available
OrdersService->>InventoryService: Reserve Inventory
OrdersService->>NotificationService: Send Order Confirmation
NotificationService-->>Customer: Order Confirmation
OrdersService->>Customer: Order Placed Successfully
OrdersService->>InventoryService: Update Inventory
```
---
id: Orders
name: Orders
summary: Handles all operations related to customer orders, from creation to fulfillment
version: 0.0.3
owners:
- dboyne
- full-stack
services:
- id: InventoryService
- id: OrdersService
- id: NotificationService
- id: ShippingService
entities:
- id: Order
- id: OrderItem
- id: Customer
- id: ShoppingCart
- id: CartItem
badges:
- content: Subdomain
backgroundColor: blue
textColor: blue
icon: RectangleGroupIcon
resourceGroups:
- id: related-resources
title: Core resources
items:
- id: InventoryService
type: service
- id: OrdersService
type: service
- id: NotificationService
type: service
- id: ShippingService
type: service
---
import Footer from '@catalog/components/footer.astro';
:::warning
Please ensure all services are **updated** to the latest version for compatibility and performance improvements.
:::
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
### Architecture for the Orders domain
### Entity Map
A visualization of the entities in the Orders domain. Here you can see the relationships between the entities and how they are used in the domain.
### Order example (sequence diagram)
```mermaid
sequenceDiagram
participant Customer
participant OrdersService
participant InventoryService
participant NotificationService
Customer->>OrdersService: Place Order
OrdersService->>InventoryService: Check Inventory
InventoryService-->>OrdersService: Inventory Available
OrdersService->>InventoryService: Reserve Inventory
OrdersService->>NotificationService: Send Order Confirmation
NotificationService-->>Customer: Order Confirmation
OrdersService->>Customer: Order Placed Successfully
OrdersService->>InventoryService: Update Inventory
```
## Flows
### Cancel Subscription flow
Documented flow when a user cancels their subscription.
### Payment processing flow
Documented flow when a user makes a payment within the order domain
---
id: Payment
name: Payment
version: 0.0.1
summary: |
Domain that contains payment related services and messages.
owners:
- dboyne
services:
- id: PaymentService
version: 0.0.1
- id: FraudDetectionService
version: 0.0.1
- id: PaymentGatewayService
version: 0.0.1
entities:
- id: Invoice
- id: Payment
- id: PaymentMethod
- id: Transaction
- id: Address
badges:
- content: Payment Domain
backgroundColor: blue
textColor: blue
---
## Overview
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
### Architecture for the Payment domain
### Entity Map
A visualization of the entities in the Payment domain. Here you can see the relationships between the entities and how they are used in the domain.
---
id: Planilhamento
name: Planilhamento
summary: Domínio responsável pela transformação do projeto estrutural em elementos de máquina
version: 1.0.0
owners:
- Fernando Longuini
domains:
- id: Orders
- id: Payment
- id: Subscription
sends:
- id: PlanilhamentoCriado
version: 1.0.0
- id: PlanilhamentoAtualizado
version: 1.0.0
- id: PlanilhamentoFinalizado
version: 1.0.0
badges:
- content: Core domain
backgroundColor: blue
textColor: blue
icon: RectangleGroupIcon
- content: Business Critical
backgroundColor: yellow
textColor: yellow
icon: ShieldCheckIcon
---
import Footer from '@catalog/components/footer.astro';
O domínio do financeiro é responsável por gerenciar contas a pagar, contas a receber, emissão de notas fiscais, conciliação contábil e realizar a gestão do fluxo de caixa da empresa.
---
id: Plataforma
name: Plataforma
summary: Domínio responsável pelas regras de negócio em comum entre mais de domínio que não dependem do realm
version: 1.0.0
owners:
- Fernando Longuini
domains:
- id: Orders
- id: Payment
- id: Subscription
badges:
- content: Core domain
backgroundColor: blue
textColor: blue
icon: RectangleGroupIcon
- content: Business Critical
backgroundColor: yellow
textColor: yellow
icon: ShieldCheckIcon
---
import Footer from '@catalog/components/footer.astro';
O domínio do financeiro é responsável por gerenciar contas a pagar, contas a receber, emissão de notas fiscais, conciliação contábil e realizar a gestão do fluxo de caixa da empresa.
---
id: Producao
name: Produção
summary: Domínio responsável pela realização da produção dos elementos estruturais
version: 1.0.0
owners:
- Fernando Longuini
domains:
- id: Orders
- id: Payment
- id: Subscription
sends:
- id: ProducaoAtualizada
version: 1.0.0
- id: ProducaoFinalizada
version: 1.0.0
badges:
- content: Core domain
backgroundColor: blue
textColor: blue
icon: RectangleGroupIcon
- content: Business Critical
backgroundColor: yellow
textColor: yellow
icon: ShieldCheckIcon
---
import Footer from '@catalog/components/footer.astro';
---
id: ProductCatalog
name: Product Catalog
version: 0.0.1
summary: Manages product information, categories, inventory, and customer reviews in the e-commerce system.
owners:
- dboyne
entities:
- id: Product
- id: Category
- id: Inventory
- id: Review
services:
- id: InventoryService
---
## Overview
The Product Catalog subdomain is responsible for managing all product-related information in the e-commerce system. This includes product details, hierarchical categorization, inventory tracking, and customer reviews.
### Architecture for the Product Catalog domain
### Entity Map
A visualization of the entities in the Product Catalog domain. Here you can see the relationships between the entities and how they are used in the domain.
## Core Responsibilities
### Product Management
- Maintain product information including pricing, descriptions, and specifications
- Support product variants (size, color, style)
- Handle product lifecycle (active, discontinued, draft)
- Manage product relationships and cross-selling
### Category Management
- Organize products into hierarchical categories
- Support multi-level category structures
- Maintain category metadata and SEO information
- Handle category navigation and filtering
### Inventory Management
- Track stock levels and availability
- Manage reorder points and stock alerts
- Handle inventory reservations and allocations
- Support warehouse and location management
### Review Management
- Collect and manage customer product reviews
- Calculate review metrics and ratings
- Moderate review content
- Support review helpfulness and responses
## Key Entities
- **Product**: Central aggregate containing all product information
- **Category**: Hierarchical product categorization system
- **Inventory**: Stock tracking and availability management
- **Review**: Customer feedback and rating system
## Business Rules
- Products must belong to an active category
- Inventory levels affect product availability
- Reviews require verified purchases
- Category hierarchies have maximum depth limits
---
id: Programacao
name: Programação
summary: Domínio responsável pela priorização e orquestração da produção dos pedidos
version: 1.0.0
owners:
- Fernando Longuini
domains:
- id: Orders
- id: Payment
- id: Subscription
sends:
- id: ConfiguracaoAtualizada
version: 1.0.0
- id: NovaProgramacaoCriada
version: 1.0.0
- id: ProgramacaoEditada
version: 1.0.0
badges:
- content: Core domain
backgroundColor: blue
textColor: blue
icon: RectangleGroupIcon
- content: Business Critical
backgroundColor: yellow
textColor: yellow
icon: ShieldCheckIcon
---
import Footer from '@catalog/components/footer.astro';
---
id: Recebimentos
name: Recebimentos
summary: Subdomínio responsável pelas capacidades de recebimentos do Banking as a Service.
version: 1.0.0
owners:
- full-stack
---
## Visão geral
O subdomínio Recebimentos concentra as capacidades relacionadas à criação, ao acompanhamento e à liquidação de recebimentos.
---
id: Subscription
name: Subscription
version: 0.0.1
summary: |
Domain that contains subscription related services and messages.
owners:
- dboyne
services:
- id: BillingService
version: 0.0.1
- id: PlanManagementService
version: 0.0.1
entities:
- id: BillingProfile
- id: SubscriptionPeriod
badges:
- content: Payment Domain
backgroundColor: blue
textColor: blue
---
## Overview
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
### Architecture for the Subscription domain
### Entity Map
A visualization of the entities in the Subscription domain. Here you can see the relationships between the entities and how they are used in the domain.
---
id: Tesouraria
name: Tesouraria
summary: Subdomínio responsável pelas capacidades de tesouraria do Banking as a Service.
version: 1.0.0
owners:
- full-stack
---
## Visão geral
O subdomínio Tesouraria concentra as capacidades relacionadas à movimentação, ao controle e à gestão financeira dos recursos.
---
id: Webhooks
name: Webhooks
summary: Subdomínio responsável pelas notificações e integrações orientadas a eventos do Banking as a Service.
version: 1.0.0
owners:
- full-stack
---
## Visão geral
O subdomínio Webhooks concentra as capacidades relacionadas à publicação de notificações para sistemas consumidores.
---
id: full-stack
name: Full stackers
summary: Full stack developers based in London, UK
members:
- dboyne
- asmith
- msmith
email: test@test.com
slackDirectMessageUrl: https://yourteam.slack.com/channels/boyney123
---
## Overview
The Full Stack Team is responsible for developing and maintaining both the front-end and back-end components of our applications. This team ensures that the user interfaces are intuitive and responsive, and that the server-side logic and database interactions are efficient and secure. The Full Stack Team handles the entire lifecycle of web applications, from initial development to deployment and ongoing maintenance.
## Responsibilities
### Key Responsibilities
- **Front-End Development**: Design and implement user interfaces using modern web technologies (e.g., HTML, CSS, JavaScript, React).
- **Back-End Development**: Develop and maintain server-side logic, APIs, and database interactions (e.g., Node.js, Express, SQL/NoSQL databases).
- **Integration**: Ensure seamless communication between the front-end and back-end components.
- **Performance Optimization**: Optimize the performance and scalability of web applications.
- **Testing and Debugging**: Write and maintain unit, integration, and end-to-end tests to ensure the quality and reliability of the applications.
- **Deployment**: Manage the deployment of applications to production environments using CI/CD pipelines.
---
id: mobile-devs
name: The mobile devs
summary: Mobile application development team for iOS and Android platforms
members:
- dboyne
---
The Mobile Devs team is responsible for the development and maintenance of Acme Inc mobile applications. This includes the iOS and Android apps that customers use to interact with our services, make purchases, and manage their accounts. The team ensures that the mobile apps are user-friendly, secure, and performant.
## Responsibilities
### 1. Mobile Application Development
- **Platform Support**: Developing and maintaining apps for iOS and Android platforms.
- **Feature Implementation**: Implementing new features based on product requirements and user feedback.
- **User Interface Design**: Ensuring a consistent and intuitive user interface across all mobile platforms.
- **Performance Optimization**: Optimizing the performance of mobile apps to ensure fast and smooth user experiences.
### 2. Integration with Backend Services
- **API Integration**: Integrating mobile apps with backend services using RESTful APIs and other communication protocols.
- **Real-time Updates**: Implementing real-time data updates and synchronization with backend services.
---
id: asmith
name: Amy Smith
summary: Product Owner of the Full Stackers team
avatarUrl: https://randomuser.me/api/portraits/women/48.jpg
role: Product owner
---
Hello! I'm Amy Smith, the Product Owner of the innovative Full Stackers team. With a strong focus on delivering exceptional value, I specialize in connecting business objectives with technical solutions to create products that users love.
### About Me
With a comprehensive background in product management and a solid understanding of software development, I bring a unique perspective to the table. My career has been driven by a passion for understanding user needs, defining clear product visions, and leading teams to successful product deliveries.
### What I Do
As the Product Owner for Full Stackers, my role involves a wide range of responsibilities aimed at ensuring our products are both high-quality and user-centric. Key aspects of my role include:
- **Product Vision & Strategy**: Defining and communicating the long-term vision and strategy for our products, ensuring alignment with the company's objectives and market demands.
- **Roadmap Planning**: Developing and maintaining a product roadmap that highlights key features and milestones, prioritizing tasks based on their business value and user feedback.
- **Stakeholder Management**: Engaging with stakeholders across the organization to gather requirements, provide updates, and ensure everyone is aligned on the product's direction.
- **User-Centric Design**: Championing the end-users by conducting user research, analyzing feedback, and ensuring our products effectively solve their problems.
- **Agile Leadership**: Leading the development process using Agile methodologies, facilitating sprint planning, and ensuring the team has clear priorities and objectives.
My mission is to deliver products that not only meet but exceed customer expectations. I thrive on the challenge of translating complex requirements into simple, intuitive solutions.
If you’re interested in product management, user experience, or discussing the latest trends in technology, feel free to reach out!
---
id: dboyne
name: David Boyne
summary: Tech Lead of the Full Stackers team
avatarUrl: 'https://pbs.twimg.com/profile_images/1262283153563140096/DYRDqKg6_400x400.png'
role: Lead developer
email: test@test.com
slackDirectMessageUrl: https://yourteam.slack.com/channels/boyney123
---
Hello! I'm David Boyne, the Tech Lead of an amazing team called Full Stackers. With a passion for building robust and scalable systems, I specialize in designing and implementing event-driven architectures that power modern, responsive applications.
### About Me
With over a decade of experience in the tech industry, I have honed my skills in full-stack development, cloud computing, and distributed systems. My journey has taken me through various roles, from software engineer to architect, and now as a tech lead, I am committed to driving innovation and excellence within my team.
### What I Do
At Full Stackers, we focus on creating seamless and efficient event-driven architectures that enhance the performance and scalability of our applications. My role involves:
- **Architecture Design**: Crafting scalable and resilient system architectures using event-driven paradigms.
- **Team Leadership**: Guiding a talented team of developers, fostering a collaborative and innovative environment.
- **Code Reviews & Mentorship**: Ensuring code quality and sharing knowledge to help the team grow.
- **Stakeholder Collaboration**: Working closely with other teams and stakeholders to align our technical solutions with business goals.
- **Continuous Improvement**: Advocating for best practices in software development, deployment, and monitoring.
I am passionate about leveraging the power of events to build systems that are not only highly responsive but also easier to maintain and extend. In an ever-evolving tech landscape, I strive to stay ahead of the curve, continuously learning and adapting to new technologies and methodologies.
Feel free to connect with me to discuss all things tech, event-driven architectures, or to exchange ideas on building better software systems!
---
_David Boyne_
_Tech Lead, Full Stackers_
---
id: msmith
name: Martin Smith
summary: Senior Mobile Developer on The Mobile Devs team
avatarUrl: 'https://randomuser.me/api/portraits/men/51.jpg'
role: Senior software engineer
---
As a Senior Mobile Developer on The Mobile Devs team, I play a key role in designing, developing, and maintaining Acme Incs mobile applications. My focus is on creating a seamless and intuitive user experience for our customers on both iOS and Android platforms. I work closely with cross-functional teams, including backend developers, UX/UI designers, and product managers, to deliver high-quality mobile solutions that meet business objectives and exceed user expectations.
---
id: Address
name: Address
version: 1.0.0
identifier: addressId
summary: Represents shipping and billing addresses for customers and orders.
owners:
- dboyne
properties:
- name: addressId
type: UUID
required: true
description: Unique identifier for the address
- name: customerId
type: UUID
required: false
description: Customer this address belongs to
references: Customer
referencesIdentifier: customerId
relationType: hasOne
- name: type
type: string
required: true
description: Type of address
enum: ['billing', 'shipping', 'both']
- name: firstName
type: string
required: true
description: First name of the recipient
- name: lastName
type: string
required: true
description: Last name of the recipient
- name: company
type: string
required: false
description: Company name if applicable
- name: addressLine1
type: string
required: true
description: Primary address line (street address)
- name: addressLine2
type: string
required: false
description: Secondary address line (apartment, suite, etc.)
- name: city
type: string
required: true
description: City name
- name: state
type: string
required: true
description: State or province
- name: postalCode
type: string
required: true
description: Postal or ZIP code
- name: country
type: string
required: true
description: Country code (ISO 3166-1 alpha-2)
- name: phone
type: string
required: false
description: Phone number for delivery contact
- name: isDefault
type: boolean
required: true
description: Whether this is the default address for the customer
- name: isValidated
type: boolean
required: true
description: Whether the address has been validated
- name: validationDetails
type: object
required: false
description: Address validation details
properties:
- name: validatedAt
type: DateTime
description: When the address was validated
- name: validationService
type: string
description: Service used for validation
- name: confidence
type: decimal
description: Validation confidence score
- name: geocoordinates
type: object
required: false
description: Geographic coordinates for the address
properties:
- name: latitude
type: decimal
description: Latitude coordinate
- name: longitude
type: decimal
description: Longitude coordinate
- name: deliveryInstructions
type: string
required: false
description: Special delivery instructions
- name: orders
type: array
items:
type: Order
required: false
description: Orders using this address
references: Order
referencesIdentifier: shippingAddress
relationType: hasMany
- name: payments
type: array
items:
type: Payment
required: false
description: Payments using this as billing address
references: Payment
referencesIdentifier: billingAddress
relationType: hasMany
- name: createdAt
type: DateTime
required: true
description: Date and time when the address was created
- name: updatedAt
type: DateTime
required: false
description: Date and time when the address was last updated
---
## Overview
The Address entity stores shipping and billing addresses for customers, orders, and payments. It supports address validation, geocoding, and delivery instructions to ensure accurate order fulfillment.
### Entity Properties
## Relationships
- **Customer:** An address can belong to one `Customer` (identified by `customerId`).
- **Order:** An address can be used by multiple `Order` entities for shipping.
- **Payment:** An address can be used by multiple `Payment` entities for billing.
## Address Types
- **Billing:** Used for payment processing and invoicing
- **Shipping:** Used for order delivery
- **Both:** Can be used for both billing and shipping
## Examples
- **Address #1:** John Doe's home address - default shipping and billing address.
- **Address #2:** Corporate office address - billing only, validated with high confidence.
- **Address #3:** Gift recipient address - shipping only, with special delivery instructions.
## Business Rules
- Each customer can have only one default address per type
- Addresses must be validated before being marked as default
- International addresses require country-specific validation
- Geocoordinates are automatically populated when available
- Address changes should create new versions for audit trail
- PO Box addresses may have shipping restrictions
- Address validation improves delivery success rates
---
id: BillingProfile
name: BillingProfile
version: 1.0.0
identifier: billingProfileId
summary: Stores billing-related contact information and preferences for a customer, often used for invoices and communication.
owners:
- dboyne
properties:
- name: billingProfileId
type: UUID
required: true
description: Unique identifier for the billing profile.
- name: customerId
type: UUID
required: true
description: Identifier of the customer this billing profile belongs to.
references: Customer
referencesIdentifier: customerId
relationType: hasOne
- name: billingEmail
type: string
required: false # May default to customer's primary email
description: Specific email address for sending invoices and billing notifications
- name: companyName # Optional, for B2B
type: string
required: false
description: Company name for billing purposes.
- name: taxId # Optional, for B2B or specific regions
type: string
required: false
description: Tax identification number (e.g., VAT ID, EIN).
- name: billingAddressId
type: UUID
required: true
description: Identifier for the primary billing address associated with this profile.
- name: preferredPaymentMethodId # Optional default for invoices/subscriptions
type: UUID
required: false
description: Customer's preferred payment method for charges related to this profile.
- name: createdAt
type: DateTime
required: true
description: Timestamp when the billing profile was created.
- name: updatedAt
type: DateTime
required: true
description: Timestamp when the billing profile was last updated.
---
## Overview
The BillingProfile entity consolidates billing-specific details for a customer, such as the billing address, contact email for invoices, tax information, and potentially preferred payment methods. This might be distinct from the customer's general contact information or shipping addresses.
### Entity Properties
## Relationships
- **Customer:** A billing profile belongs to one `Customer`. A customer might potentially have multiple profiles in complex scenarios, but often just one.
- **Address:** Linked to a primary billing `Address`.
- **PaymentMethod:** May specify a preferred `PaymentMethod`.
- **Invoice:** Invoices are typically generated using information from the BillingProfile.
- **Subscription:** Subscriptions may use the associated customer's BillingProfile for charging.
## Examples
- Jane Doe's personal billing profile with her home address and primary email.
- Acme Corp's billing profile with their HQ address, VAT ID, and accounts payable email address.
---
id: CartItem
name: CartItem
version: 1.0.0
identifier: cartItemId
summary: Represents an individual item within a shopping cart.
owners:
- dboyne
properties:
- name: cartItemId
type: UUID
required: true
description: Unique identifier for the cart item
- name: cartId
type: UUID
required: true
description: Shopping cart this item belongs to
references: ShoppingCart
referencesIdentifier: cartId
relationType: hasOne
- name: productId
type: UUID
required: true
description: Product being added to cart
references: Product
referencesIdentifier: productId
relationType: hasOne
- name: sku
type: string
required: true
description: Product SKU at time of adding to cart
- name: productName
type: string
required: true
description: Product name snapshot at time of adding to cart
- name: productImage
type: string
required: false
description: Product image URL snapshot
- name: quantity
type: integer
required: true
description: Quantity of this product in the cart
- name: unitPrice
type: decimal
required: true
description: Unit price at time of adding to cart
- name: totalPrice
type: decimal
required: true
description: Total price for this line item (quantity × unit price)
- name: originalPrice
type: decimal
required: false
description: Original product price before any discounts
- name: discountAmount
type: decimal
required: false
description: Discount applied to this line item
- name: productVariant
type: object
required: false
description: Product variant details (size, color, etc.)
properties:
- name: size
type: string
description: Product size if applicable
- name: color
type: string
description: Product color if applicable
- name: style
type: string
description: Product style if applicable
- name: isAvailable
type: boolean
required: true
description: Whether the product is still available
- name: notes
type: string
required: false
description: Customer notes for this item
- name: addedAt
type: DateTime
required: true
description: Date and time when item was added to cart
- name: updatedAt
type: DateTime
required: false
description: Date and time when item was last updated
---
## Overview
The CartItem entity represents individual products within a customer's shopping cart. It maintains snapshots of product information and pricing to ensure consistency during the shopping session.
### Entity Properties
## Relationships
- **ShoppingCart:** Each cart item belongs to one `ShoppingCart` (identified by `cartId`).
- **Product:** Each cart item references one `Product` (identified by `productId`).
## Price Calculations
- **Total Price** = Quantity × Unit Price - Discount Amount
- **Savings** = Original Price - Unit Price (if applicable)
## Examples
- **CartItem #1:** iPhone 15 Pro, quantity 1, $999.99 unit price, no discount.
- **CartItem #2:** Running Shoes Size 9, quantity 2, $64.99 unit price (was $129.99).
- **CartItem #3:** T-Shirt Large/Blue, quantity 3, $19.99 unit price.
## Business Rules
- Quantity must be greater than zero
- Unit price is captured at time of adding to maintain consistency
- Product availability is checked when cart is accessed
- Unavailable items are marked but not automatically removed
- Total price is recalculated when quantity changes
- Product snapshots prevent price changes from affecting active carts
- Maximum quantity limits may apply per product type
---
id: Category
name: Category
version: 1.0.0
identifier: categoryId
aggregateRoot: true
summary: Represents a product category with hierarchical structure support.
owners:
- dboyne
properties:
- name: categoryId
type: UUID
required: true
description: Unique identifier for the category
- name: name
type: string
required: true
description: Name of the category
- name: description
type: string
required: false
description: Description of the category
- name: slug
type: string
required: true
description: URL-friendly identifier for the category
- name: parentCategoryId
type: UUID
required: false
description: Parent category for hierarchical structure
references: Category
referencesIdentifier: categoryId
relationType: hasOne
- name: childCategories
type: array
items:
type: Category
required: false
description: Subcategories under this category
references: Category
referencesIdentifier: parentCategoryId
relationType: hasMany
- name: level
type: integer
required: true
description: Depth level in the category hierarchy (0 = root)
- name: isActive
type: boolean
required: true
description: Whether the category is currently active
- name: sortOrder
type: integer
required: false
description: Display order within the same level
- name: icon
type: string
required: false
description: Icon URL or identifier for the category
- name: imageUrl
type: string
required: false
description: Category banner or thumbnail image
- name: seoTitle
type: string
required: false
description: SEO-optimized title for the category page
- name: seoDescription
type: string
required: false
description: SEO meta description for the category page
- name: products
type: array
items:
type: Product
required: false
description: Products belonging to this category
references: Product
referencesIdentifier: categoryId
relationType: hasMany
- name: createdAt
type: DateTime
required: true
description: Date and time when the category was created
- name: updatedAt
type: DateTime
required: false
description: Date and time when the category was last updated
---
## Overview
The Category entity organizes products into a hierarchical structure, supporting multi-level categorization. It enables efficient product discovery and navigation through the e-commerce catalog.
### Entity Properties
## Relationships
- **Parent Category:** Each category can have one parent `Category` (identified by `parentCategoryId`).
- **Child Categories:** A category can have multiple child `Category` entities creating a hierarchy.
- **Products:** A category contains multiple `Product` entities (identified by `categoryId`).
## Hierarchy Examples
```
Electronics (Level 0)
├── Computers (Level 1)
│ ├── Laptops (Level 2)
│ ├── Desktops (Level 2)
│ └── Tablets (Level 2)
├── Mobile Phones (Level 1)
│ ├── Smartphones (Level 2)
│ └── Feature Phones (Level 2)
└── Audio (Level 1)
├── Headphones (Level 2)
└── Speakers (Level 2)
```
## Business Rules
- Root categories have `parentCategoryId` as null and `level` as 0
- Child categories must have a valid `parentCategoryId`
- Category slugs must be unique across the entire catalog
- Categories cannot be deleted if they contain products or subcategories
- Inactive categories should hide all associated products from public view
- Maximum hierarchy depth should be limited (e.g., 5 levels)
---
id: Customer
name: Customer
version: 1.0.0
identifier: customerId
summary: Represents an individual or organization that places orders.
owners:
- dboyne
properties:
- name: customerId
type: UUID
required: true
description: Unique identifier for the customer
- name: firstName
type: string
required: true
description: Customer's first name
- name: lastName
type: string
required: true
description: Customer's last name
- name: email
type: string
required: true
description: Customer's primary email address (unique)
- name: phone
type: string
required: false
description: Customer's phone number
- name: addresses
type: array
items:
type: Address # Assuming an Address value object or entity exists
required: false
description: List of addresses associated with the customer (e.g., shipping, billing)
- name: dateRegistered
type: DateTime
required: true
description: Date and time when the customer registered
---
## Overview
The Customer entity holds information about the individuals or organizations who interact with the system, primarily by placing orders. It stores contact details, addresses, and other relevant personal or business information.
### Entity Properties
## Relationships
- **Order:** A customer can have multiple `Order` entities. The `Order` entity holds a reference (`customerId`) back to the `Customer`.
- **Address:** A customer can have multiple associated `Address` value objects or entities.
## Examples
- **Customer A:** Jane Doe, registered on 2023-01-15, with a primary shipping address and a billing address.
- **Customer B:** John Smith, a long-time customer with multiple past orders.
---
id: Inventory
name: Inventory
version: 1.0.0
identifier: inventoryId
summary: Tracks stock levels and availability for products.
owners:
- dboyne
properties:
- name: inventoryId
type: UUID
required: true
description: Unique identifier for the inventory record
- name: productId
type: UUID
required: true
description: Product this inventory record tracks
references: Product
referencesIdentifier: productId
relationType: hasOne
- name: sku
type: string
required: true
description: Stock Keeping Unit matching the product SKU
- name: quantityOnHand
type: integer
required: true
description: Current available stock quantity
- name: quantityReserved
type: integer
required: true
description: Quantity reserved for pending orders
- name: quantityAvailable
type: integer
required: true
description: Calculated available quantity (onHand - reserved)
- name: minimumStockLevel
type: integer
required: true
description: Minimum stock level before reorder alert
- name: maximumStockLevel
type: integer
required: false
description: Maximum stock level for inventory management
- name: reorderPoint
type: integer
required: true
description: Stock level that triggers reorder process
- name: reorderQuantity
type: integer
required: true
description: Quantity to order when restocking
- name: unitCost
type: decimal
required: false
description: Cost per unit for inventory valuation
- name: warehouseLocation
type: string
required: false
description: Physical location or bin where item is stored
- name: lastRestockedAt
type: DateTime
required: false
description: Date and time of last restock
- name: lastSoldAt
type: DateTime
required: false
description: Date and time of last sale
- name: isTrackingEnabled
type: boolean
required: true
description: Whether inventory tracking is enabled for this product
- name: backorderAllowed
type: boolean
required: true
description: Whether backorders are allowed when out of stock
- name: createdAt
type: DateTime
required: true
description: Date and time when the inventory record was created
- name: updatedAt
type: DateTime
required: false
description: Date and time when the inventory record was last updated
---
## Overview
The Inventory entity manages stock levels and availability for products in the e-commerce system. It tracks current quantities, reserved stock, and provides reorder management capabilities.
### Entity Properties
## Relationships
- **Product:** Each inventory record belongs to one `Product` (identified by `productId`).
- **OrderItem:** Inventory quantities are affected by `OrderItem` entities when orders are placed.
## Stock Calculations
- **Available Quantity** = Quantity On Hand - Quantity Reserved
- **Reorder Needed** = Quantity Available <= Reorder Point
- **Stock Value** = Quantity On Hand × Unit Cost
## Examples
- **Inventory #1:** iPhone 15 Pro - 25 on hand, 5 reserved, 20 available, reorder at 10 units.
- **Inventory #2:** Running Shoes Size 9 - 0 on hand, 2 reserved, backorder allowed.
## Business Rules
- Quantity on hand cannot be negative
- Quantity reserved cannot exceed quantity on hand
- Available quantity is automatically calculated
- Reorder alerts are triggered when available = reorder point
- Stock reservations are created when orders are placed
- Stock is decremented when orders are shipped
- Inventory adjustments must be logged for audit trail
---
id: Invoice
name: Invoice
version: 1.0.0
identifier: invoiceId
summary: Represents a bill issued to a customer, detailing charges for products or services.
owners:
- dboyne
properties:
- name: invoiceId
type: UUID
required: true
description: Unique identifier for the invoice.
- name: customerId
type: UUID
required: true
description: Identifier of the customer being invoiced
references: Customer
relationType: hasOne
- name: orderId # Optional, if invoice is directly tied to a single order
type: UUID
required: false
description: Identifier of the associated order, if applicable.
- name: subscriptionId # Optional, if invoice is for a subscription period
type: UUID
required: false
description: Identifier of the associated subscription, if applicable.
- name: invoiceNumber
type: string
required: true
description: Human-readable, sequential identifier for the invoice (may have specific format).
- name: issueDate
type: Date
required: true
description: Date the invoice was generated and issued.
- name: dueDate
type: Date
required: true
description: Date by which the payment for the invoice is due.
- name: totalAmount
type: decimal
required: true
description: The total amount due on the invoice.
- name: currency
type: string # ISO 4217 code
required: true
description: Currency of the invoice amount.
- name: status
type: string # (e.g., Draft, Sent, Paid, Overdue, Void)
required: true
description: Current status of the invoice.
- name: billingAddressId # Address used for this specific invoice
type: UUID
required: true
description: Identifier for the billing address used on this invoice.
- name: lineItems
type: array
items:
type: InvoiceLineItem # Assuming a value object or separate entity for line items
required: true
description: List of individual items or services being charged on the invoice.
- name: createdAt
type: DateTime
required: true
description: Timestamp when the invoice record was created.
- name: paidAt # Timestamp when payment was confirmed
type: DateTime
required: false
description: Timestamp when the invoice was marked as paid.
---
## Overview
The Invoice entity represents a formal request for payment issued by the business to a customer. It details the products, services, quantities, prices, taxes, and total amount due, along with payment terms.
### Entity Properties
## Relationships
- **Customer:** An invoice is issued to one `Customer`.
- **Order/Subscription:** An invoice may be related to one or more `Order`s or a specific `Subscription` period.
- **Payment:** An invoice is settled by one or more `Payment` transactions.
- **InvoiceLineItem:** An invoice contains multiple `InvoiceLineItem`s detailing the charges.
- **BillingProfile:** Invoice generation often uses details from the customer's `BillingProfile`.
## Examples
- Invoice #INV-00123 issued to Jane Doe for her monthly subscription renewal, due in 15 days.
- Invoice #INV-00124 issued to Acme Corp for consulting services rendered in the previous month, status Paid.
---
id: Order
name: Order
version: 1.0.0
identifier: orderId
aggregateRoot: true
summary: Represents a customer's request to purchase products or services.
owners:
- dboyne
properties:
- name: orderId
type: UUID
required: true
description: Unique identifier for the order
- name: orderNumber
type: string
required: true
description: Unique identifier for the order
- name: customerId
type: UUID
required: false
description: Identifier for the customer placing the order test
references: Customer
referencesIdentifier: customerId
relationType: hasOne
- name: orderDate
type: DateTime
required: true
description: Date and time when the order was placed
- name: status
type: string
required: true
description: Current status of the order (e.g., Pending, Processing, Shipped, Delivered, Cancelled)
enum: ['Pending', 'Processing', 'Shipped', 'Delivered', 'Cancelled']
- name: orderItems
type: array
items:
type: OrderItem # Assuming an OrderItem entity exists
required: true
references: OrderItem
referencesIdentifier: orderItemId
relationType: hasMany
description: List of items included in the order
- name: totalAmount
type: decimal
required: true
description: Total monetary value of the order
- name: shippingAddress
type: Address
required: true
description: Address where the order should be shipped
references: Address
referencesIdentifier: addressId
relationType: hasOne
- name: billingAddress
type: Address
required: true
description: Address for billing purposes
references: Address
referencesIdentifier: addressId
relationType: hasOne
- name: payment
type: Payment
required: false
description: Payment associated with this order
references: Payment
referencesIdentifier: orderId
relationType: hasOne
- name: convertedFromCartId
type: UUID
required: false
description: Shopping cart that was converted to this order
references: ShoppingCart
referencesIdentifier: cartId
relationType: hasOne
---
## Overview
The Order entity captures all details related to a customer's purchase request. It serves as the central aggregate root within the Orders domain, coordinating information about the customer, products ordered, payment, and shipping.
### Entity Properties
## Relationships
- **Customer:** Each order belongs to one `Customer` (identified by `customerId`).
- **OrderItem:** An order contains one or more `OrderItem` entities detailing the specific products and quantities.
- **Address:** Each order has shipping and billing `Address` entities (identified by `shippingAddress` and `billingAddress`).
- **Payment:** An order is associated with one `Payment` entity for transaction processing.
- **ShoppingCart:** An order can be converted from a `ShoppingCart` (identified by `convertedFromCartId`).
- **Shipment:** An order may lead to one or more `Shipment` entities (not detailed here).
## Examples
- **Order #12345:** A customer orders 2 units of Product A and 1 unit of Product B, to be shipped to their home address. Status is 'Processing'.
- **Order #67890:** A customer places a large order for multiple items, requiring special shipping arrangements. Status is 'Pending' until payment confirmation.
---
id: OrderItem
name: OrderItem
version: 1.0.0
identifier: orderItemId
summary: Represents a single item within a customer's order.
owners:
- dboyne
properties:
- name: orderItemId
type: UUID
required: true
description: Unique identifier for the order item
- name: orderId
type: UUID
required: true
description: Identifier for the parent Order
references: Order
relationType: hasOne
- name: productId
type: UUID
required: true
description: Identifier for the product being ordered
references: Product
referencesIdentifier: productId
relationType: hasOne
- name: productName
type: string
required: false # Often denormalized for performance/display
description: Name of the product at the time of order
- name: quantity
type: integer
required: true
description: Number of units of the product ordered
- name: unitPrice
type: decimal
required: true
description: Price per unit of the product at the time of order
- name: totalPrice
type: decimal
required: true
description: Total price for this item line (quantity * unitPrice)
---
## Overview
The OrderItem entity details a specific product and its quantity requested within an `Order`. It holds information about the product, the quantity ordered, and the price calculation for that line item. OrderItems are part of the `Order` aggregate.
### Entity Properties
## Relationships
- **Order:** Each `OrderItem` belongs to exactly one `Order` (identified by `orderId`). It is a constituent part of the Order aggregate.
- **Product:** Each `OrderItem` refers to one `Product` (identified by `productId`).
## Examples
- **OrderItem A (for Order #12345):** Product ID: P001, Quantity: 2, Unit Price: $50.00, Total Price: $100.00
- **OrderItem B (for Order #12345):** Product ID: P002, Quantity: 1, Unit Price: $75.00, Total Price: $75.00
---
id: Payment
name: Payment
version: 1.0.0
identifier: paymentId
aggregateRoot: true
summary: Represents payment transactions for orders in the e-commerce system.
owners:
- dboyne
properties:
- name: paymentId
type: UUID
required: true
description: Unique identifier for the payment
- name: orderId
type: UUID
required: true
description: Order this payment is associated with
references: Order
referencesIdentifier: orderId
relationType: hasOne
- name: customerId
type: UUID
required: true
description: Customer who made the payment
references: Customer
referencesIdentifier: customerId
relationType: hasOne
- name: amount
type: decimal
required: true
description: Payment amount
- name: currency
type: string
required: true
description: Currency code (e.g., USD, EUR, GBP)
- name: paymentMethod
type: string
required: true
description: Payment method used
enum: ['credit_card', 'debit_card', 'paypal', 'stripe', 'bank_transfer', 'apple_pay', 'google_pay']
- name: paymentMethodDetails
type: object
required: false
description: Additional payment method specific details
properties:
- name: cardLast4
type: string
description: Last 4 digits of card number
- name: cardType
type: string
description: Card type (Visa, MasterCard, etc.)
- name: expiryMonth
type: integer
description: Card expiry month
- name: expiryYear
type: integer
description: Card expiry year
- name: status
type: string
required: true
description: Current payment status
enum: ['pending', 'processing', 'completed', 'failed', 'cancelled', 'refunded', 'partially_refunded']
- name: transactionId
type: string
required: false
description: External payment processor transaction ID
- name: gatewayResponse
type: object
required: false
description: Raw response from payment gateway
- name: billingAddress
type: Address
required: true
description: Billing address for the payment
references: Address
referencesIdentifier: addressId
relationType: hasOne
- name: processedAt
type: DateTime
required: false
description: Date and time when payment was processed
- name: failureReason
type: string
required: false
description: Reason for payment failure if applicable
- name: refunds
type: array
items:
type: PaymentRefund
required: false
description: Refunds associated with this payment
- name: createdAt
type: DateTime
required: true
description: Date and time when the payment record was created
- name: updatedAt
type: DateTime
required: false
description: Date and time when the payment record was last updated
---
## Overview
The Payment entity manages all payment transactions in the e-commerce system. It tracks payment details, status, and relationships with orders and customers, supporting various payment methods and refund scenarios.
### Entity Properties
## Relationships
- **Order:** Each payment belongs to one `Order` (identified by `orderId`).
- **Customer:** Each payment is made by one `Customer` (identified by `customerId`).
- **Address:** Each payment has a billing `Address` (identified by `billingAddress`).
- **PaymentRefund:** A payment can have multiple `PaymentRefund` entities for partial or full refunds.
## Payment States
```
pending → processing → completed
↓ ↓ ↓
cancelled failed refunded/partially_refunded
```
## Examples
- **Payment #1:** $299.99 credit card payment for Order #12345, completed successfully.
- **Payment #2:** $150.00 PayPal payment for Order #67890, failed due to insufficient funds.
- **Payment #3:** $500.00 bank transfer, completed with $50.00 partial refund.
## Business Rules
- Payment amount must match the order total
- Payment status transitions must follow valid state machine
- Failed payments should include failure reason
- Completed payments cannot be cancelled
- Refunds cannot exceed the original payment amount
- Payment method details are encrypted and PCI compliant
- Transaction IDs from payment gateways must be stored for reconciliation
---
id: PaymentMethod
name: PaymentMethod
version: 1.0.0
identifier: paymentMethodId
summary: Represents a payment instrument a customer can use, like a credit card or bank account.
owners:
- dboyne
properties:
- name: paymentMethodId
type: UUID
required: true
description: Unique identifier for the payment method.
- name: customerId
type: UUID
required: true
description: Identifier of the customer who owns this payment method.
references: Customer
relationType: hasOne
- name: type
type: string # (e.g., CreditCard, BankAccount, PayPal, ApplePay)
required: true
description: The type of payment method.
- name: details # Contains type-specific details (masked, tokenized)
type: object
required: true
description: Contains type-specific, often sensitive details (e.g., last 4 digits of card, card brand, bank name, account type, token). **Never store raw PANs or sensitive data.**
# Example structure for CreditCard:
# details:
# brand: "Visa"
# last4: "1234"
# expiryMonth: 12
# expiryYear: 2025
# cardholderName: "Jane Doe"
# gatewayToken: "tok_abc123xyz"
- name: isDefault
type: boolean
required: true
description: Indicates if this is the customer's default payment method.
- name: billingAddressId # Link to the billing address associated with this method
type: UUID
required: true
description: Identifier for the billing address verified for this payment method.
- name: status
type: string # (e.g., Active, Expired, Invalid, Removed)
required: true
description: Current status of the payment method.
- name: createdAt
type: DateTime
required: true
description: Timestamp when the payment method was added.
- name: updatedAt
type: DateTime
required: true
description: Timestamp when the payment method was last updated.
---
## Overview
The PaymentMethod entity represents a specific payment instrument registered by a customer, such as a credit card or a linked bank account. It stores necessary (non-sensitive) details required to initiate payments and links to the associated customer and billing address.
**Security Note:** Sensitive details like full card numbers or bank account numbers should **never** be stored directly. Rely on tokenization provided by payment gateways.
### Entity Properties
## Relationships
- **Customer:** A payment method belongs to one `Customer`.
- **Address:** Linked to a specific billing `Address`.
- **Payment:** Used to make `Payment` transactions.
- **Subscription:** May be designated as the payment method for a `Subscription`.
## Examples
- Jane Doe's default Visa card ending in 1234, expiring 12/2025, status Active.
- John Smith's linked bank account (Chase, Checking), status Active.
- An old MasterCard ending in 5678 belonging to Jane Doe, status Expired.
---
id: Product
name: Product
version: 1.0.0
identifier: productId
aggregateRoot: true
summary: Represents a product or service available for purchase in the e-commerce system.
owners:
- dboyne
properties:
- name: productId
type: UUID
required: true
description: Unique identifier for the product
- name: name
type: string
required: true
description: Name of the product
- name: description
type: string
required: false
description: Detailed description of the product
- name: sku
type: string
required: true
description: Stock Keeping Unit - unique product identifier
- name: price
type: decimal
required: true
description: Current selling price of the product
- name: categoryId
type: UUID
required: true
description: Category this product belongs to
references: Category
referencesIdentifier: categoryId
relationType: hasOne
- name: brand
type: string
required: false
description: Brand name of the product
- name: weight
type: decimal
required: false
description: Weight of the product in kilograms
- name: dimensions
type: object
required: false
description: Product dimensions (length, width, height)
properties:
- name: length
type: decimal
- name: width
type: decimal
- name: height
type: decimal
- name: isActive
type: boolean
required: true
description: Whether the product is currently available for sale
- name: createdAt
type: DateTime
required: true
description: Date and time when the product was created
- name: updatedAt
type: DateTime
required: false
description: Date and time when the product was last updated
- name: images
type: array
items:
type: string
required: false
description: URLs of product images
- name: inventory
type: Inventory
required: false
description: Inventory information for this product
references: Inventory
referencesIdentifier: productId
relationType: hasOne
- name: reviews
type: array
items:
type: Review
required: false
description: Customer reviews for this product
references: Review
referencesIdentifier: productId
relationType: hasMany
---
## Overview
The Product entity represents items or services available for purchase in the e-commerce system. It serves as an aggregate root containing all product-related information including pricing, categorization, inventory details, and customer reviews.
### Entity Properties
## Relationships
- **Category:** Each product belongs to one `Category` (identified by `categoryId`).
- **Inventory:** Each product has one `Inventory` record tracking stock levels.
- **Review:** A product can have multiple `Review` entities from customers.
- **OrderItem:** Products are referenced in `OrderItem` entities when included in orders.
## Examples
- **Product #1:** "iPhone 15 Pro" - Electronics category, $999.99, with 50 units in stock and 4.5-star reviews.
- **Product #2:** "Running Shoes" - Sports category, $129.99, various sizes available, with detailed size chart.
## Business Rules
- Products must have a unique SKU across the entire catalog
- Products cannot be deleted if they have associated order items
- Price changes should be tracked for audit purposes
- Products must belong to an active category to be purchasable
---
id: Review
name: Review
version: 1.0.0
identifier: reviewId
summary: Represents customer reviews and ratings for products.
owners:
- dboyne
properties:
- name: reviewId
type: UUID
required: true
description: Unique identifier for the review
- name: productId
type: UUID
required: true
description: Product being reviewed
references: Product
referencesIdentifier: productId
relationType: hasOne
- name: customerId
type: UUID
required: true
description: Customer who wrote the review
references: Customer
referencesIdentifier: customerId
relationType: hasOne
- name: orderId
type: UUID
required: false
description: Order associated with this review (for verified purchases)
references: Order
referencesIdentifier: orderId
relationType: hasOne
- name: rating
type: integer
required: true
description: Rating given by customer (1-5 stars)
minimum: 1
maximum: 5
- name: title
type: string
required: false
description: Review title or headline
- name: content
type: string
required: true
description: Review content and comments
- name: isVerifiedPurchase
type: boolean
required: true
description: Whether this review is from a verified purchase
- name: isRecommended
type: boolean
required: false
description: Whether customer recommends this product
- name: helpfulVotes
type: integer
required: true
description: Number of helpful votes received
- name: totalVotes
type: integer
required: true
description: Total number of votes received
- name: status
type: string
required: true
description: Current review status
enum: ['pending', 'approved', 'rejected', 'flagged']
- name: moderationNotes
type: string
required: false
description: Internal moderation notes
- name: images
type: array
items:
type: string
required: false
description: URLs of images uploaded with the review
- name: pros
type: array
items:
type: string
required: false
description: List of positive aspects mentioned
- name: cons
type: array
items:
type: string
required: false
description: List of negative aspects mentioned
- name: merchantResponse
type: object
required: false
description: Response from merchant to this review
properties:
- name: content
type: string
description: Merchant response content
- name: respondedAt
type: DateTime
description: When merchant responded
- name: respondedBy
type: string
description: Who responded for the merchant
- name: createdAt
type: DateTime
required: true
description: Date and time when the review was created
- name: updatedAt
type: DateTime
required: false
description: Date and time when the review was last updated
- name: moderatedAt
type: DateTime
required: false
description: Date and time when the review was moderated
---
## Overview
The Review entity captures customer feedback and ratings for products. It supports verified purchase validation, content moderation, community voting, and merchant responses to build trust and provide valuable product insights.
### Entity Properties
## Relationships
- **Product:** Each review belongs to one `Product` (identified by `productId`).
- **Customer:** Each review is written by one `Customer` (identified by `customerId`).
- **Order:** Each review can be linked to one `Order` for purchase verification (identified by `orderId`).
## Review Lifecycle
```
submitted → pending → approved → published
↓ ↓
rejected flagged
```
## Examples
- **Review #1:** 5-star review for iPhone 15 Pro, verified purchase, "Excellent camera quality!"
- **Review #2:** 3-star review for Running Shoes, helpful votes: 15/20, includes photos
- **Review #3:** 1-star review flagged for inappropriate content, pending moderation
## Business Rules
- Reviews can only be submitted by customers who purchased the product
- Rating must be between 1-5 stars
- Verified purchase reviews are given higher weight in calculations
- Inappropriate content is flagged and requires moderation
- Customers can only review the same product once per purchase
- Helpful votes help surface most valuable reviews
- Merchant responses are limited to one per review
- Reviews older than 2 years may have reduced weight in calculations
---
id: ShoppingCart
name: ShoppingCart
version: 1.0.0
identifier: cartId
aggregateRoot: true
summary: Represents a customer's shopping cart containing products before checkout.
owners:
- dboyne
properties:
- name: cartId
type: UUID
required: true
description: Unique identifier for the shopping cart
- name: customerId
type: UUID
required: false
description: Customer who owns this cart (null for guest carts)
references: Customer
referencesIdentifier: customerId
relationType: hasOne
- name: sessionId
type: string
required: false
description: Session identifier for guest carts
- name: status
type: string
required: true
description: Current status of the cart
enum: ['active', 'abandoned', 'converted', 'expired']
- name: cartItems
type: array
items:
type: CartItem
required: false
description: Items in the shopping cart
references: CartItem
referencesIdentifier: cartId
relationType: hasMany
- name: subtotal
type: decimal
required: true
description: Subtotal amount before taxes and shipping
- name: taxAmount
type: decimal
required: false
description: Calculated tax amount
- name: shippingAmount
type: decimal
required: false
description: Calculated shipping amount
- name: discountAmount
type: decimal
required: false
description: Total discount amount applied
- name: totalAmount
type: decimal
required: true
description: Final total amount including taxes and shipping
- name: currency
type: string
required: true
description: Currency code for all amounts
- name: appliedCoupons
type: array
items:
type: string
required: false
description: Coupon codes applied to this cart
- name: shippingAddress
type: Address
required: false
description: Selected shipping address
references: Address
referencesIdentifier: addressId
relationType: hasOne
- name: billingAddress
type: Address
required: false
description: Selected billing address
references: Address
referencesIdentifier: addressId
relationType: hasOne
- name: notes
type: string
required: false
description: Customer notes or special instructions
- name: abandonedAt
type: DateTime
required: false
description: Date and time when cart was abandoned
- name: convertedToOrderId
type: UUID
required: false
description: Order ID if cart was successfully converted
references: Order
referencesIdentifier: orderId
relationType: hasOne
- name: expiresAt
type: DateTime
required: false
description: Date and time when cart expires
- name: createdAt
type: DateTime
required: true
description: Date and time when the cart was created
- name: updatedAt
type: DateTime
required: false
description: Date and time when the cart was last updated
---
## Overview
The ShoppingCart entity manages the customer's shopping experience before checkout. It tracks selected products, quantities, pricing, and supports both registered customer and guest shopping scenarios.
### Entity Properties
## Relationships
- **Customer:** A cart can belong to one `Customer` (identified by `customerId`).
- **CartItem:** A cart contains multiple `CartItem` entities with product details.
- **Address:** A cart can reference shipping and billing `Address` entities.
- **Order:** A cart can be converted to one `Order` (identified by `convertedToOrderId`).
## Cart States
```
active → abandoned
↓ ↓
converted expired
```
## Examples
- **Cart #1:** Customer cart with 3 items, $299.99 total, active status.
- **Cart #2:** Guest cart abandoned after 24 hours, contains 1 high-value item.
- **Cart #3:** Converted cart that became Order #12345, marked as converted.
## Business Rules
- Guest carts are identified by session ID when customer ID is null
- Cart totals are recalculated when items are added/removed
- Abandoned carts trigger marketing automation after configured time
- Expired carts are cleaned up after retention period
- Cart conversion creates an order and marks cart as converted
- Inventory is not reserved until checkout begins
- Applied coupons are validated on each cart update
- Cart items maintain snapshot of product prices at time of addition
---
id: SubscriptionPeriod
name: SubscriptionPeriod
version: 1.0.0
identifier: subscriptionPeriodId
summary: Represents a single billing cycle or interval within a subscription's lifetime.
owners:
- dboyne
properties:
- name: subscriptionPeriodId
type: UUID
required: true
description: Unique identifier for this specific subscription period.
- name: subscriptionId
type: UUID
required: true
description: Identifier of the parent Subscription this period belongs to.
- name: planId # Denormalized for easier lookup?
type: UUID
required: true
description: Identifier of the Plan active during this period
- name: startDate
type: Date
required: true
description: The start date of this billing period.
- name: endDate
type: Date
required: true
description: The end date of this billing period.
- name: invoiceId # Optional, links to the invoice generated for this period
type: UUID
required: false
description: Identifier of the invoice created for this period's charge.
- name: paymentId # Optional, links to the payment made for this period's invoice
type: UUID
required: false
description: Identifier of the payment that settled the invoice for this period.
- name: status
type: string # (e.g., Active, Billed, Paid, Unpaid, PastDue)
required: true
description: Status specific to this period (reflects invoicing/payment state).
- name: amountBilled
type: decimal
required: false # May only be set once invoiced
description: The actual amount billed for this period (could differ from plan due to promotions, usage, etc.).
- name: currency
type: string # ISO 4217 code
required: false
description: Currency of the billed amount.
- name: createdAt
type: DateTime
required: true
description: Timestamp when this period record was created (often at the start of the period).
---
## Overview
The SubscriptionPeriod entity tracks the state and details of a specific billing cycle within a `Subscription`. It links the subscription to the relevant invoice and payment for that interval and records the exact dates and amount billed.
### Entity Properties
## Relationships
- **Subscription:** A subscription period belongs to one `Subscription`.
- **Plan:** Reflects the `Plan` active during this period.
- **Invoice:** May be associated with one `Invoice` generated for this period.
- **Payment:** May be associated with one `Payment` that settled the period's invoice.
## Examples
- Period for Jane Doe's 'Pro Plan' from 2024-05-01 to 2024-05-31, invoiced via #INV-00123, status Paid.
- Period for Acme Corp's 'Enterprise Plan' from 2024-04-15 to 2024-05-14, status Billed, awaiting payment.
- The first period (trial) for a new subscription from 2024-05-20 to 2024-06-19, status Active, amountBilled $0.00.
---
id: Transaction
name: Transaction
version: 1.0.0
identifier: transactionId
summary: Represents a low-level interaction with a payment gateway or processor (e.g., authorize, capture, refund, void).
owners:
- dboyne
properties:
- name: transactionId
type: UUID
required: true
description: Unique identifier for this specific gateway transaction.
- name: paymentId
type: UUID
required: true
references: Payment
relationType: hasOne
description: Identifier of the parent Payment this transaction belongs to.
- name: type
type: string # (e.g., Authorize, Capture, Sale, Refund, Void, Verify)
required: true
description: The type of operation performed with the payment gateway.
- name: gatewayReferenceId
type: string
required: true
description: Unique transaction ID provided by the external payment gateway.
- name: amount
type: decimal
required: true
description: The amount associated with this specific transaction operation.
- name: currency
type: string # ISO 4217 code
required: true
description: Currency of the transaction amount.
- name: status
type: string # (e.g., Success, Failure, Pending)
required: true
description: Status reported by the gateway for this specific operation.
- name: responseCode # Gateway-specific code
type: string
required: false
description: Response code returned by the payment gateway.
- name: responseMessage # Gateway-specific message
type: string
required: false
description: Detailed message or reason returned by the gateway.
- name: processedAt
type: DateTime
required: true
description: Timestamp when the transaction was processed by the gateway.
- name: rawRequest # Optional, for debugging - consider security implications
type: text
required: false
description: Raw request payload sent to the gateway (use with caution).
- name: rawResponse # Optional, for debugging - consider security implications
type: text
required: false
description: Raw response payload received from the gateway (use with caution).
---
## Overview
The Transaction entity logs the individual interactions with an external payment processor (like Stripe, PayPal, Adyen) that occur as part of processing a `Payment`. This provides a detailed audit trail of gateway operations, including authorizations, captures, refunds, and any associated success or failure responses.
### Entity Properties
## Relationships
- **Payment:** A transaction is part of one `Payment`.
## Examples
- **Authorization Success:** Type: Authorize, PaymentID: PAY-98765, GatewayRef: auth_abc, Amount: $19.99, Status: Success.
- **Capture Success:** Type: Capture, PaymentID: PAY-98765, GatewayRef: ch_def, Amount: $19.99, Status: Success (following the authorization).
- **Authorization Failure:** Type: Authorize, PaymentID: PAY-98766, GatewayRef: auth_ghi, Amount: $50.00, Status: Failure, ResponseCode: 'declined', ResponseMessage: 'Insufficient Funds'.
- **Refund Success:** Type: Refund, PaymentID: PAY-98760, GatewayRef: re_jkl, Amount: $25.00, Status: Success.
---
id: inventory-dlq
name: Inventory DLQ
version: 0.0.1
summary: |
Dead Letter Queue for inventory events
owners:
- dboyne
---
## Overview
The Inventory DLQ is a dead letter queue for inventory events. It is used to store inventory events that are not yet processed.
---
id: inventory-queue
name: Inventory Queue
version: 0.0.1
summary: |
Queue for inventory events
owners:
- dboyne
---
## Overview
The Inventory Queue is a queue for inventory events. It is used to store inventory events that are not yet processed.
---
id: inventory.{env}.events
name: Inventory Events Channel
version: 1.0.0
summary: |
Central event stream for all inventory-related events including stock updates, allocations, and adjustments
owners:
- dboyne
address: inventory.{env}.events
protocols:
- kafka
parameters:
env:
enum:
- dev
- sit
- prod
description: 'Environment to use'
---
### Overview
The Inventory Events channel is the central stream for all inventory-related events across the system. This includes stock level changes, inventory allocations, adjustments, and stocktake events. Events for a specific SKU are guaranteed to be processed in sequence when using productId as the partition key.
### Publishing and Subscribing to Events
#### Publishing Example
```python
from kafka import KafkaProducer
import json
from datetime import datetime
# Kafka configuration
bootstrap_servers = ['localhost:9092']
topic = f'inventory.{env}.events'
# Create a Kafka producer
producer = KafkaProducer(
bootstrap_servers=bootstrap_servers,
value_serializer=lambda v: json.dumps(v).encode('utf-8')
)
# Example inventory update event
inventory_event = {
"eventType": "STOCK_LEVEL_CHANGED",
"timestamp": datetime.utcnow().isoformat(),
"version": "1.0",
"payload": {
"productId": "PROD-456",
"locationId": "WH-123",
"previousQuantity": 100,
"newQuantity": 95,
"changeReason": "ORDER_FULFILLED",
"unitOfMeasure": "EACH",
"batchInfo": {
"batchId": "BATCH-789",
"expiryDate": "2025-12-31"
}
},
"metadata": {
"source": "warehouse_system",
"correlationId": "inv-xyz-123",
"userId": "john.doe"
}
}
# Send the message - using productId as key for partitioning
producer.send(
topic,
key=inventory_event['payload']['productId'].encode('utf-8'),
value=inventory_event
)
producer.flush()
print(f"Inventory event sent to topic {topic}")
```
### Subscription example
```python
from kafka import KafkaConsumer
import json
from datetime import datetime
class InventoryEventConsumer:
def __init__(self):
# Kafka configuration
self.topic = f'inventory.{env}.events'
self.consumer = KafkaConsumer(
self.topic,
bootstrap_servers=['localhost:9092'],
group_id='inventory-processor-group',
auto_offset_reset='earliest',
enable_auto_commit=False,
value_deserializer=lambda x: json.loads(x.decode('utf-8')),
key_deserializer=lambda x: x.decode('utf-8') if x else None
)
def process_event(self, event):
"""Process individual inventory events based on type"""
event_type = event.get('eventType')
if event_type == 'STOCK_LEVEL_CHANGED':
self.handle_stock_level_change(event)
elif event_type == 'LOW_STOCK_ALERT':
self.handle_low_stock_alert(event)
# Add more event type handlers as needed
def handle_stock_level_change(self, event):
"""Handle stock level change events"""
payload = event['payload']
print(f"Stock level change detected for product {payload['productId']}")
print(f"New quantity: {payload['newQuantity']}")
# Add your business logic here
def handle_low_stock_alert(self, event):
"""Handle low stock alert events"""
payload = event['payload']
print(f"Low stock alert for product {payload['productId']}")
print(f"Current quantity: {payload['currentQuantity']}")
# Add your business logic here
def start_consuming(self):
"""Start consuming messages from the topic"""
try:
print(f"Starting consumption from topic: {self.topic}")
for message in self.consumer:
try:
# Process the message
event = message.value
print(f"Received event: {event['eventType']} for product: {event['payload']['productId']}")
# Process the event
self.process_event(event)
# Commit the offset after successful processing
self.consumer.commit()
except Exception as e:
print(f"Error processing message: {str(e)}")
# Implement your error handling logic here
# You might want to send to a DLQ (Dead Letter Queue)
except Exception as e:
print(f"Consumer error: {str(e)}")
finally:
# Clean up
self.consumer.close()
if __name__ == "__main__":
# Create and start the consumer
consumer = InventoryEventConsumer()
consumer.start_consuming()
```
---
id: orders.{env}.events
name: Order Events Channel
version: 1.0.1
summary: |
Central event stream for all order-related events in the order processing lifecycle
owners:
- dboyne
address: orders.{env}.events
protocols:
- kafka
routes:
- id: inventory-queue
parameters:
env:
enum:
- dev
- sit
- prod
description: 'Environment to use'
---
### Overview
The Orders Events channel is the central stream for all order-related events across the order processing lifecycle. This includes order creation, updates, payment status, fulfillment status, and customer communications. All events related to a specific order are guaranteed to be processed in sequence when using orderId as the partition key.
### Publishing a message using Kafka
Here is an example of how to publish an order event using Kafka:
```python
from kafka import KafkaProducer
import json
from datetime import datetime
# Kafka configuration
bootstrap_servers = ['localhost:9092']
topic = f'orders.{env}.events'
# Create a Kafka producer
producer = KafkaProducer(
bootstrap_servers=bootstrap_servers,
value_serializer=lambda v: json.dumps(v).encode('utf-8')
)
# Example order created event
order_event = {
"eventType": "ORDER_CREATED",
"timestamp": datetime.utcnow().isoformat(),
"version": "1.0",
"payload": {
"orderId": "12345",
"customerId": "CUST-789",
"items": [
{
"productId": "PROD-456",
"quantity": 2,
"price": 29.99
}
],
"totalAmount": 59.98,
"shippingAddress": {
"street": "123 Main St",
"city": "Springfield",
"country": "US"
}
},
"metadata": {
"source": "web_checkout",
"correlationId": "abc-xyz-123"
}
}
# Send the message - using orderId as key for partitioning
producer.send(
topic,
key=order_event['payload']['orderId'].encode('utf-8'),
value=order_event
)
producer.flush()
print(f"Order event sent to topic {topic}")
```
---
id: payments.{env}.events
name: Payment Events Channel
version: 1.0.0
summary: |
All events contain payment ID for traceability and ordered processing.
owners:
- dboyne
address: payments.{env}.events
protocols:
- kafka
parameters:
env:
enum:
- dev
- sit
- prod
description: 'Environment to use for payment events'
---
### Overview
The Payments Events channel is the central stream for all payment lifecycle events. This includes payment initiation, authorization, capture, completion and failure scenarios. Events for a specific payment are guaranteed to be processed in sequence when using paymentId as the partition key.
### Publishing Events Using Kafka
Here's an example of publishing a payment event:
```python
from kafka import KafkaProducer
import json
from datetime import datetime
# Kafka configuration
bootstrap_servers = ['localhost:9092']
topic = f'payments.{env}.events'
# Create Kafka producer
producer = KafkaProducer(
bootstrap_servers=bootstrap_servers,
value_serializer=lambda v: json.dumps(v).encode('utf-8')
)
# Example payment processed event
payment_event = {
"eventType": "PAYMENT_PROCESSED",
"timestamp": datetime.utcnow().isoformat(),
"version": "1.0",
"payload": {
"paymentId": "PAY-123-456",
"orderId": "ORD-789",
"amount": {
"value": 99.99,
"currency": "USD"
},
"status": "SUCCESS",
"paymentMethod": {
"type": "CREDIT_CARD",
"last4": "4242",
"expiryMonth": "12",
"expiryYear": "2025",
"network": "VISA"
},
"transactionDetails": {
"processorId": "stripe_123xyz",
"authorizationCode": "AUTH123",
"captureId": "CAP456"
}
},
"metadata": {
"correlationId": "corr-123-abc",
"merchantId": "MERCH-456",
"source": "payment_service",
"environment": "prod",
"idempotencyKey": "PAY-123-456-2024-11-11-99.99"
}
}
# Send message - using paymentId as key for partitioning
producer.send(
topic,
key=payment_event['payload']['paymentId'].encode('utf-8'),
value=payment_event
)
producer.flush()
```
---
id: OnboardingSqlServer
name: Onboarding SQL Server
version: 1.0.0
summary: Banco de dados que persiste os dados das contas criadas durante o onboarding.
container_type: database
technology: SQL Server
classification: internal
owners:
- full-stack
---
## Visão geral
O Onboarding SQL Server armazena os dados retornados pela API Asaas após a criação de uma subconta.
---
id: 'CancelSubscription'
name: 'User Cancels Subscription'
version: '0.0.1'
summary: 'Flow for when a user has cancelled a subscription'
owners:
- dboyne
steps:
- id: 'cancel_subscription_initiated'
title: 'Cancels Subscription'
summary: 'User cancels their subscription'
actor:
name: 'User'
next_step:
id: 'cancel_subscription_request'
label: 'Initiate subscription cancellation'
- id: 'cancel_subscription_request'
title: 'Cancel Subscription'
message:
id: 'CancelSubscription'
version: '0.0.1'
next_step:
id: 'subscription_service'
label: 'Proceed to subscription service'
- id: 'stripe_integration'
title: 'Stripe'
externalSystem:
name: 'Stripe'
summary: '3rd party payment system'
url: 'https://stripe.com/'
next_step:
id: 'subscription_service'
label: 'Return to subscription service'
- id: 'subscription_service'
title: 'Subscription Service'
service:
id: 'SubscriptionService'
version: '0.0.1'
next_steps:
- id: 'stripe_integration'
label: 'Cancel subscription via Stripe'
- id: 'subscription_cancelled'
label: 'Successful cancellation'
- id: 'subscription_rejected'
label: 'Failed cancellation'
---
---
id: 'CancelSubscription'
name: 'User Cancels Subscription'
version: '1.0.0'
summary: 'Flow for when a user has cancelled a subscription'
owners:
- dboyne
steps:
- id: 'cancel_subscription_initiated'
title: 'Cancels Subscription'
summary: 'User cancels their subscription'
actor:
name: 'User'
next_step:
id: 'cancel_subscription_request'
label: 'Initiate subscription cancellation'
- id: 'cancel_subscription_request'
title: 'Cancel Subscription'
message:
id: 'CancelSubscription'
version: '0.0.1'
next_step:
id: 'subscription_service'
label: 'Proceed to subscription service'
- id: 'stripe_integration'
title: 'Stripe'
externalSystem:
name: 'Stripe'
summary: '3rd party payment system'
url: 'https://stripe.com/'
next_step:
id: 'subscription_service'
label: 'Return to subscription service'
- id: 'subscription_service'
title: 'Subscription Service'
service:
id: 'SubscriptionService'
version: '0.0.1'
next_steps:
- id: 'stripe_integration'
label: 'Cancel subscription via Stripe'
- id: 'subscription_cancelled'
label: 'Successful cancellation'
- id: 'subscription_rejected'
label: 'Failed cancellation'
- id: 'subscription_cancelled'
title: 'Subscription has been Cancelled'
message:
id: 'UserSubscriptionCancelled'
version: '0.0.1'
next_step:
id: 'notification_service'
label: 'Email customer'
- id: 'subscription_rejected'
title: 'Subscription cancellation has been rejected'
- id: 'notification_service'
title: 'Notifications Service'
service:
id: 'NotificationService'
version: '0.0.2'
---
---
id: PaymentFlow
name: Payment Flow for customers
version: 1.0.0
summary: Business flow for processing payments in an e-commerce platform
owners:
- dboyne
steps:
- id: 'customer_place_order'
title: Customer places order
next_step: 'place_order_request'
- id: 'place_order_request'
title: Place order
message:
id: PlaceOrder
version: 0.0.1
next_step:
id: 'payment_initiated'
label: Initiate payment
- id: 'payment_initiated'
title: Payment Initiated
message:
id: PaymentInitiated
version: 0.0.1
next_steps:
- 'payment_processed'
- 'payment_failed'
- id: 'payment_processed'
title: Payment Processed
message:
id: PaymentProcessed
version: 0.0.1
next_steps:
- id: 'adjust_inventory'
label: Adjust inventory
- id: 'send_custom_notification'
label: Notify customer
- id: 'payment_failed'
title: Payment Failed
type: node
next_steps:
- id: 'failure_notification'
label: Notify customer of failure
- id: 'retry_payment'
label: Retry payment
- id: 'adjust_inventory'
title: Inventory Adjusted
message:
id: InventoryAdjusted
version: 1.0.1
next_step:
id: 'payment_complete'
label: Complete order
- id: 'send_custom_notification'
title: Customer Notified of Payment
type: node
next_step:
id: 'payment_complete'
label: Complete order
- id: 'failure_notification'
title: Customer Notified of Failure
type: node
- id: 'retry_payment'
title: Retry Payment
type: node
next_step:
id: 'payment_initiated'
label: Retry payment process
- id: 'payment_complete'
title: Payment Complete
type: node
next_step:
id: 'order-complete'
label: Order completed
- id: 'order-complete'
title: Order Completed
type: node
---
### Flow of feature
---
id: 'SubscriptionRenewed'
name: 'Subscription Renewal Flow'
version: '1.0.0'
summary: 'Business flow for automatic subscription renewals and related processes'
steps:
- id: 'renewal_timer_triggered'
title: 'Renewal Period Reached'
custom:
title: 'Renewal Timer'
color: 'orange'
icon: 'ClockIcon'
type: 'Scheduler'
summary: 'Automated timer triggers the subscription renewal process'
height: 8
properties:
subscription_id: 'sub_12345678'
renewal_type: 'Automatic'
billing_cycle: 'Monthly'
next_billing_date: '2024-08-01'
menu:
- label: 'View scheduler configuration'
url: 'https://docs.example.com/scheduler'
- label: 'Subscription timing documentation'
url: 'https://docs.example.com/subscription-timing'
next_step:
id: 'check_subscription_status'
label: 'Verify subscription status'
- id: 'check_subscription_status'
title: 'Check Subscription Status'
service:
id: 'SubscriptionService'
version: '0.0.1'
next_steps:
- id: 'payment_approval_check'
label: 'Subscription active, proceed to payment'
- id: 'subscription_expired'
label: 'Subscription has expired'
- id: 'subscription_canceled'
label: 'Subscription was canceled'
- id: 'subscription_expired'
title: 'Subscription Expired'
type: 'node'
next_step:
id: 'send_renewal_notification'
label: 'Notify customer to renew'
- id: 'subscription_canceled'
title: 'Subscription Canceled'
type: 'node'
next_step:
id: 'send_reactivation_offer'
label: 'Send special reactivation offer'
- id: 'send_renewal_notification'
title: 'Send Renewal Notification'
service:
id: 'NotificationService'
version: '0.0.2'
next_step:
id: 'await_customer_action'
label: 'Wait for customer response'
- id: 'send_reactivation_offer'
title: 'Send Reactivation Offer'
service:
id: 'NotificationService'
version: '0.0.2'
next_step:
id: 'await_customer_action'
label: 'Wait for customer response'
- id: 'await_customer_action'
title: 'Await Customer Action'
custom:
title: 'Customer Decision Point'
color: 'purple'
icon: 'UserIcon'
type: 'Decision'
height: 8
summary: 'Waiting period for customer to take action on notification'
properties:
timeout_period: '7 days'
options: 'Renew, Upgrade, Cancel, Ignore'
next_steps:
- id: 'manual_renewal_flow'
label: 'Customer manually renews'
- id: 'flow_ends'
label: 'No action taken'
- id: 'manual_renewal_flow'
title: 'Manual Renewal Flow'
type: 'node'
next_step:
id: 'payment_initiated'
label: 'Process payment'
- id: 'payment_approval_check'
title: 'Check Payment Approval'
message:
id: 'GetPaymentStatus'
version: '0.0.1'
next_steps:
- id: 'payment_initiated'
label: 'Payment approved, proceed with billing'
- id: 'payment_method_invalid'
label: 'Invalid payment method'
- id: 'payment_method_invalid'
title: 'Invalid Payment Method'
type: 'node'
next_step:
id: 'request_payment_update'
label: 'Request updated payment method'
- id: 'request_payment_update'
title: 'Request Payment Update'
service:
id: 'NotificationService'
version: '0.0.2'
next_step:
id: 'await_updated_payment'
label: 'Wait for payment update'
- id: 'await_updated_payment'
title: 'Await Updated Payment Method'
actor:
name: 'Customer'
next_steps:
- id: 'payment_initiated'
label: 'Payment method updated'
- id: 'subscription_grace_period'
label: 'No update received'
- id: 'subscription_grace_period'
title: 'Grace Period'
custom:
title: 'Subscription Grace Period'
color: 'yellow'
icon: 'ShieldExclamationIcon'
type: 'Timer'
summary: 'Limited period where subscription remains active despite payment failure'
properties:
duration: '7 days'
status: 'At risk'
next_steps:
- id: 'payment_initiated'
label: 'Payment updated during grace period'
- id: 'subscription_suspended'
label: 'Grace period expired'
- id: 'subscription_suspended'
title: 'Subscription Suspended'
message:
id: 'UserSubscriptionCancelled'
version: '0.0.1'
next_step:
id: 'send_suspension_notification'
label: 'Notify customer of suspension'
- id: 'send_suspension_notification'
title: 'Send Suspension Notification'
service:
id: 'NotificationService'
version: '0.0.2'
next_step:
id: 'flow_ends'
label: 'Flow ends'
- id: 'payment_initiated'
title: 'Process Payment'
message:
id: 'PaymentInitiated'
version: '0.0.1'
next_step:
id: 'payment_gateway'
label: 'Send to payment gateway'
- id: 'payment_gateway'
title: 'Payment Gateway'
externalSystem:
name: 'Stripe'
summary: '3rd party payment processor'
url: 'https://stripe.com/'
next_steps:
- id: 'payment_processed'
label: 'Payment successful'
- id: 'payment_failed'
label: 'Payment failed'
- id: 'payment_failed'
title: 'Payment Failed'
type: 'node'
next_step:
id: 'retry_payment'
label: 'Retry payment'
- id: 'retry_payment'
title: 'Retry Payment'
custom:
title: 'Payment Retry Logic'
color: 'red'
icon: 'ArrowPathIcon'
type: 'Processor'
summary: 'Automated retry logic for failed payments'
properties:
max_attempts: 3
backoff_interval: '24 hours'
current_attempt: 1
next_steps:
- id: 'payment_initiated'
label: 'Retry payment'
- id: 'subscription_grace_period'
label: 'Max retries exceeded'
- id: 'payment_processed'
title: 'Payment Processed'
message:
id: 'PaymentProcessed'
version: '1.0.0'
next_step:
id: 'update_subscription_status'
label: 'Update subscription'
- id: 'update_subscription_status'
title: 'Update Subscription'
service:
id: 'SubscriptionService'
version: '0.0.1'
next_step:
id: 'send_renewal_confirmation'
label: 'Confirm renewal to customer'
- id: 'send_renewal_confirmation'
title: 'Send Renewal Confirmation'
service:
id: 'NotificationService'
version: '0.0.2'
next_step:
id: 'analyze_customer_usage'
label: 'Analyze customer usage patterns'
- id: 'analyze_customer_usage'
title: 'Analyze Usage Patterns'
custom:
title: 'Usage Analytics'
color: 'blue'
icon: 'ChartBarIcon'
type: 'Analytics'
summary: 'Analyze customer usage patterns to identify upsell opportunities'
properties:
metrics_analyzed: 'Feature usage, Resource consumption, Access patterns'
lookback_period: '90 days'
menu:
- label: 'View analytics dashboard'
url: 'https://analytics.example.com/subscriptions'
- label: 'Documentation'
url: 'https://docs.example.com/analytics'
next_steps:
- id: 'send_upgrade_recommendation'
label: 'Usage suggests upgrade opportunity'
- id: 'flow_ends'
label: 'No upgrade opportunity identified'
- id: 'send_upgrade_recommendation'
title: 'Send Upgrade Recommendation'
service:
id: 'NotificationService'
version: '0.0.2'
next_step:
id: 'flow_ends'
label: 'Flow completed'
- id: 'flow_ends'
title: 'Flow Completed'
type: 'node'
---
## Subscription Renewal Flow
This flow documents the process of automatic subscription renewals, including handling various edge cases such as payment failures, expired subscriptions, and customer interactions.
### Key Components
- **Automatic Renewal Process**: Triggered by a scheduled timer when the subscription renewal period is reached
- **Payment Processing**: Integration with payment gateway and handling of payment failures
- **Customer Notifications**: Various notifications sent throughout the process
- **Grace Period Handling**: Special handling when payments fail with a grace period before subscription suspension
- **Usage Analytics**: Analysis of customer usage patterns to identify upgrade opportunities
### Business Rules
1. Subscriptions are renewed automatically unless explicitly canceled
2. Failed payments trigger a retry process (up to 3 attempts)
3. Customers receive a 7-day grace period before subscription suspension
4. Usage patterns are analyzed to provide personalized upgrade recommendations
---
dictionary:
- id: Subscription
name: Subscription
summary: 'A recurring agreement where a customer pays for access to a product or service at regular intervals.'
description: |
A subscription represents an ongoing relationship between customer and provider. Key aspects include:
- Subscription plan details
- Billing frequency
- Access rights and limitations
- Start and end dates
- Auto-renewal settings
Subscriptions provide predictable revenue for businesses and convenient access for customers.
icon: Repeat
- id: Billing Cycle
name: Billing Cycle
summary: 'The recurring period for which a subscription is billed.'
description: |
Billing cycles define when payments are collected and services are provided. They include:
- Cycle duration (monthly, annually, etc.)
- Billing date
- Payment due dates
- Pro-ration rules
- Grace periods
Clear billing cycles help manage customer expectations and cash flow.
icon: Calendar
- id: Plan
name: Plan
summary: 'A specific subscription offering with defined features, pricing, and terms.'
description: |
Subscription plans define the service levels available to customers. They specify:
- Feature sets and limitations
- Pricing structure
- Billing frequency options
- Usage allowances
- Additional benefits
Well-designed plans cater to different customer segments and needs.
icon: Layout
- id: Trial Period
name: Trial Period
summary: 'A promotional period allowing customers to test a subscription service before committing.'
description: |
Trial periods help customers evaluate the service risk-free. They include:
- Duration of trial
- Available features
- Conversion process
- Payment information requirements
- Trial end notifications
Effective trials can increase conversion rates to paid subscriptions.
icon: Clock
- id: Auto-Renewal
name: Auto-Renewal
summary: 'Automatic continuation of a subscription at the end of each billing period.'
description: |
Auto-renewal ensures service continuity for customers. The process includes:
- Renewal notifications
- Payment processing
- Service extension
- Failed payment handling
- Cancellation options
Auto-renewal reduces churn and maintains steady revenue streams.
icon: RefreshCw
- id: Upgrade
name: Upgrade
summary: 'The process of moving to a higher-tier subscription plan.'
description: |
Upgrades allow customers to access more features or capacity. This involves:
- Plan comparison
- Pro-rated billing adjustments
- Feature activation
- Data migration if needed
- Service level changes
Smooth upgrade processes encourage customer growth.
icon: ArrowUpCircle
- id: Downgrade
name: Downgrade
summary: 'The process of moving to a lower-tier subscription plan.'
description: |
Downgrades adjust service levels to match customer needs. This includes:
- Feature reduction
- Billing adjustments
- Data retention policies
- Service level changes
- Customer retention strategies
Flexible downgrade options can prevent complete cancellations.
icon: ArrowDownCircle
- id: Cancellation
name: Cancellation
summary: 'The termination of a subscription service.'
description: |
Cancellation processes handle the end of subscription relationships. They cover:
- Notice periods
- Final billing
- Data retention/export
- Service access termination
- Reactivation options
Clear cancellation policies protect both customer and provider interests.
icon: XCircle
- id: Usage Limit
name: Usage Limit
summary: 'Restrictions on service usage within a subscription plan.'
description: |
Usage limits define the boundaries of service consumption. They include:
- Quantitative restrictions
- Monitoring systems
- Overage handling
- Alert mechanisms
- Upgrade triggers
Well-defined limits help manage resources and encourage appropriate plan selection.
icon: Gauge
---
---
dictionary:
- id: Payment
name: Payment
summary: 'The act of paying for magical goods or services.'
icon: Wand2
- id: Purchase Order
name: Purchase Order
summary: 'A mystical document issued by a buyer to a seller indicating the types, quantities, and agreed prices for enchanted products or services.'
description: |
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:
- Unique PO number for tracking
- Detailed item specifications and quantities
- Agreed prices and payment terms
- Delivery requirements and timelines
- Terms and conditions of the purchase
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.
icon: FileText
- id: Order Line
name: Order Line
summary: 'An individual enchanted item within a purchase order, representing a specific magical product or service being ordered.'
description: |
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:
- Product identifier (SKU or part number)
- Quantity ordered
- Unit price and total line value
- Special handling instructions
- Required delivery date
Order lines drive warehouse picking operations, shipping processes, and financial calculations. They are essential for tracking partial shipments and managing order modifications.
icon: ListOrdered
- id: SKU
name: SKU
summary: 'Sorcery Keeping Unit - A unique identifier for distinct magical products and their variants in inventory.'
description: |
SKUs are the cornerstone of effective inventory management systems. Each SKU represents a unique combination of product attributes:
- Product variations (size, color, style)
- Storage location identifiers
- Supplier information
- Reorder points and quantities
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.
icon: Tag
- id: Consignment
name: Consignment
summary: 'A batch of enchanted goods destined for or delivered to someone.'
description: |
A consignment represents the physical movement of goods through the supply chain. It encompasses all aspects of the shipping process:
- Packaging and labeling requirements
- Transportation method and routing
- Customs documentation for international shipments
- Tracking and proof of delivery
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.
icon: Package
- id: Invoice
name: Invoice
summary: 'A document issued by a seller to a buyer, listing enchanted goods or services provided and the amount due.'
description: |
Invoices are critical for financial transactions, serving as a request for payment from the buyer. They include:
- Invoice number for tracking
- List of products or services provided
- Total amount due and payment terms
- Seller and buyer contact information
- Due date for payment
Invoices are essential for accounting, tax purposes, and maintaining cash flow.
icon: Receipt
- id: Supplier
name: Supplier
summary: 'An entity that provides enchanted goods or services to another organization.'
description: |
Suppliers are key partners in the supply chain, responsible for delivering the necessary products or services. Key aspects include:
- Supplier identification and contact details
- Product or service offerings
- Pricing and payment terms
- Delivery schedules and reliability
Effective supplier management ensures quality, cost-effectiveness, and timely delivery.
icon: Truck
- id: Inventory
name: Inventory
summary: 'The complete list of enchanted items held in stock by a business.'
description: |
Inventory management is crucial for balancing supply and demand. It involves:
- Tracking stock levels and locations
- Managing reorder points and quantities
- Conducting regular stock audits
- Analyzing inventory turnover rates
Proper inventory management minimizes costs and maximizes service levels.
icon: Warehouse
- id: Fulfillment
name: Fulfillment
summary: 'The process of completing an order and delivering it to the customer.'
description: |
Fulfillment encompasses all steps from order receipt to delivery, including:
- Order processing and picking
- Packaging and shipping
- Delivery tracking and confirmation
- Handling returns and exchanges
Efficient fulfillment is key to customer satisfaction and operational efficiency.
icon: PackageCheck
- id: Return
name: Return
summary: 'The process of sending back enchanted goods to the seller for a refund or exchange.'
description: |
Returns management is an important aspect of customer service and inventory control. It involves:
- Processing return requests and authorizations
- Inspecting returned items for quality
- Restocking or disposing of returned goods
- Issuing refunds or exchanges
A streamlined returns process enhances customer loyalty and operational efficiency.
icon: PackageX
---
---
dictionary:
- id: Marketplace
name: Marketplace
summary: 'The digital platform where buyers and sellers interact to browse, purchase, and sell goods.'
description: |
The marketplace is FlowMart's core digital storefront, providing the infrastructure for all commerce activity. It encompasses:
- Product discovery and search capabilities
- Seller listings and buyer interactions
- Transaction facilitation and trust mechanisms
- Platform-wide policies and governance
icon: Store
- id: Checkout
name: Checkout
summary: 'The process by which a customer finalizes a purchase, providing payment and shipping details.'
description: |
Checkout is the critical conversion step where a browsing customer becomes a paying customer. The checkout flow includes:
- Cart review and item confirmation
- Shipping address and method selection
- Payment method selection and authorization
- Order confirmation and receipt generation
Optimizing the checkout experience is essential for reducing cart abandonment and increasing conversion rates.
icon: ShoppingCart
- id: Cart
name: Cart
summary: 'A temporary collection of items a customer intends to purchase.'
description: |
The shopping cart holds selected products before checkout. Key behaviors include:
- Adding and removing items
- Updating item quantities
- Applying discount codes and promotions
- Calculating subtotals, taxes, and shipping estimates
Carts may persist across sessions for authenticated customers and have configurable expiration policies.
icon: ShoppingBag
- id: Catalog
name: Catalog
summary: 'The complete collection of products available for sale on the marketplace.'
icon: BookOpen
- id: Customer
name: Customer
summary: 'An individual or organization that purchases goods or services from the marketplace.'
description: |
Customers are the primary consumers in the e-commerce domain. A customer profile includes:
- Account and identity information
- Order history and preferences
- Saved addresses and payment methods
- Loyalty status and rewards balance
Customers may be guests (unauthenticated) or registered account holders.
icon: User
- id: Storefront
name: Storefront
summary: 'The customer-facing presentation layer of the marketplace, including product pages, navigation, and branding.'
icon: Layout
- id: Promotion
name: Promotion
summary: 'A marketing incentive such as a discount, coupon, or special offer applied to products or orders.'
description: |
Promotions drive customer engagement and sales. Common promotion types include:
- Percentage or fixed-amount discounts
- Buy-one-get-one (BOGO) offers
- Free shipping thresholds
- Time-limited flash sales
- Loyalty reward redemptions
Promotions have eligibility rules, usage limits, and validity periods.
icon: Percent
- id: Conversion
name: Conversion
summary: 'The completion of a desired customer action, most commonly a purchase.'
icon: TrendingUp
- id: Fulfillment
name: Fulfillment
summary: "The end-to-end process of receiving, processing, and delivering a customer's order."
icon: PackageCheck
- id: Cart Abandonment
name: Cart Abandonment
summary: 'When a customer adds items to their cart but leaves the site without completing the purchase.'
icon: ShoppingCart
---
---
dictionary:
- id: Transaction
name: Transaction
summary: 'The process of transferring funds from one party to another.'
icon: CreditCard
- id: Invoice
name: Invoice
summary: 'A document issued by a seller to a buyer, listing goods or services provided and the amount due.'
description: |
Invoices are critical for financial transactions, serving as a request for payment from the buyer. They include:
- Invoice number for tracking
- List of products or services provided
- Total amount due and payment terms
- Seller and buyer contact information
- Due date for payment
Invoices are essential for accounting, tax purposes, and maintaining cash flow.
icon: CreditCard
- id: Payment Method
name: Payment Method
summary: 'The means by which a payment is made, such as credit card or bank transfer.'
description: |
Payment methods are the various ways customers can pay for goods or services. Common methods include:
- Credit and debit cards
- Bank transfers
- Digital wallets
- Cash on delivery
Offering multiple payment methods can enhance customer satisfaction and increase sales.
icon: Wallet
- id: Receipt
name: Receipt
summary: 'A document acknowledging that a payment has been made.'
description: |
Receipts serve as proof of payment and are important for record-keeping. They typically include:
- Receipt number
- Date and time of payment
- Amount paid
- Payment method used
- Details of the transaction
Receipts are essential for both customers and businesses to track financial transactions.
icon: Receipt
- id: Refund
name: Refund
summary: 'The process of returning funds to a customer for a returned product or service.'
description: |
Refunds are issued when a customer returns a product or cancels a service. The process involves:
- Verifying the return or cancellation
- Processing the refund through the original payment method
- Updating financial records
Efficient refund processes can improve customer satisfaction and loyalty.
icon: RotateCcw
- id: Currency
name: Currency
summary: 'The system of money in general use in a particular country.'
description: |
Currency is the medium of exchange for goods and services. Key aspects include:
- Currency code (e.g., USD, EUR)
- Exchange rates
- Currency symbols
Understanding currency is crucial for international transactions and financial reporting.
icon: DollarSign
- id: Payment Gateway
name: Payment Gateway
summary: 'A service that authorizes and processes payments for online and offline transactions.'
description: |
Payment gateways facilitate the transfer of payment information between the customer and the merchant. They ensure secure and efficient transactions by:
- Encrypting sensitive data
- Authorizing payments
- Providing transaction reports
Choosing a reliable payment gateway is essential for business operations.
icon: Server
- id: Chargeback
name: Chargeback
summary: 'A demand by a credit card provider for a retailer to make good the loss on a fraudulent or disputed transaction.'
description: |
Chargebacks occur when a customer disputes a transaction, and the funds are returned to their account. The process involves:
- Investigating the dispute
- Providing evidence to the payment processor
- Resolving the issue with the customer
Managing chargebacks effectively can prevent financial losses and maintain customer trust.
icon: AlertCircle
---
---
dictionary:
- id: Product
name: Product
summary: 'A distinct item available for sale, defined by its attributes, pricing, and descriptions.'
description: |
A product is the central aggregate in the Product Catalog domain. It contains all information needed to present and sell an item:
- Title, description, and images
- Pricing and currency information
- Attributes and specifications
- Availability status and lifecycle state (draft, active, discontinued)
Products may have multiple variants and belong to one or more categories.
icon: Package
- id: Category
name: Category
summary: 'A hierarchical grouping used to organize products for browsing and discovery.'
description: |
Categories form a tree structure that helps customers navigate the catalog. Key aspects include:
- Parent-child relationships for multi-level hierarchies
- Category metadata and SEO attributes
- Display ordering and featured status
- Maximum depth limits enforced by business rules
Products must belong to at least one active category.
icon: FolderTree
- id: Inventory
name: Inventory
summary: 'The tracked quantity of a product available for sale across warehouses and locations.'
description: |
Inventory represents the stock levels for each product or variant. It involves:
- Current stock quantities per location
- Reorder points and safety stock thresholds
- Reserved and allocated quantities
- Stock movement history and audit trails
Inventory levels directly affect product availability on the storefront.
icon: Warehouse
- id: Review
name: Review
summary: 'Customer feedback on a product, including a rating and optional written commentary.'
description: |
Reviews provide social proof and help customers make purchase decisions. Review management includes:
- Star ratings and written feedback
- Verified purchase validation
- Content moderation and approval workflows
- Helpfulness voting and seller responses
Reviews require a verified purchase before submission.
icon: Star
- id: SKU
name: SKU
summary: 'Stock Keeping Unit — a unique identifier assigned to each distinct product variant for inventory tracking.'
icon: Tag
- id: Variant
name: Variant
summary: 'A specific version of a product differentiated by attributes such as size, color, or material.'
description: |
Variants allow a single product to be offered in multiple configurations. Each variant has:
- Its own SKU and inventory levels
- Specific attribute values (e.g., size: Large, color: Blue)
- Optional price overrides
- Independent availability status
Variants share the parent product's core information but differ in selectable attributes.
icon: Layers
- id: Pricing
name: Pricing
summary: 'The monetary value assigned to a product or variant, including base price, sale price, and currency.'
icon: DollarSign
- id: Product Lifecycle
name: Product Lifecycle
summary: 'The stages a product moves through from creation to retirement: draft, active, and discontinued.'
icon: RefreshCw
- id: Attribute
name: Attribute
summary: 'A descriptive property of a product such as weight, dimensions, material, or brand.'
icon: ListChecks
- id: Cross-Sell
name: Cross-Sell
summary: 'A recommendation of related or complementary products to encourage additional purchases.'
icon: ArrowRightLeft
---