@eventcatalog/create-eventcatalog 3.0.9 → 3.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/templates/amazon-api-gateway/eventcatalog.config.js +3 -0
- package/templates/asyncapi/eventcatalog.config.js +3 -0
- package/templates/confluent/eventcatalog.config.js +3 -0
- package/templates/default/domains/Orders/entities/CartItem/index.mdx +121 -0
- package/templates/default/domains/Orders/entities/Customer/index.mdx +57 -0
- package/templates/default/domains/Orders/entities/Order/index.mdx +96 -0
- package/templates/default/domains/Orders/entities/OrderItem/index.mdx +59 -0
- package/templates/default/domains/Orders/entities/ShoppingCart/index.mdx +148 -0
- package/templates/default/domains/Orders/index.mdx +13 -0
- package/templates/default/domains/Payment/entities/Address/index.mdx +162 -0
- package/templates/default/domains/Payment/entities/Invoice/index.mdx +89 -0
- package/templates/default/domains/Payment/entities/Payment/index.mdx +137 -0
- package/templates/default/domains/Payment/entities/PaymentMethod/index.mdx +77 -0
- package/templates/default/domains/Payment/entities/Transaction/index.mdx +77 -0
- package/templates/default/domains/Payment/index.mdx +17 -1
- package/templates/default/domains/Payment/services/FraudDetectionService/events/FraudCheckCompleted/index.mdx +48 -0
- package/templates/default/domains/Payment/services/FraudDetectionService/events/FraudCheckCompleted/schema.json +44 -0
- package/templates/default/domains/Payment/services/FraudDetectionService/index.mdx +59 -0
- package/templates/default/domains/Payment/services/PaymentGatewayService/commands/ProcessPayment/index.mdx +72 -0
- package/templates/default/domains/Payment/services/PaymentGatewayService/commands/ProcessPayment/schema.json +58 -0
- package/templates/default/domains/Payment/services/PaymentGatewayService/events/PaymentFailed/index.mdx +60 -0
- package/templates/default/domains/Payment/services/PaymentGatewayService/events/PaymentFailed/schema.json +68 -0
- package/templates/default/domains/Payment/services/PaymentGatewayService/index.mdx +78 -0
- package/templates/default/domains/ProductCatalog/entities/Category/index.mdx +124 -0
- package/templates/default/domains/ProductCatalog/entities/Inventory/index.mdx +116 -0
- package/templates/default/domains/ProductCatalog/entities/Product/index.mdx +115 -0
- package/templates/default/domains/ProductCatalog/entities/Review/index.mdx +154 -0
- package/templates/default/domains/ProductCatalog/index.mdx +74 -0
- package/templates/default/domains/Subscriptions/entities/BillingProfile/index.mdx +68 -0
- package/templates/default/domains/Subscriptions/entities/SubscriptionPeriod/index.mdx +73 -0
- package/templates/default/domains/Subscriptions/index.mdx +13 -2
- package/templates/default/domains/Subscriptions/services/BillingService/events/SubscriptionPaymentDue/index.mdx +60 -0
- package/templates/default/domains/Subscriptions/services/BillingService/events/SubscriptionPaymentDue/schema.json +54 -0
- package/templates/default/domains/Subscriptions/services/BillingService/index.mdx +86 -0
- package/templates/default/domains/Subscriptions/services/PlanManagementService/index.mdx +93 -0
- package/templates/default/eventcatalog.config.js +3 -0
- package/templates/empty/eventcatalog.config.js +3 -0
- package/templates/eventbridge/eventcatalog.config.js +3 -0
- package/templates/openapi/eventcatalog.config.js +3 -0
package/dist/index.js
CHANGED
|
@@ -22466,7 +22466,7 @@ var import_os2 = __toESM(require("os"));
|
|
|
22466
22466
|
var package_default = {
|
|
22467
22467
|
name: "@eventcatalog/create-eventcatalog",
|
|
22468
22468
|
description: "Create EventCatalog with one command",
|
|
22469
|
-
version: "3.0.
|
|
22469
|
+
version: "3.0.11",
|
|
22470
22470
|
bin: {
|
|
22471
22471
|
"create-catalog": "./dist/index.js"
|
|
22472
22472
|
},
|
package/package.json
CHANGED
|
@@ -5,6 +5,9 @@ export default {
|
|
|
5
5
|
organizationName: '<organizationName>',
|
|
6
6
|
homepageLink: 'https://eventcatalog.dev/',
|
|
7
7
|
editUrl: 'https://github.com/boyney123/eventcatalog-demo/edit/master',
|
|
8
|
+
// Supports static or server. Static renders a static site, server renders a server side rendered site
|
|
9
|
+
// large catalogs may benefit from server side rendering
|
|
10
|
+
output: 'static',
|
|
8
11
|
// By default set to false, add true to get urls ending in /
|
|
9
12
|
trailingSlash: false,
|
|
10
13
|
// Change to make the base url of the site different, by default https://{website}.com/docs,
|
|
@@ -10,6 +10,9 @@ export default {
|
|
|
10
10
|
organizationName: '<organizationName>',
|
|
11
11
|
homepageLink: 'https://eventcatalog.dev/',
|
|
12
12
|
editUrl: 'https://github.com/boyney123/eventcatalog-demo/edit/master',
|
|
13
|
+
// Supports static or server. Static renders a static site, server renders a server side rendered site
|
|
14
|
+
// large catalogs may benefit from server side rendering
|
|
15
|
+
output: 'static',
|
|
13
16
|
// By default set to false, add true to get urls ending in /
|
|
14
17
|
trailingSlash: false,
|
|
15
18
|
// Change to make the base url of the site different, by default https://{website}.com/docs,
|
|
@@ -5,6 +5,9 @@ export default {
|
|
|
5
5
|
organizationName: '<organizationName>',
|
|
6
6
|
homepageLink: 'https://eventcatalog.dev/',
|
|
7
7
|
editUrl: 'https://github.com/boyney123/eventcatalog-demo/edit/master',
|
|
8
|
+
// Supports static or server. Static renders a static site, server renders a server side rendered site
|
|
9
|
+
// large catalogs may benefit from server side rendering
|
|
10
|
+
output: 'static',
|
|
8
11
|
// By default set to false, add true to get urls ending in /
|
|
9
12
|
trailingSlash: false,
|
|
10
13
|
// Change to make the base url of the site different, by default https://{website}.com/docs,
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: CartItem
|
|
3
|
+
name: CartItem
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
identifier: cartItemId
|
|
6
|
+
summary: Represents an individual item within a shopping cart.
|
|
7
|
+
properties:
|
|
8
|
+
- name: cartItemId
|
|
9
|
+
type: UUID
|
|
10
|
+
required: true
|
|
11
|
+
description: Unique identifier for the cart item
|
|
12
|
+
- name: cartId
|
|
13
|
+
type: UUID
|
|
14
|
+
required: true
|
|
15
|
+
description: Shopping cart this item belongs to
|
|
16
|
+
references: ShoppingCart
|
|
17
|
+
referencesIdentifier: cartId
|
|
18
|
+
relationType: hasOne
|
|
19
|
+
- name: productId
|
|
20
|
+
type: UUID
|
|
21
|
+
required: true
|
|
22
|
+
description: Product being added to cart
|
|
23
|
+
references: Product
|
|
24
|
+
referencesIdentifier: productId
|
|
25
|
+
relationType: hasOne
|
|
26
|
+
- name: sku
|
|
27
|
+
type: string
|
|
28
|
+
required: true
|
|
29
|
+
description: Product SKU at time of adding to cart
|
|
30
|
+
- name: productName
|
|
31
|
+
type: string
|
|
32
|
+
required: true
|
|
33
|
+
description: Product name snapshot at time of adding to cart
|
|
34
|
+
- name: productImage
|
|
35
|
+
type: string
|
|
36
|
+
required: false
|
|
37
|
+
description: Product image URL snapshot
|
|
38
|
+
- name: quantity
|
|
39
|
+
type: integer
|
|
40
|
+
required: true
|
|
41
|
+
description: Quantity of this product in the cart
|
|
42
|
+
- name: unitPrice
|
|
43
|
+
type: decimal
|
|
44
|
+
required: true
|
|
45
|
+
description: Unit price at time of adding to cart
|
|
46
|
+
- name: totalPrice
|
|
47
|
+
type: decimal
|
|
48
|
+
required: true
|
|
49
|
+
description: Total price for this line item (quantity × unit price)
|
|
50
|
+
- name: originalPrice
|
|
51
|
+
type: decimal
|
|
52
|
+
required: false
|
|
53
|
+
description: Original product price before any discounts
|
|
54
|
+
- name: discountAmount
|
|
55
|
+
type: decimal
|
|
56
|
+
required: false
|
|
57
|
+
description: Discount applied to this line item
|
|
58
|
+
- name: productVariant
|
|
59
|
+
type: object
|
|
60
|
+
required: false
|
|
61
|
+
description: Product variant details (size, color, etc.)
|
|
62
|
+
properties:
|
|
63
|
+
- name: size
|
|
64
|
+
type: string
|
|
65
|
+
description: Product size if applicable
|
|
66
|
+
- name: color
|
|
67
|
+
type: string
|
|
68
|
+
description: Product color if applicable
|
|
69
|
+
- name: style
|
|
70
|
+
type: string
|
|
71
|
+
description: Product style if applicable
|
|
72
|
+
- name: isAvailable
|
|
73
|
+
type: boolean
|
|
74
|
+
required: true
|
|
75
|
+
description: Whether the product is still available
|
|
76
|
+
- name: notes
|
|
77
|
+
type: string
|
|
78
|
+
required: false
|
|
79
|
+
description: Customer notes for this item
|
|
80
|
+
- name: addedAt
|
|
81
|
+
type: DateTime
|
|
82
|
+
required: true
|
|
83
|
+
description: Date and time when item was added to cart
|
|
84
|
+
- name: updatedAt
|
|
85
|
+
type: DateTime
|
|
86
|
+
required: false
|
|
87
|
+
description: Date and time when item was last updated
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Overview
|
|
91
|
+
|
|
92
|
+
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.
|
|
93
|
+
|
|
94
|
+
### Entity Properties
|
|
95
|
+
<EntityPropertiesTable />
|
|
96
|
+
|
|
97
|
+
## Relationships
|
|
98
|
+
|
|
99
|
+
* **ShoppingCart:** Each cart item belongs to one `ShoppingCart` (identified by `cartId`).
|
|
100
|
+
* **Product:** Each cart item references one `Product` (identified by `productId`).
|
|
101
|
+
|
|
102
|
+
## Price Calculations
|
|
103
|
+
|
|
104
|
+
* **Total Price** = Quantity × Unit Price - Discount Amount
|
|
105
|
+
* **Savings** = Original Price - Unit Price (if applicable)
|
|
106
|
+
|
|
107
|
+
## Examples
|
|
108
|
+
|
|
109
|
+
* **CartItem #1:** iPhone 15 Pro, quantity 1, $999.99 unit price, no discount.
|
|
110
|
+
* **CartItem #2:** Running Shoes Size 9, quantity 2, $64.99 unit price (was $129.99).
|
|
111
|
+
* **CartItem #3:** T-Shirt Large/Blue, quantity 3, $19.99 unit price.
|
|
112
|
+
|
|
113
|
+
## Business Rules
|
|
114
|
+
|
|
115
|
+
* Quantity must be greater than zero
|
|
116
|
+
* Unit price is captured at time of adding to maintain consistency
|
|
117
|
+
* Product availability is checked when cart is accessed
|
|
118
|
+
* Unavailable items are marked but not automatically removed
|
|
119
|
+
* Total price is recalculated when quantity changes
|
|
120
|
+
* Product snapshots prevent price changes from affecting active carts
|
|
121
|
+
* Maximum quantity limits may apply per product type
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: Customer
|
|
3
|
+
name: Customer
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
identifier: customerId
|
|
6
|
+
summary: Represents an individual or organization that places orders.
|
|
7
|
+
|
|
8
|
+
properties:
|
|
9
|
+
- name: customerId
|
|
10
|
+
type: UUID
|
|
11
|
+
required: true
|
|
12
|
+
description: Unique identifier for the customer
|
|
13
|
+
- name: firstName
|
|
14
|
+
type: string
|
|
15
|
+
required: true
|
|
16
|
+
description: Customer's first name
|
|
17
|
+
- name: lastName
|
|
18
|
+
type: string
|
|
19
|
+
required: true
|
|
20
|
+
description: Customer's last name
|
|
21
|
+
- name: email
|
|
22
|
+
type: string
|
|
23
|
+
required: true
|
|
24
|
+
description: Customer's primary email address (unique)
|
|
25
|
+
- name: phone
|
|
26
|
+
type: string
|
|
27
|
+
required: false
|
|
28
|
+
description: Customer's phone number
|
|
29
|
+
- name: addresses
|
|
30
|
+
type: array
|
|
31
|
+
items:
|
|
32
|
+
type: Address # Assuming an Address value object or entity exists
|
|
33
|
+
required: false
|
|
34
|
+
description: List of addresses associated with the customer (e.g., shipping, billing)
|
|
35
|
+
- name: dateRegistered
|
|
36
|
+
type: DateTime
|
|
37
|
+
required: true
|
|
38
|
+
description: Date and time when the customer registered
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Overview
|
|
42
|
+
|
|
43
|
+
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.
|
|
44
|
+
|
|
45
|
+
### Entity Properties
|
|
46
|
+
<EntityPropertiesTable />
|
|
47
|
+
|
|
48
|
+
## Relationships
|
|
49
|
+
|
|
50
|
+
* **Order:** A customer can have multiple `Order` entities. The `Order` entity holds a reference (`customerId`) back to the `Customer`.
|
|
51
|
+
* **Address:** A customer can have multiple associated `Address` value objects or entities.
|
|
52
|
+
|
|
53
|
+
## Examples
|
|
54
|
+
|
|
55
|
+
* **Customer A:** Jane Doe, registered on 2023-01-15, with a primary shipping address and a billing address.
|
|
56
|
+
* **Customer B:** John Smith, a long-time customer with multiple past orders.
|
|
57
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: Order
|
|
3
|
+
name: Order
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
identifier: orderId
|
|
6
|
+
aggregateRoot: true
|
|
7
|
+
summary: Represents a customer's request to purchase products or services.
|
|
8
|
+
properties:
|
|
9
|
+
- name: orderId
|
|
10
|
+
type: UUID
|
|
11
|
+
required: true
|
|
12
|
+
description: Unique identifier for the order
|
|
13
|
+
- name: orderNumber
|
|
14
|
+
type: string
|
|
15
|
+
required: true
|
|
16
|
+
description: Unique identifier for the order
|
|
17
|
+
- name: customerId
|
|
18
|
+
type: UUID
|
|
19
|
+
required: false
|
|
20
|
+
description: Identifier for the customer placing the order test
|
|
21
|
+
references: Customer
|
|
22
|
+
referencesIdentifier: customerId
|
|
23
|
+
relationType: hasOne
|
|
24
|
+
- name: orderDate
|
|
25
|
+
type: DateTime
|
|
26
|
+
required: true
|
|
27
|
+
description: Date and time when the order was placed
|
|
28
|
+
- name: status
|
|
29
|
+
type: string
|
|
30
|
+
required: true
|
|
31
|
+
description: Current status of the order (e.g., Pending, Processing, Shipped, Delivered, Cancelled)
|
|
32
|
+
enum: ['Pending', 'Processing', 'Shipped', 'Delivered', 'Cancelled']
|
|
33
|
+
- name: orderItems
|
|
34
|
+
type: array
|
|
35
|
+
items:
|
|
36
|
+
type: OrderItem # Assuming an OrderItem entity exists
|
|
37
|
+
required: true
|
|
38
|
+
references: OrderItem
|
|
39
|
+
referencesIdentifier: orderItemId
|
|
40
|
+
relationType: hasMany
|
|
41
|
+
description: List of items included in the order
|
|
42
|
+
- name: totalAmount
|
|
43
|
+
type: decimal
|
|
44
|
+
required: true
|
|
45
|
+
description: Total monetary value of the order
|
|
46
|
+
- name: shippingAddress
|
|
47
|
+
type: Address
|
|
48
|
+
required: true
|
|
49
|
+
description: Address where the order should be shipped
|
|
50
|
+
references: Address
|
|
51
|
+
referencesIdentifier: addressId
|
|
52
|
+
relationType: hasOne
|
|
53
|
+
- name: billingAddress
|
|
54
|
+
type: Address
|
|
55
|
+
required: true
|
|
56
|
+
description: Address for billing purposes
|
|
57
|
+
references: Address
|
|
58
|
+
referencesIdentifier: addressId
|
|
59
|
+
relationType: hasOne
|
|
60
|
+
- name: payment
|
|
61
|
+
type: Payment
|
|
62
|
+
required: false
|
|
63
|
+
description: Payment associated with this order
|
|
64
|
+
references: Payment
|
|
65
|
+
referencesIdentifier: orderId
|
|
66
|
+
relationType: hasOne
|
|
67
|
+
- name: convertedFromCartId
|
|
68
|
+
type: UUID
|
|
69
|
+
required: false
|
|
70
|
+
description: Shopping cart that was converted to this order
|
|
71
|
+
references: ShoppingCart
|
|
72
|
+
referencesIdentifier: cartId
|
|
73
|
+
relationType: hasOne
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Overview
|
|
77
|
+
|
|
78
|
+
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.
|
|
79
|
+
|
|
80
|
+
### Entity Properties
|
|
81
|
+
<EntityPropertiesTable />
|
|
82
|
+
|
|
83
|
+
## Relationships
|
|
84
|
+
|
|
85
|
+
* **Customer:** Each order belongs to one `Customer` (identified by `customerId`).
|
|
86
|
+
* **OrderItem:** An order contains one or more `OrderItem` entities detailing the specific products and quantities.
|
|
87
|
+
* **Address:** Each order has shipping and billing `Address` entities (identified by `shippingAddress` and `billingAddress`).
|
|
88
|
+
* **Payment:** An order is associated with one `Payment` entity for transaction processing.
|
|
89
|
+
* **ShoppingCart:** An order can be converted from a `ShoppingCart` (identified by `convertedFromCartId`).
|
|
90
|
+
* **Shipment:** An order may lead to one or more `Shipment` entities (not detailed here).
|
|
91
|
+
|
|
92
|
+
## Examples
|
|
93
|
+
|
|
94
|
+
* **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'.
|
|
95
|
+
* **Order #67890:** A customer places a large order for multiple items, requiring special shipping arrangements. Status is 'Pending' until payment confirmation.
|
|
96
|
+
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: OrderItem
|
|
3
|
+
name: OrderItem
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
identifier: orderItemId
|
|
6
|
+
summary: Represents a single item within a customer's order.
|
|
7
|
+
|
|
8
|
+
properties:
|
|
9
|
+
- name: orderItemId
|
|
10
|
+
type: UUID
|
|
11
|
+
required: true
|
|
12
|
+
description: Unique identifier for the order item
|
|
13
|
+
- name: orderId
|
|
14
|
+
type: UUID
|
|
15
|
+
required: true
|
|
16
|
+
description: Identifier for the parent Order
|
|
17
|
+
references: Order
|
|
18
|
+
relationType: hasOne
|
|
19
|
+
- name: productId
|
|
20
|
+
type: UUID
|
|
21
|
+
required: true
|
|
22
|
+
description: Identifier for the product being ordered
|
|
23
|
+
references: Product
|
|
24
|
+
referencesIdentifier: productId
|
|
25
|
+
relationType: hasOne
|
|
26
|
+
- name: productName
|
|
27
|
+
type: string
|
|
28
|
+
required: false # Often denormalized for performance/display
|
|
29
|
+
description: Name of the product at the time of order
|
|
30
|
+
- name: quantity
|
|
31
|
+
type: integer
|
|
32
|
+
required: true
|
|
33
|
+
description: Number of units of the product ordered
|
|
34
|
+
- name: unitPrice
|
|
35
|
+
type: decimal
|
|
36
|
+
required: true
|
|
37
|
+
description: Price per unit of the product at the time of order
|
|
38
|
+
- name: totalPrice
|
|
39
|
+
type: decimal
|
|
40
|
+
required: true
|
|
41
|
+
description: Total price for this item line (quantity * unitPrice)
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Overview
|
|
45
|
+
|
|
46
|
+
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.
|
|
47
|
+
|
|
48
|
+
### Entity Properties
|
|
49
|
+
<EntityPropertiesTable />
|
|
50
|
+
|
|
51
|
+
## Relationships
|
|
52
|
+
|
|
53
|
+
* **Order:** Each `OrderItem` belongs to exactly one `Order` (identified by `orderId`). It is a constituent part of the Order aggregate.
|
|
54
|
+
* **Product:** Each `OrderItem` refers to one `Product` (identified by `productId`).
|
|
55
|
+
|
|
56
|
+
## Examples
|
|
57
|
+
|
|
58
|
+
* **OrderItem A (for Order #12345):** Product ID: P001, Quantity: 2, Unit Price: $50.00, Total Price: $100.00
|
|
59
|
+
* **OrderItem B (for Order #12345):** Product ID: P002, Quantity: 1, Unit Price: $75.00, Total Price: $75.00
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: ShoppingCart
|
|
3
|
+
name: ShoppingCart
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
identifier: cartId
|
|
6
|
+
aggregateRoot: true
|
|
7
|
+
summary: Represents a customer's shopping cart containing products before checkout.
|
|
8
|
+
properties:
|
|
9
|
+
- name: cartId
|
|
10
|
+
type: UUID
|
|
11
|
+
required: true
|
|
12
|
+
description: Unique identifier for the shopping cart
|
|
13
|
+
- name: customerId
|
|
14
|
+
type: UUID
|
|
15
|
+
required: false
|
|
16
|
+
description: Customer who owns this cart (null for guest carts)
|
|
17
|
+
references: Customer
|
|
18
|
+
referencesIdentifier: customerId
|
|
19
|
+
relationType: hasOne
|
|
20
|
+
- name: sessionId
|
|
21
|
+
type: string
|
|
22
|
+
required: false
|
|
23
|
+
description: Session identifier for guest carts
|
|
24
|
+
- name: status
|
|
25
|
+
type: string
|
|
26
|
+
required: true
|
|
27
|
+
description: Current status of the cart
|
|
28
|
+
enum: ['active', 'abandoned', 'converted', 'expired']
|
|
29
|
+
- name: cartItems
|
|
30
|
+
type: array
|
|
31
|
+
items:
|
|
32
|
+
type: CartItem
|
|
33
|
+
required: false
|
|
34
|
+
description: Items in the shopping cart
|
|
35
|
+
references: CartItem
|
|
36
|
+
referencesIdentifier: cartId
|
|
37
|
+
relationType: hasMany
|
|
38
|
+
- name: subtotal
|
|
39
|
+
type: decimal
|
|
40
|
+
required: true
|
|
41
|
+
description: Subtotal amount before taxes and shipping
|
|
42
|
+
- name: taxAmount
|
|
43
|
+
type: decimal
|
|
44
|
+
required: false
|
|
45
|
+
description: Calculated tax amount
|
|
46
|
+
- name: shippingAmount
|
|
47
|
+
type: decimal
|
|
48
|
+
required: false
|
|
49
|
+
description: Calculated shipping amount
|
|
50
|
+
- name: discountAmount
|
|
51
|
+
type: decimal
|
|
52
|
+
required: false
|
|
53
|
+
description: Total discount amount applied
|
|
54
|
+
- name: totalAmount
|
|
55
|
+
type: decimal
|
|
56
|
+
required: true
|
|
57
|
+
description: Final total amount including taxes and shipping
|
|
58
|
+
- name: currency
|
|
59
|
+
type: string
|
|
60
|
+
required: true
|
|
61
|
+
description: Currency code for all amounts
|
|
62
|
+
- name: appliedCoupons
|
|
63
|
+
type: array
|
|
64
|
+
items:
|
|
65
|
+
type: string
|
|
66
|
+
required: false
|
|
67
|
+
description: Coupon codes applied to this cart
|
|
68
|
+
- name: shippingAddress
|
|
69
|
+
type: Address
|
|
70
|
+
required: false
|
|
71
|
+
description: Selected shipping address
|
|
72
|
+
references: Address
|
|
73
|
+
referencesIdentifier: addressId
|
|
74
|
+
relationType: hasOne
|
|
75
|
+
- name: billingAddress
|
|
76
|
+
type: Address
|
|
77
|
+
required: false
|
|
78
|
+
description: Selected billing address
|
|
79
|
+
references: Address
|
|
80
|
+
referencesIdentifier: addressId
|
|
81
|
+
relationType: hasOne
|
|
82
|
+
- name: notes
|
|
83
|
+
type: string
|
|
84
|
+
required: false
|
|
85
|
+
description: Customer notes or special instructions
|
|
86
|
+
- name: abandonedAt
|
|
87
|
+
type: DateTime
|
|
88
|
+
required: false
|
|
89
|
+
description: Date and time when cart was abandoned
|
|
90
|
+
- name: convertedToOrderId
|
|
91
|
+
type: UUID
|
|
92
|
+
required: false
|
|
93
|
+
description: Order ID if cart was successfully converted
|
|
94
|
+
references: Order
|
|
95
|
+
referencesIdentifier: orderId
|
|
96
|
+
relationType: hasOne
|
|
97
|
+
- name: expiresAt
|
|
98
|
+
type: DateTime
|
|
99
|
+
required: false
|
|
100
|
+
description: Date and time when cart expires
|
|
101
|
+
- name: createdAt
|
|
102
|
+
type: DateTime
|
|
103
|
+
required: true
|
|
104
|
+
description: Date and time when the cart was created
|
|
105
|
+
- name: updatedAt
|
|
106
|
+
type: DateTime
|
|
107
|
+
required: false
|
|
108
|
+
description: Date and time when the cart was last updated
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Overview
|
|
112
|
+
|
|
113
|
+
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.
|
|
114
|
+
|
|
115
|
+
### Entity Properties
|
|
116
|
+
<EntityPropertiesTable />
|
|
117
|
+
|
|
118
|
+
## Relationships
|
|
119
|
+
|
|
120
|
+
* **Customer:** A cart can belong to one `Customer` (identified by `customerId`).
|
|
121
|
+
* **CartItem:** A cart contains multiple `CartItem` entities with product details.
|
|
122
|
+
* **Address:** A cart can reference shipping and billing `Address` entities.
|
|
123
|
+
* **Order:** A cart can be converted to one `Order` (identified by `convertedToOrderId`).
|
|
124
|
+
|
|
125
|
+
## Cart States
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
active → abandoned
|
|
129
|
+
↓ ↓
|
|
130
|
+
converted expired
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Examples
|
|
134
|
+
|
|
135
|
+
* **Cart #1:** Customer cart with 3 items, $299.99 total, active status.
|
|
136
|
+
* **Cart #2:** Guest cart abandoned after 24 hours, contains 1 high-value item.
|
|
137
|
+
* **Cart #3:** Converted cart that became Order #12345, marked as converted.
|
|
138
|
+
|
|
139
|
+
## Business Rules
|
|
140
|
+
|
|
141
|
+
* Guest carts are identified by session ID when customer ID is null
|
|
142
|
+
* Cart totals are recalculated when items are added/removed
|
|
143
|
+
* Abandoned carts trigger marketing automation after configured time
|
|
144
|
+
* Expired carts are cleaned up after retention period
|
|
145
|
+
* Cart conversion creates an order and marks cart as converted
|
|
146
|
+
* Inventory is not reserved until checkout begins
|
|
147
|
+
* Applied coupons are validated on each cart update
|
|
148
|
+
* Cart items maintain snapshot of product prices at time of addition
|
|
@@ -10,6 +10,12 @@ services:
|
|
|
10
10
|
- id: OrdersService
|
|
11
11
|
- id: NotificationService
|
|
12
12
|
- id: ShippingService
|
|
13
|
+
entities:
|
|
14
|
+
- id: Order
|
|
15
|
+
- id: OrderItem
|
|
16
|
+
- id: Customer
|
|
17
|
+
- id: ShoppingCart
|
|
18
|
+
- id: CartItem
|
|
13
19
|
badges:
|
|
14
20
|
- content: Subdomain
|
|
15
21
|
backgroundColor: blue
|
|
@@ -50,6 +56,13 @@ The Orders domain handles all operations related to customer orders, from creati
|
|
|
50
56
|
|
|
51
57
|
<NodeGraph />
|
|
52
58
|
|
|
59
|
+
### Entity Map
|
|
60
|
+
|
|
61
|
+
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.
|
|
62
|
+
|
|
63
|
+
<EntityMap id="Orders" />
|
|
64
|
+
|
|
65
|
+
|
|
53
66
|
<MessageTable format="all" limit={4} showChannels={true} title="Messages in/out of the domain" />
|
|
54
67
|
|
|
55
68
|
### Order example (sequence diagram)
|