@eventcatalog/create-eventcatalog 3.0.10 → 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.
Files changed (34) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
  3. package/templates/default/domains/Orders/entities/CartItem/index.mdx +121 -0
  4. package/templates/default/domains/Orders/entities/Customer/index.mdx +57 -0
  5. package/templates/default/domains/Orders/entities/Order/index.mdx +96 -0
  6. package/templates/default/domains/Orders/entities/OrderItem/index.mdx +59 -0
  7. package/templates/default/domains/Orders/entities/ShoppingCart/index.mdx +148 -0
  8. package/templates/default/domains/Orders/index.mdx +13 -0
  9. package/templates/default/domains/Payment/entities/Address/index.mdx +162 -0
  10. package/templates/default/domains/Payment/entities/Invoice/index.mdx +89 -0
  11. package/templates/default/domains/Payment/entities/Payment/index.mdx +137 -0
  12. package/templates/default/domains/Payment/entities/PaymentMethod/index.mdx +77 -0
  13. package/templates/default/domains/Payment/entities/Transaction/index.mdx +77 -0
  14. package/templates/default/domains/Payment/index.mdx +17 -1
  15. package/templates/default/domains/Payment/services/FraudDetectionService/events/FraudCheckCompleted/index.mdx +48 -0
  16. package/templates/default/domains/Payment/services/FraudDetectionService/events/FraudCheckCompleted/schema.json +44 -0
  17. package/templates/default/domains/Payment/services/FraudDetectionService/index.mdx +59 -0
  18. package/templates/default/domains/Payment/services/PaymentGatewayService/commands/ProcessPayment/index.mdx +72 -0
  19. package/templates/default/domains/Payment/services/PaymentGatewayService/commands/ProcessPayment/schema.json +58 -0
  20. package/templates/default/domains/Payment/services/PaymentGatewayService/events/PaymentFailed/index.mdx +60 -0
  21. package/templates/default/domains/Payment/services/PaymentGatewayService/events/PaymentFailed/schema.json +68 -0
  22. package/templates/default/domains/Payment/services/PaymentGatewayService/index.mdx +78 -0
  23. package/templates/default/domains/ProductCatalog/entities/Category/index.mdx +124 -0
  24. package/templates/default/domains/ProductCatalog/entities/Inventory/index.mdx +116 -0
  25. package/templates/default/domains/ProductCatalog/entities/Product/index.mdx +115 -0
  26. package/templates/default/domains/ProductCatalog/entities/Review/index.mdx +154 -0
  27. package/templates/default/domains/ProductCatalog/index.mdx +74 -0
  28. package/templates/default/domains/Subscriptions/entities/BillingProfile/index.mdx +68 -0
  29. package/templates/default/domains/Subscriptions/entities/SubscriptionPeriod/index.mdx +73 -0
  30. package/templates/default/domains/Subscriptions/index.mdx +13 -2
  31. package/templates/default/domains/Subscriptions/services/BillingService/events/SubscriptionPaymentDue/index.mdx +60 -0
  32. package/templates/default/domains/Subscriptions/services/BillingService/events/SubscriptionPaymentDue/schema.json +54 -0
  33. package/templates/default/domains/Subscriptions/services/BillingService/index.mdx +86 -0
  34. package/templates/default/domains/Subscriptions/services/PlanManagementService/index.mdx +93 -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.10",
