@eventcatalog/create-eventcatalog 4.3.12 → 4.3.14-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/LICENSE +0 -10
  2. package/dist/index.js +1 -1
  3. package/package.json +1 -1
  4. package/templates/amazon-api-gateway/README-template.md +4 -0
  5. package/templates/asyncapi/README-template.md +4 -0
  6. package/templates/asyncapi/env +0 -5
  7. package/templates/confluent/README-template.md +4 -0
  8. package/templates/default/README-template.md +4 -0
  9. package/templates/default/domains/Catalog/systems/product-catalog-system/services/ProductAPI/commands/CreateProduct/examples/index.mdx +194 -0
  10. package/templates/default/domains/Catalog/systems/product-catalog-system/services/ProductAPI/commands/DeleteProduct/examples/index.mdx +161 -0
  11. package/templates/default/domains/Catalog/systems/product-catalog-system/services/ProductAPI/commands/UpdateProduct/examples/index.mdx +182 -0
  12. package/templates/default/domains/Catalog/systems/product-catalog-system/services/ProductAPI/events/ProductCreated/examples/index.mdx +227 -0
  13. package/templates/default/domains/Catalog/systems/product-catalog-system/services/ProductAPI/events/ProductDeleted/examples/index.mdx +175 -0
  14. package/templates/default/domains/Catalog/systems/product-catalog-system/services/ProductAPI/events/ProductUpdated/examples/index.mdx +205 -0
  15. package/templates/default/domains/Catalog/systems/product-catalog-system/services/ProductAPI/queries/GetProduct/examples/index.mdx +205 -0
  16. package/templates/default/domains/Catalog/systems/search-system/services/SearchAPI/queries/SearchProducts/examples/index.mdx +369 -0
  17. package/templates/default/domains/Customer/systems/customer-management-system/services/CustomerAPI/commands/RegisterCustomer/examples/index.mdx +168 -0
  18. package/templates/default/domains/Customer/systems/customer-management-system/services/CustomerAPI/commands/UpdateCustomer/examples/index.mdx +168 -0
  19. package/templates/default/domains/Customer/systems/customer-management-system/services/CustomerAPI/events/CustomerRegistered/examples/index.mdx +201 -0
  20. package/templates/default/domains/Customer/systems/customer-management-system/services/CustomerAPI/events/CustomerUpdated/examples/index.mdx +194 -0
  21. package/templates/default/domains/Customer/systems/customer-management-system/services/CustomerAPI/queries/GetCustomer/examples/index.mdx +194 -0
  22. package/templates/default/domains/Customer/systems/identity-provider/services/OAuthAPI/commands/AuthenticateCustomer/examples/index.mdx +198 -0
  23. package/templates/default/domains/Customer/systems/identity-provider/services/OAuthAPI/events/CustomerAuthenticated/examples/index.mdx +276 -0
  24. package/templates/default/domains/Fulfilment/systems/carrier/services/CarrierTrackingAPI/events/ShipmentCreated/examples/index.mdx +184 -0
  25. package/templates/default/domains/Fulfilment/systems/carrier/services/CarrierTrackingAPI/events/ShipmentDelivered/examples/index.mdx +173 -0
  26. package/templates/default/domains/Fulfilment/systems/carrier/services/CarrierTrackingAPI/events/ShipmentFailed/examples/index.mdx +265 -0
  27. package/templates/default/domains/Fulfilment/systems/inventory-system/services/InventoryService/commands/ReleaseInventory/examples/index.mdx +246 -0
  28. package/templates/default/domains/Fulfilment/systems/inventory-system/services/InventoryService/events/InventoryReserved/examples/index.mdx +227 -0
  29. package/templates/default/domains/Fulfilment/systems/inventory-system/services/InventoryService/events/InventoryUnavailable/examples/index.mdx +229 -0
  30. package/templates/default/domains/Fulfilment/systems/inventory-system/services/InventoryService/queries/GetStockLevel/examples/index.mdx +186 -0
  31. package/templates/default/domains/Fulfilment/systems/shipping-system/services/CarrierAdapter/commands/CreateShipment/examples/index.mdx +206 -0
  32. package/templates/default/domains/Fulfilment/systems/warehouse-system/services/PickingWorker/events/OrderPacked/examples/index.mdx +172 -0
  33. package/templates/default/domains/Fulfilment/systems/warehouse-system/services/WarehouseService/events/OrderReadyForShipping/examples/index.mdx +208 -0
  34. package/templates/default/domains/Ordering/systems/checkout-system/services/CheckoutOrchestrator/commands/AuthorizePayment/examples/index.mdx +179 -0
  35. package/templates/default/domains/Ordering/systems/checkout-system/services/CheckoutOrchestrator/commands/ReserveInventory/examples/index.mdx +215 -0
  36. package/templates/default/domains/Ordering/systems/order-management-system/services/OrderService/commands/CancelOrder/examples/index.mdx +163 -0
  37. package/templates/default/domains/Ordering/systems/order-management-system/services/OrderService/commands/CreateOrder/examples/index.mdx +246 -0
  38. package/templates/default/domains/Ordering/systems/order-management-system/services/OrderService/events/OrderCancelled/examples/index.mdx +267 -0
  39. package/templates/default/domains/Ordering/systems/order-management-system/services/OrderService/events/OrderCompleted/examples/index.mdx +171 -0
  40. package/templates/default/domains/Ordering/systems/order-management-system/services/OrderService/events/OrderCreated/examples/index.mdx +190 -0
  41. package/templates/default/domains/Ordering/systems/order-management-system/services/OrderService/queries/GetOrder/examples/index.mdx +343 -0
  42. package/templates/default/domains/Payments/systems/fraud-detection/services/FraudAPI/events/FraudCheckFailed/examples/index.mdx +271 -0
  43. package/templates/default/domains/Payments/systems/fraud-detection/services/FraudAPI/events/FraudCheckPassed/examples/index.mdx +173 -0
  44. package/templates/default/domains/Payments/systems/payment-processing-system/services/PaymentWorker/events/PaymentRequested/examples/index.mdx +191 -0
  45. package/templates/default/domains/Payments/systems/payment-processing-system/services/PaymentWorker/events/RefundRequested/examples/index.mdx +194 -0
  46. package/templates/default/domains/Payments/systems/stripe/services/StripeWebhookEndpoint/events/PaymentFailed/examples/index.mdx +265 -0
  47. package/templates/default/domains/Payments/systems/stripe/services/StripeWebhookEndpoint/events/PaymentSucceeded/examples/index.mdx +190 -0
  48. package/templates/default/domains/Payments/systems/stripe/services/StripeWebhookEndpoint/events/RefundProcessed/examples/index.mdx +186 -0
  49. package/templates/default/domains/Reviews/services/RatingAggregator/events/rating-updated/examples/index.mdx +183 -0
  50. package/templates/default/domains/Reviews/services/ReviewAPI/commands/flag-review/examples/index.mdx +183 -0
  51. package/templates/default/domains/Reviews/services/ReviewAPI/commands/submit-review/examples/index.mdx +195 -0
  52. package/templates/default/domains/Reviews/services/ReviewAPI/commands/vote-review-helpful/examples/index.mdx +178 -0
  53. package/templates/default/domains/Reviews/services/ReviewAPI/events/review-flagged/examples/index.mdx +186 -0
  54. package/templates/default/domains/Reviews/services/ReviewAPI/events/review-helpful-voted/examples/index.mdx +177 -0
  55. package/templates/default/domains/Reviews/services/ReviewAPI/events/review-submitted/examples/index.mdx +194 -0
  56. package/templates/default/domains/Reviews/services/ReviewAPI/queries/get-product-reviews/examples/index.mdx +259 -0
  57. package/templates/default/domains/Reviews/services/ReviewModerationWorker/events/review-published/examples/index.mdx +183 -0
  58. package/templates/default/domains/Reviews/services/ReviewModerationWorker/events/review-rejected/examples/index.mdx +178 -0
  59. package/templates/default/domains/Shopping/systems/cart-system/services/CartAPI/commands/AddItemToCart/examples/index.mdx +171 -0
  60. package/templates/default/domains/Shopping/systems/cart-system/services/CartAPI/commands/CheckoutCart/examples/index.mdx +168 -0
  61. package/templates/default/domains/Shopping/systems/cart-system/services/CartAPI/commands/RemoveItemFromCart/examples/index.mdx +170 -0
  62. package/templates/default/domains/Shopping/systems/cart-system/services/CartAPI/events/CartCheckedOut/examples/index.mdx +275 -0
  63. package/templates/default/domains/Shopping/systems/promotion-system/services/PromotionService/commands/CalculateDiscount/examples/index.mdx +207 -0
  64. package/templates/default/domains/Shopping/systems/promotion-system/services/PromotionService/events/DiscountCalculated/examples/index.mdx +190 -0
  65. package/templates/default/env +0 -5
  66. package/templates/empty/README-template.md +4 -0
  67. package/templates/empty/env +0 -5
  68. package/templates/eventbridge/README-template.md +4 -0
  69. package/templates/graphql/README-template.md +4 -0
  70. package/templates/graphql/env +0 -5
  71. package/templates/openapi/README-template.md +4 -0
  72. package/templates/openapi/env +0 -5