22469
+ version: "3.0.11",
22470
22470
  bin: {
22471
22471
  "create-catalog": "./dist/index.js"
22472
22472
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eventcatalog/create-eventcatalog",
3
3
  "description": "Create EventCatalog with one command",
4
- "version": "3.0.10",
4
+ "version": "3.0.11",
5
5
  "bin": {
6
6
  "create-catalog": "./dist/index.js"
7
7
  },
@@ -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)
@@ -0,0 +1,162 @@
1
+ ---
2
+ id: Address
3
+ name: Address
4
+ version: 1.0.0
5
+ identifier: addressId
6
+ summary: Represents shipping and billing addresses for customers and orders.
7
+ properties:
8
+ - name: addressId
9
+ type: UUID
10
+ required: true
11
+ description: Unique identifier for the address
12
+ - name: customerId
13
+ type: UUID
14
+ required: false
15
+ description: Customer this address belongs to
16
+ references: Customer
17
+ referencesIdentifier: customerId
18
+ relationType: hasOne
19
+ - name: type
20
+ type: string
21
+ required: true
22
+ description: Type of address
23
+ enum: ['billing', 'shipping', 'both']
24
+ - name: firstName
25
+ type: string
26
+ required: true
27
+ description: First name of the recipient
28
+ - name: lastName
29
+ type: string
30
+ required: true
31
+ description: Last name of the recipient
32
+ - name: company
33
+ type: string
34
+ required: false
35
+ description: Company name if applicable
36
+ - name: addressLine1
37
+ type: string
38
+ required: true
39
+ description: Primary address line (street address)
40
+ - name: addressLine2
41
+ type: string
42
+ required: false
43
+ description: Secondary address line (apartment, suite, etc.)
44
+ - name: city
45
+ type: string
46
+ required: true
47
+ description: City name
48
+ - name: state
49
+ type: string
50
+ required: true
51
+ description: State or province
52
+ - name: postalCode
53
+ type: string
54
+ required: true
55
+ description: Postal or ZIP code
56
+ - name: country
57
+ type: string
58
+ required: true
59
+ description: Country code (ISO 3166-1 alpha-2)
60
+ - name: phone
61
+ type: string
62
+ required: false
63
+ description: Phone number for delivery contact
64
+ - name: isDefault
65
+ type: boolean
66
+ required: true
67
+ description: Whether this is the default address for the customer
68
+ - name: isValidated
69
+ type: boolean
70
+ required: true
71
+ description: Whether the address has been validated
72
+ - name: validationDetails
73
+ type: object
74
+ required: false
75
+ description: Address validation details
76
+ properties:
77
+ - name: validatedAt
78
+ type: DateTime
79
+ description: When the address was validated
80
+ - name: validationService
81
+ type: string
82
+ description: Service used for validation
83
+ - name: confidence
84
+ type: decimal
85
+ description: Validation confidence score
86
+ - name: geocoordinates
87
+ type: object
88
+ required: false
89
+ description: Geographic coordinates for the address
90
+ properties:
91
+ - name: latitude
92
+ type: decimal
93
+ description: Latitude coordinate
94
+ - name: longitude
95
+ type: decimal
96
+ description: Longitude coordinate
97
+ - name: deliveryInstructions
98
+ type: string
99
+ required: false
100
+ description: Special delivery instructions
101
+ - name: orders
102
+ type: array
103
+ items:
104
+ type: Order
105
+ required: false
106
+ description: Orders using this address
107
+ references: Order
108
+ referencesIdentifier: shippingAddress
109
+ relationType: hasMany
110
+ - name: payments
111
+ type: array
112
+ items:
113
+ type: Payment
114
+ required: false
115
+ description: Payments using this as billing address
116
+ references: Payment
117
+ referencesIdentifier: billingAddress
118
+ relationType: hasMany
119
+ - name: createdAt
120
+ type: DateTime
121
+ required: true
122
+ description: Date and time when the address was created
123
+ - name: updatedAt
124
+ type: DateTime
125
+ required: false
126
+ description: Date and time when the address was last updated
127
+ ---
128
+
129
+ ## Overview
130
+
131
+ 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.
132
+
133
+ ### Entity Properties
134
+ <EntityPropertiesTable />
135
+
136
+ ## Relationships
137
+
138
+ * **Customer:** An address can belong to one `Customer` (identified by `customerId`).
139
+ * **Order:** An address can be used by multiple `Order` entities for shipping.
140
+ * **Payment:** An address can be used by multiple `Payment` entities for billing.
141
+
142
+ ## Address Types
143
+
144
+ * **Billing:** Used for payment processing and invoicing
145
+ * **Shipping:** Used for order delivery
146
+ * **Both:** Can be used for both billing and shipping
147
+
148
+ ## Examples
149
+
150
+ * **Address #1:** John Doe's home address - default shipping and billing address.
151
+ * **Address #2:** Corporate office address - billing only, validated with high confidence.
152
+ * **Address #3:** Gift recipient address - shipping only, with special delivery instructions.
153
+
154
+ ## Business Rules
155
+
156
+ * Each customer can have only one default address per type
157
+ * Addresses must be validated before being marked as default
158
+ * International addresses require country-specific validation
159
+ * Geocoordinates are automatically populated when available
160
+ * Address changes should create new versions for audit trail
161
+ * PO Box addresses may have shipping restrictions
162
+ * Address validation improves delivery success rates