@@ -0,0 +1,168 @@
1
+ <Columns cols={2}>
2
+
3
+ <Column>
4
+
5
+ ## 1. Register a customer with only the required fields
6
+
7
+ A shopper signs up at checkout using just an email address and password so they can finish buying a hoodie quickly. The Customer API creates the account and publishes `CustomerRegistered`.
8
+
9
+ ### Payload details
10
+
11
+ - `email` is the customer's address. It must be unique, so a second registration with the same email is rejected with a `409`.
12
+ - `password` is the initial password and must be at least 8 characters.
13
+ - `name` is optional and is left out here. The customer can add it later with `UpdateCustomer`.
14
+
15
+ ### Using this example
16
+
17
+ Use this to check that a registration with no `name` succeeds, and that the password is hashed before storage and never logged or echoed back.
18
+
19
+ The examples use a **fictional Acme Events SDK** to send a payload matching the RegisterCustomer schema. The package names and send methods are illustrative.
20
+
21
+ </Column>
22
+
23
+ <Column>
24
+
25
+ <CodeGroup dropdown>
26
+
27
+ ```typescript send-register-customer.ts
28
+ import { EventsClient } from '@acme/events';
29
+ import type { RegisterCustomer } from './schemas/register-customer';
30
+
31
+ const client = new EventsClient({
32
+ apiKey: process.env.ACME_API_KEY!,
33
+ });
34
+
35
+ const command: RegisterCustomer = {
36
+ email: 'tom.okafor@example.co.uk',
37
+ password: 'Hoodie-Season-2026',
38
+ };
39
+
40
+ await client.send('RegisterCustomer', command);
41
+ ```
42
+
43
+ ```python send_register_customer.py
44
+ import os
45
+ from acme_events import EventsClient
46
+
47
+ client = EventsClient(api_key=os.environ["ACME_API_KEY"])
48
+
49
+ command = {
50
+ "email": "tom.okafor@example.co.uk",
51
+ "password": "Hoodie-Season-2026",
52
+ }
53
+
54
+ client.send("RegisterCustomer", command)
55
+ ```
56
+
57
+ ```java SendRegisterCustomer.java
58
+ import com.acme.events.EventsClient;
59
+ import java.util.Map;
60
+
61
+ public class SendRegisterCustomer {
62
+ public static void main(String[] args) {
63
+ var client = new EventsClient(
64
+ System.getenv("ACME_API_KEY")
65
+ );
66
+
67
+ var command = Map.of(
68
+ "email", "tom.okafor@example.co.uk",
69
+ "password", "Hoodie-Season-2026"
70
+ );
71
+
72
+ client.send("RegisterCustomer", command);
73
+ }
74
+ }
75
+ ```
76
+
77
+ </CodeGroup>
78
+
79
+ </Column>
80
+
81
+ </Columns>
82
+
83
+ ---
84
+
85
+ <Columns cols={2}>
86
+
87
+ <Column>
88
+
89
+ ## 2. Register a customer with their full name
90
+
91
+ A shopper creates an account from the sign-up page and fills in every field, including their name, so it can be used on order confirmations and delivery labels.
92
+
93
+ ### Payload details
94
+
95
+ - `email` is the customer's unique address, used for sign-in and order emails.
96
+ - `name` is the customer's full name. When supplied it must be at least 1 character.
97
+ - `password` meets the 8-character minimum.
98
+
99
+ ### Using this example
100
+
101
+ Use this to check that `name` is stored and carried through to the `CustomerRegistered` event, and that registering the same `email` again returns a `409`.
102
+
103
+ The examples use a **fictional Acme Events SDK** to send a payload matching the RegisterCustomer schema. The package names and send methods are illustrative.
104
+
105
+ </Column>
106
+
107
+ <Column>
108
+
109
+ <CodeGroup dropdown>
110
+
111
+ ```typescript send-register-customer.ts
112
+ import { EventsClient } from '@acme/events';
113
+ import type { RegisterCustomer } from './schemas/register-customer';
114
+
115
+ const client = new EventsClient({
116
+ apiKey: process.env.ACME_API_KEY!,
117
+ });
118
+
119
+ const command: RegisterCustomer = {
120
+ email: 'amelia.hart@example.com',
121
+ name: 'Amelia Hart',
122
+ password: 'Blue-Tshirt-42!',
123
+ };
124
+
125
+ await client.send('RegisterCustomer', command);
126
+ ```
127
+
128
+ ```python send_register_customer.py
129
+ import os
130
+ from acme_events import EventsClient
131
+
132
+ client = EventsClient(api_key=os.environ["ACME_API_KEY"])
133
+
134
+ command = {
135
+ "email": "amelia.hart@example.com",
136
+ "name": "Amelia Hart",
137
+ "password": "Blue-Tshirt-42!",
138
+ }
139
+
140
+ client.send("RegisterCustomer", command)
141
+ ```
142
+
143
+ ```java SendRegisterCustomer.java
144
+ import com.acme.events.EventsClient;
145
+ import java.util.Map;
146
+
147
+ public class SendRegisterCustomer {
148
+ public static void main(String[] args) {
149
+ var client = new EventsClient(
150
+ System.getenv("ACME_API_KEY")
151
+ );
152
+
153
+ var command = Map.of(
154
+ "email", "amelia.hart@example.com",
155
+ "name", "Amelia Hart",
156
+ "password", "Blue-Tshirt-42!"
157
+ );
158
+
159
+ client.send("RegisterCustomer", command);
160
+ }
161
+ }
162
+ ```
163
+
164
+ </CodeGroup>
165
+
166
+ </Column>
167
+
168
+ </Columns>
@@ -0,0 +1,168 @@
1
+ <Columns cols={2}>
2
+
3
+ <Column>
4
+
5
+ ## 1. Update a customer's name and email
6
+
7
+ A customer changes their surname and email address from the account settings page. The Customer API applies the partial update and publishes `CustomerUpdated` with the new values.
8
+
9
+ ### Payload details
10
+
11
+ - `customerId` identifies the customer to update and is the only required field.
12
+ - `email` and `name` are the new values. Only the fields supplied are changed.
13
+ - `status` is omitted, so the account status stays as it is.
14
+
15
+ ### Using this example
16
+
17
+ Use this to check that only `email` and `name` change, that the new `email` is still unique, and that the `CustomerUpdated` event lists exactly these two fields in `changes`.
18
+
19
+ The examples use a **fictional Acme Events SDK** to send a payload matching the UpdateCustomer schema. The package names and send methods are illustrative.
20
+
21
+ </Column>
22
+
23
+ <Column>
24
+
25
+ <CodeGroup dropdown>
26
+
27
+ ```typescript send-update-customer.ts
28
+ import { EventsClient } from '@acme/events';
29
+ import type { UpdateCustomer } from './schemas/update-customer';
30
+
31
+ const client = new EventsClient({
32
+ apiKey: process.env.ACME_API_KEY!,
33
+ });
34
+
35
+ const command: UpdateCustomer = {
36
+ customerId: '3f2b8c1e-7a4d-4e9b-9c21-5d8e6f0a1b2c',
37
+ email: 'amelia.hart-jones@example.com',
38
+ name: 'Amelia Hart-Jones',
39
+ };
40
+
41
+ await client.send('UpdateCustomer', command);
42
+ ```
43
+
44
+ ```python send_update_customer.py
45
+ import os
46
+ from acme_events import EventsClient
47
+
48
+ client = EventsClient(api_key=os.environ["ACME_API_KEY"])
49
+
50
+ command = {
51
+ "customerId": "3f2b8c1e-7a4d-4e9b-9c21-5d8e6f0a1b2c",
52
+ "email": "amelia.hart-jones@example.com",
53
+ "name": "Amelia Hart-Jones",
54
+ }
55
+
56
+ client.send("UpdateCustomer", command)
57
+ ```
58
+
59
+ ```java SendUpdateCustomer.java
60
+ import com.acme.events.EventsClient;
61
+ import java.util.Map;
62
+
63
+ public class SendUpdateCustomer {
64
+ public static void main(String[] args) {
65
+ var client = new EventsClient(
66
+ System.getenv("ACME_API_KEY")
67
+ );
68
+
69
+ var command = Map.of(
70
+ "customerId", "3f2b8c1e-7a4d-4e9b-9c21-5d8e6f0a1b2c",
71
+ "email", "amelia.hart-jones@example.com",
72
+ "name", "Amelia Hart-Jones"
73
+ );
74
+
75
+ client.send("UpdateCustomer", command);
76
+ }
77
+ }
78
+ ```
79
+
80
+ </CodeGroup>
81
+
82
+ </Column>
83
+
84
+ </Columns>
85
+
86
+ ---
87
+
88
+ <Columns cols={2}>
89
+
90
+ <Column>
91
+
92
+ ## 2. Suspend a customer's account
93
+
94
+ The fraud team suspends an account after a chargeback on a cap order. Only the status changes, so the command carries just the customer ID and the new status.
95
+
96
+ ### Payload details
97
+
98
+ - `customerId` identifies the account to suspend.
99
+ - `status` is `SUSPENDED`. The other allowed values are `ACTIVE` and `CLOSED`.
100
+ - `email` and `name` are omitted, so they stay unchanged.
101
+
102
+ ### Using this example
103
+
104
+ Use this to check that a status-only update leaves the profile fields untouched and that the customer can no longer check out while `SUSPENDED`.
105
+
106
+ The examples use a **fictional Acme Events SDK** to send a payload matching the UpdateCustomer schema. The package names and send methods are illustrative.
107
+
108
+ </Column>
109
+
110
+ <Column>
111
+
112
+ <CodeGroup dropdown>
113
+
114
+ ```typescript send-update-customer.ts
115
+ import { EventsClient } from '@acme/events';
116
+ import type { UpdateCustomer } from './schemas/update-customer';
117
+
118
+ const client = new EventsClient({
119
+ apiKey: process.env.ACME_API_KEY!,
120
+ });
121
+
122
+ const command: UpdateCustomer = {
123
+ customerId: 'c9a4e2f7-1b3d-4c8e-a5f6-7d2e9b0c4a13',
124
+ status: 'SUSPENDED',
125
+ };
126
+
127
+ await client.send('UpdateCustomer', command);
128
+ ```
129
+
130
+ ```python send_update_customer.py
131
+ import os
132
+ from acme_events import EventsClient
133
+
134
+ client = EventsClient(api_key=os.environ["ACME_API_KEY"])
135
+
136
+ command = {
137
+ "customerId": "c9a4e2f7-1b3d-4c8e-a5f6-7d2e9b0c4a13",
138
+ "status": "SUSPENDED",
139
+ }
140
+
141
+ client.send("UpdateCustomer", command)
142
+ ```
143
+
144
+ ```java SendUpdateCustomer.java
145
+ import com.acme.events.EventsClient;
146
+ import java.util.Map;
147
+
148
+ public class SendUpdateCustomer {
149
+ public static void main(String[] args) {
150
+ var client = new EventsClient(
151
+ System.getenv("ACME_API_KEY")
152
+ );
153
+
154
+ var command = Map.of(
155
+ "customerId", "c9a4e2f7-1b3d-4c8e-a5f6-7d2e9b0c4a13",
156
+ "status", "SUSPENDED"
157
+ );
158
+
159
+ client.send("UpdateCustomer", command);
160
+ }
161
+ }
162
+ ```
163
+
164
+ </CodeGroup>
165
+
166
+ </Column>
167
+
168
+ </Columns>
@@ -0,0 +1,201 @@
1
+ <Columns cols={2}>
2
+
3
+ <Column>
4
+
5
+ ## 1. Publish a registration with the customer's name
6
+
7
+ A shopper has signed up from the sign-up page with their full name. The Customer API publishes this event so downstream systems can onboard them, for example by sending a welcome email with a first-order discount.
8
+
9
+ ### Payload details
10
+
11
+ - `eventId` is a unique UUID for this event, used by consumers to ignore duplicates.
12
+ - `occurredAt` is the ISO-8601 UTC time the customer registered.
13
+ - `customer.customerId` is the new customer's UUID, and `customer.email` is their sign-in address.
14
+ - `customer.name` is included because the customer supplied it at sign-up.
15
+ - `customer.status` is `ACTIVE`, the normal status for a newly registered account.
16
+
17
+ ### Using this example
18
+
19
+ Use this to check that consumers create their own customer record keyed on `customer.customerId`, and that replaying the same `eventId` does not send a second welcome email.
20
+
21
+ The examples use a **fictional Acme Events SDK** to publish a payload matching the CustomerRegistered schema. The package names and publish methods are illustrative.
22
+
23
+ </Column>
24
+
25
+ <Column>
26
+
27
+ <CodeGroup dropdown>
28
+
29
+ ```typescript publish-customer-registered.ts
30
+ import { EventsClient } from '@acme/events';
31
+ import type { CustomerRegistered } from './schemas/customer-registered';
32
+
33
+ const client = new EventsClient({
34
+ apiKey: process.env.ACME_API_KEY!,
35
+ });
36
+
37
+ const event: CustomerRegistered = {
38
+ eventId: '5e7d1a90-2c4b-4f3e-8a6d-1b9c0e2f4a57',
39
+ occurredAt: '2026-03-14T10:22:05Z',
40
+ customer: {
41
+ customerId: '3f2b8c1e-7a4d-4e9b-9c21-5d8e6f0a1b2c',
42
+ email: 'amelia.hart@example.com',
43
+ name: 'Amelia Hart',
44
+ status: 'ACTIVE',
45
+ },
46
+ };
47
+
48
+ await client.publish('CustomerRegistered', event);
49
+ ```
50
+
51
+ ```python publish_customer_registered.py
52
+ import os
53
+ from acme_events import EventsClient
54
+
55
+ client = EventsClient(api_key=os.environ["ACME_API_KEY"])
56
+
57
+ event = {
58
+ "eventId": "5e7d1a90-2c4b-4f3e-8a6d-1b9c0e2f4a57",
59
+ "occurredAt": "2026-03-14T10:22:05Z",
60
+ "customer": {
61
+ "customerId": "3f2b8c1e-7a4d-4e9b-9c21-5d8e6f0a1b2c",
62
+ "email": "amelia.hart@example.com",
63
+ "name": "Amelia Hart",
64
+ "status": "ACTIVE",
65
+ },
66
+ }
67
+
68
+ client.publish("CustomerRegistered", event)
69
+ ```
70
+
71
+ ```java PublishCustomerRegistered.java
72
+ import com.acme.events.EventsClient;
73
+ import java.util.Map;
74
+
75
+ public class PublishCustomerRegistered {
76
+ public static void main(String[] args) {
77
+ var client = new EventsClient(
78
+ System.getenv("ACME_API_KEY")
79
+ );
80
+
81
+ var event = Map.of(
82
+ "eventId", "5e7d1a90-2c4b-4f3e-8a6d-1b9c0e2f4a57",
83
+ "occurredAt", "2026-03-14T10:22:05Z",
84
+ "customer", Map.of(
85
+ "customerId", "3f2b8c1e-7a4d-4e9b-9c21-5d8e6f0a1b2c",
86
+ "email", "amelia.hart@example.com",
87
+ "name", "Amelia Hart",
88
+ "status", "ACTIVE"
89
+ )
90
+ );
91
+
92
+ client.publish("CustomerRegistered", event);
93
+ }
94
+ }
95
+ ```
96
+
97
+ </CodeGroup>
98
+
99
+ </Column>
100
+
101
+ </Columns>
102
+
103
+ ---
104
+
105
+ <Columns cols={2}>
106
+
107
+ <Column>
108
+
109
+ ## 2. Publish a registration without a name
110
+
111
+ A shopper registered at checkout with only an email address and password, so the event carries no name. Consumers must handle this case, for example by greeting the customer without a first name.
112
+
113
+ ### Payload details
114
+
115
+ - `eventId` and `occurredAt` identify this event and when the registration happened.
116
+ - `customer` contains only the required fields: `customerId`, `email` and `status`.
117
+ - `customer.name` is omitted because the customer did not provide one.
118
+ - `customer.status` is `ACTIVE`.
119
+
120
+ ### Using this example
121
+
122
+ Use this to check that consumers do not fail when `customer.name` is missing, and that any welcome email falls back to a generic greeting.
123
+
124
+ The examples use a **fictional Acme Events SDK** to publish a payload matching the CustomerRegistered schema. The package names and publish methods are illustrative.
125
+
126
+ </Column>
127
+
128
+ <Column>
129
+
130
+ <CodeGroup dropdown>
131
+
132
+ ```typescript publish-customer-registered.ts
133
+ import { EventsClient } from '@acme/events';
134
+ import type { CustomerRegistered } from './schemas/customer-registered';
135
+
136
+ const client = new EventsClient({
137
+ apiKey: process.env.ACME_API_KEY!,
138
+ });
139
+
140
+ const event: CustomerRegistered = {
141
+ eventId: 'a1c3e5f7-9b2d-4a6c-8e0f-2d4b6a8c0e13',
142
+ occurredAt: '2026-09-02T18:47:31Z',
143
+ customer: {
144
+ customerId: 'c9a4e2f7-1b3d-4c8e-a5f6-7d2e9b0c4a13',
145
+ email: 'tom.okafor@example.co.uk',
146
+ status: 'ACTIVE',
147
+ },
148
+ };
149
+
150
+ await client.publish('CustomerRegistered', event);
151
+ ```
152
+
153
+ ```python publish_customer_registered.py
154
+ import os
155
+ from acme_events import EventsClient
156
+
157
+ client = EventsClient(api_key=os.environ["ACME_API_KEY"])
158
+
159
+ event = {
160
+ "eventId": "a1c3e5f7-9b2d-4a6c-8e0f-2d4b6a8c0e13",
161
+ "occurredAt": "2026-09-02T18:47:31Z",
162
+ "customer": {
163
+ "customerId": "c9a4e2f7-1b3d-4c8e-a5f6-7d2e9b0c4a13",
164
+ "email": "tom.okafor@example.co.uk",
165
+ "status": "ACTIVE",
166
+ },
167
+ }
168
+
169
+ client.publish("CustomerRegistered", event)
170
+ ```
171
+
172
+ ```java PublishCustomerRegistered.java
173
+ import com.acme.events.EventsClient;
174
+ import java.util.Map;
175
+
176
+ public class PublishCustomerRegistered {
177
+ public static void main(String[] args) {
178
+ var client = new EventsClient(
179
+ System.getenv("ACME_API_KEY")
180
+ );
181
+
182
+ var event = Map.of(
183
+ "eventId", "a1c3e5f7-9b2d-4a6c-8e0f-2d4b6a8c0e13",
184
+ "occurredAt", "2026-09-02T18:47:31Z",
185
+ "customer", Map.of(
186
+ "customerId", "c9a4e2f7-1b3d-4c8e-a5f6-7d2e9b0c4a13",
187
+ "email", "tom.okafor@example.co.uk",
188
+ "status", "ACTIVE"
189
+ )
190
+ );
191
+
192
+ client.publish("CustomerRegistered", event);
193
+ }
194
+ }
195
+ ```
196
+
197
+ </CodeGroup>
198
+
199
+ </Column>
200
+
201
+ </Columns>