@ingenx-io/valets-schema-mcp-server 0.1.8 → 0.1.9

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 (58) hide show
  1. package/data/docs/enums/attention-status.md +1 -1
  2. package/data/docs/enums/booking-status.md +1 -1
  3. package/data/docs/enums/customer-payment-status.md +1 -1
  4. package/data/docs/enums/customer-payment-target-type.md +1 -1
  5. package/data/docs/enums/delivery-type.md +1 -1
  6. package/data/docs/enums/deployment-link-type.md +1 -1
  7. package/data/docs/enums/event-status.md +1 -1
  8. package/data/docs/enums/fulfillment-status.md +1 -1
  9. package/data/docs/enums/loyalty-transaction-type.md +1 -1
  10. package/data/docs/enums/order-status.md +1 -1
  11. package/data/docs/enums/outbound-message-kind.md +22 -0
  12. package/data/docs/enums/outbound-message-status.md +25 -0
  13. package/data/docs/enums/payment-method.md +2 -2
  14. package/data/docs/enums/payment-proof-status.md +2 -2
  15. package/data/docs/enums/payment-status.md +2 -2
  16. package/data/docs/enums/pending-issue.md +2 -2
  17. package/data/docs/enums/return-status.md +2 -2
  18. package/data/docs/enums/session-status.md +2 -2
  19. package/data/docs/enums/site-status.md +2 -2
  20. package/data/docs/enums/stocktake-frequency.md +2 -2
  21. package/data/docs/enums/stocktake-item-status.md +2 -2
  22. package/data/docs/enums/stocktake-status.md +2 -2
  23. package/data/docs/enums/ticket-status.md +2 -2
  24. package/data/docs/enums/waba-label.md +2 -2
  25. package/data/docs/index.md +5 -2
  26. package/data/docs/models/allowed-user.md +1 -1
  27. package/data/docs/models/analytics-backfill.md +1 -1
  28. package/data/docs/models/analytics-daily.md +1 -1
  29. package/data/docs/models/analytics-event.md +1 -1
  30. package/data/docs/models/analytics-hourly.md +1 -1
  31. package/data/docs/models/booking-version.md +1 -1
  32. package/data/docs/models/booking.md +1 -1
  33. package/data/docs/models/customer-payment-allocation.md +1 -1
  34. package/data/docs/models/customer-payment.md +1 -1
  35. package/data/docs/models/customer.md +1 -1
  36. package/data/docs/models/event.md +1 -1
  37. package/data/docs/models/loyalty-config.md +1 -1
  38. package/data/docs/models/loyalty-reward.md +1 -1
  39. package/data/docs/models/loyalty-status.md +1 -1
  40. package/data/docs/models/loyalty-transaction.md +1 -1
  41. package/data/docs/models/magic-link-request.md +1 -1
  42. package/data/docs/models/metrics-current.md +1 -1
  43. package/data/docs/models/metrics-daily.md +1 -1
  44. package/data/docs/models/metrics-monthly.md +1 -1
  45. package/data/docs/models/order-item.md +1 -1
  46. package/data/docs/models/order.md +1 -1
  47. package/data/docs/models/sale.md +1 -1
  48. package/data/docs/models/site-payment.md +1 -1
  49. package/data/docs/models/site.md +1 -1
  50. package/data/docs/models/stocktake-item.md +1 -1
  51. package/data/docs/models/stocktake.md +1 -1
  52. package/data/docs/models/ticket.md +1 -1
  53. package/data/docs/models/whatsapp-inbound-message.md +2 -2
  54. package/data/docs/models/whatsapp-outbound-message.md +365 -0
  55. package/data/static/llms.txt +53 -1
  56. package/data/static/openapi.yaml +137 -2
  57. package/data/static/schemas.json +158 -2
  58. package/package.json +1 -1
@@ -546,7 +546,7 @@ Do not include in write requests. This field is set exclusively by the server (F
546
546
  **Description:** Timestamp of the most recent analytics event seen for this site.
547
547
 
548
548
  ----------------------------------------------------------------------------------------------------------------------------
549
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-05-15 at 16:32:39 +0000
549
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-05-16 at 00:18:16 +0000
550
550
 
551
551
  :::warning Server-set
552
552
  Do not include in write requests. This field is set exclusively by the server (Firestore trigger or Admin SDK). Clients that send it will have the value silently ignored or may receive a validation error.
@@ -497,4 +497,4 @@ Read-time hint snapshot of the verifier's display name (GH#29 §3 / Q10).
497
497
  | **Required** | No |
498
498
 
499
499
  ----------------------------------------------------------------------------------------------------------------------------
500
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-05-15 at 16:32:39 +0000
500
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-05-16 at 00:18:16 +0000
@@ -642,7 +642,7 @@ Read-time hint snapshot of the completer's display name (GH#29 §3 / Q10).
642
642
  | **Required** | No |
643
643
 
644
644
  ----------------------------------------------------------------------------------------------------------------------------
645
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-05-15 at 16:32:39 +0000
645
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-05-16 at 00:18:16 +0000
646
646
 
647
647
  :::warning Server-set
648
648
  Do not include in write requests. This field is set exclusively by the server (Firestore trigger or Admin SDK). Clients that send it will have the value silently ignored or may receive a validation error.
@@ -388,7 +388,7 @@ Do not include in write requests. This field is set exclusively by the server (F
388
388
  **Description:** (Immutable) FK → User/staff UID who created this ticket.
389
389
 
390
390
  ----------------------------------------------------------------------------------------------------------------------------
391
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-05-15 at 16:32:39 +0000
391
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-05-16 at 00:18:16 +0000
392
392
 
393
393
  :::info Immutable
394
394
  Set at creation only. This field cannot be modified after the document is created. Include it in CREATE payloads; omit it (or leave unchanged) in UPDATE payloads.
@@ -60,7 +60,7 @@ sidebar_position: 28
60
60
  | **Additional properties** | Not allowed |
61
61
  | **Defined in** | #/definitions/whatsapp-inbound-message |
62
62
 
63
- **Description:** WhatsappInboundMessage — inbound WhatsApp message persisted from Meta Cloud API webhook (GH#36). Collection: whatsapp_inbound_messages/\{docId\} in ratenplate project. Top-level scope: company resolution happens post-ingestion.
63
+ **Description:** WhatsappInboundMessage — inbound WhatsApp message persisted from Meta Cloud API webhook (GH#36). Collection: whatsapp_inbound_messages/\{docId\}. Top-level scope: company resolution happens post-ingestion.
64
64
 
65
65
  | Property | Pattern | Type | Deprecated | Definition | Title/Description |
66
66
  | ---------------------------- | ------- | ---------------- | ---------- | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------- |
@@ -366,4 +366,4 @@ Do not include in write requests. This field is set exclusively by the server (F
366
366
  Specific value: `true`
367
367
 
368
368
  ----------------------------------------------------------------------------------------------------------------------------
369
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-05-15 at 17:25:23 +0000
369
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-05-16 at 00:18:16 +0000
@@ -0,0 +1,365 @@
1
+ ---
2
+ title: "WhatsappOutboundMessage"
3
+ sidebar_label: "WhatsappOutboundMessage"
4
+ sidebar_position: 29
5
+ ---
6
+
7
+ # WhatsappOutboundMessage
8
+
9
+ <details>
10
+ <summary>Example JSON</summary>
11
+
12
+ ```json
13
+ {
14
+ "id": null,
15
+ "messageId": "mes_ref123",
16
+ "to": "to",
17
+ "waba": "waba",
18
+ "wabaId": "wab_ref123",
19
+ "sentAt": "sentAt",
20
+ "phoneNumberId": "pho_ref123",
21
+ "kind": "kind",
22
+ "templateName": "templateName",
23
+ "status": "status",
24
+ "contactWaId": null,
25
+ "appId": null,
26
+ "orderUuid": null,
27
+ "statusUpdatedAt": "statusUpdatedAt",
28
+ "failureCode": null,
29
+ "failureErrors": null
30
+ }
31
+ ```
32
+
33
+ </details>
34
+
35
+
36
+ - [1. Property `id`](#id)
37
+ - [2. Property `messageId`](#messageId)
38
+ - [3. Property `to`](#to)
39
+ - [4. Property `waba`](#waba)
40
+ - [5. Property `wabaId`](#wabaId)
41
+ - [6. Property `sentAt`](#sentAt)
42
+ - [6.1. Property `_seconds`](#sentAt__seconds)
43
+ - [6.2. Property `_nanoseconds`](#sentAt__nanoseconds)
44
+ - [7. Property `phoneNumberId`](#phoneNumberId)
45
+ - [8. Property `kind`](#kind)
46
+ - [9. Property `templateName`](#templateName)
47
+ - [10. Property `status`](#status)
48
+ - [11. Property `contactWaId`](#contactWaId)
49
+ - [12. Property `appId`](#appId)
50
+ - [13. Property `orderUuid`](#orderUuid)
51
+ - [14. Property `statusUpdatedAt`](#statusUpdatedAt)
52
+ - [14.1. Property `firestore-timestamp`](#statusUpdatedAt_anyOf_i0)
53
+ - [14.2. Property `item 1`](#statusUpdatedAt_anyOf_i1)
54
+ - [15. Property `failureCode`](#failureCode)
55
+ - [16. Property `failureErrors`](#failureErrors)
56
+ - [16.1. failureErrors items](#failureErrors_items)
57
+
58
+ | | |
59
+ | ------------------------- | --------------------------------------- |
60
+ | **Type** | `object` |
61
+ | **Required** | No |
62
+ | **Additional properties** | Not allowed |
63
+ | **Defined in** | #/definitions/whatsapp-outbound-message |
64
+
65
+ **Description:** WhatsappOutboundMessage — outbound WhatsApp message persisted at send time (GH#38). Collection: whatsapp_outbound_messages/\{docId\}. Top-level scope. Symmetric counterpart to WhatsappInboundMessage (GH#36).
66
+
67
+ | Property | Pattern | Type | Deprecated | Definition | Title/Description |
68
+ | -------------------------------------- | ------- | ---------------- | ---------- | ---------------------------------------- | ----------------------------------------------------------------------------------- |
69
+ | - [id](#id ) | No | string or null | No | - | (Read-only) Firestore document ID — wamid on success, generated UUID on failure. |
70
+ | + [messageId](#messageId ) | No | string | No | - | (Immutable) WhatsApp message ID (wamid) on success; generated UUID on send failure. |
71
+ | + [to](#to ) | No | string | No | - | (Immutable) Recipient phone number in E.164 format. Mirrors inbound \`from\`. |
72
+ | + [waba](#waba ) | No | enum (of string) | No | In #/definitions/waba-label | (Immutable) WABA that sent the message. Mirrors inbound \`waba\`. |
73
+ | + [wabaId](#wabaId ) | No | string | No | - | (Immutable) Meta WABA ID. Mirrors inbound \`wabaId\`. |
74
+ | + [sentAt](#sentAt ) | No | object | No | In #/definitions/firestore-timestamp | (Read-only) Server-side send timestamp. Mirrors inbound \`receivedAt\`. |
75
+ | + [phoneNumberId](#phoneNumberId ) | No | string | No | - | (Immutable) Meta phone number ID used for the send (specific line within the WABA). |
76
+ | + [kind](#kind ) | No | enum (of string) | No | In #/definitions/outbound-message-kind | (Immutable) Message kind. |
77
+ | + [templateName](#templateName ) | No | string | No | - | (Immutable) WhatsApp template name used for the send. |
78
+ | + [status](#status ) | No | enum (of string) | No | In #/definitions/outbound-message-status | Delivery status. Updated in-place by Meta delivery callbacks. |
79
+ | - [contactWaId](#contactWaId ) | No | string or null | No | - | Normalized wa_id returned by Meta on success. May differ from \`to\`. |
80
+ | - [appId](#appId ) | No | string or null | No | - | Tenant appId when applicable. |
81
+ | - [orderUuid](#orderUuid ) | No | string or null | No | - | Order reference. Present on review_request messages only. |
82
+ | - [statusUpdatedAt](#statusUpdatedAt ) | No | Combination | No | - | Timestamp of the last status update from a Meta delivery callback. |
83
+ | - [failureCode](#failureCode ) | No | integer or null | No | - | Meta error code. Present on failed sends only. |
84
+ | - [failureErrors](#failureErrors ) | No | array or null | No | - | Raw Meta error objects. Present on failed sends only. |
85
+
86
+ ## <a name="id"></a>1. Property `id`
87
+
88
+ | | |
89
+ | ------------ | ---------------- |
90
+ | **Type** | `string or null` |
91
+ | **Required** | No |
92
+
93
+ **Description:** (Read-only) Firestore document ID — wamid on success, generated UUID on failure.
94
+
95
+ :::warning Server-set
96
+ Do not include in write requests. This field is set exclusively by the server (Firestore trigger or Admin SDK). Clients that send it will have the value silently ignored or may receive a validation error.
97
+ :::
98
+
99
+ ## <a name="messageId"></a>2. Property `messageId`
100
+
101
+ | | |
102
+ | ------------ | -------- |
103
+ | **Type** | `string` |
104
+ | **Required** | Yes |
105
+
106
+ **Description:** (Immutable) WhatsApp message ID (wamid) on success; generated UUID on send failure.
107
+
108
+ :::info Immutable
109
+ Set at creation only. This field cannot be modified after the document is created. Include it in CREATE payloads; omit it (or leave unchanged) in UPDATE payloads.
110
+ :::
111
+
112
+ ## <a name="to"></a>3. Property `to`
113
+
114
+ | | |
115
+ | ------------ | -------- |
116
+ | **Type** | `string` |
117
+ | **Required** | Yes |
118
+
119
+ **Description:** (Immutable) Recipient phone number in E.164 format. Mirrors inbound `from`.
120
+
121
+ :::info Immutable
122
+ Set at creation only. This field cannot be modified after the document is created. Include it in CREATE payloads; omit it (or leave unchanged) in UPDATE payloads.
123
+ :::
124
+
125
+ ## <a name="waba"></a>4. Property `waba`
126
+
127
+ | | |
128
+ | -------------- | ------------------------ |
129
+ | **Type** | `enum (of string)` |
130
+ | **Required** | Yes |
131
+ | **Defined in** | #/definitions/waba-label |
132
+
133
+ **Description:** (Immutable) WABA that sent the message. Mirrors inbound `waba`.
134
+
135
+ Must be one of:
136
+ * "cmz"
137
+ * "val"
138
+
139
+ :::info Immutable
140
+ Set at creation only. This field cannot be modified after the document is created. Include it in CREATE payloads; omit it (or leave unchanged) in UPDATE payloads.
141
+ :::
142
+
143
+ ## <a name="wabaId"></a>5. Property `wabaId`
144
+
145
+ | | |
146
+ | ------------ | -------- |
147
+ | **Type** | `string` |
148
+ | **Required** | Yes |
149
+
150
+ **Description:** (Immutable) Meta WABA ID. Mirrors inbound `wabaId`.
151
+
152
+ :::info Immutable
153
+ Set at creation only. This field cannot be modified after the document is created. Include it in CREATE payloads; omit it (or leave unchanged) in UPDATE payloads.
154
+ :::
155
+
156
+ ## <a name="sentAt"></a>6. Property `sentAt`
157
+
158
+ | | |
159
+ | ------------------------- | --------------------------------- |
160
+ | **Type** | `object` |
161
+ | **Required** | Yes |
162
+ | **Additional properties** | Not allowed |
163
+ | **Defined in** | #/definitions/firestore-timestamp |
164
+
165
+ **Description:** (Read-only) Server-side send timestamp. Mirrors inbound `receivedAt`.
166
+
167
+ | Property | Pattern | Type | Deprecated | Definition | Title/Description |
168
+ | --------------------------------------- | ------- | ------- | ---------- | ---------- | ----------------- |
169
+ | + [_seconds](#sentAt__seconds ) | No | integer | No | - | - |
170
+ | + [_nanoseconds](#sentAt__nanoseconds ) | No | integer | No | - | - |
171
+
172
+ ### <a name="sentAt__seconds"></a>6.1. Property `_seconds`
173
+
174
+ | | |
175
+ | ------------ | --------- |
176
+ | **Type** | `integer` |
177
+ | **Required** | Yes |
178
+
179
+ | Restrictions | |
180
+ | ------------ | ---------------------- |
181
+ | **Minimum** | &ge; -9007199254740991 |
182
+ | **Maximum** | &le; 9007199254740991 |
183
+
184
+ ### <a name="sentAt__nanoseconds"></a>6.2. Property `_nanoseconds`
185
+
186
+ | | |
187
+ | ------------ | --------- |
188
+ | **Type** | `integer` |
189
+ | **Required** | Yes |
190
+
191
+ | Restrictions | |
192
+ | ------------ | ---------------------- |
193
+ | **Minimum** | &ge; -9007199254740991 |
194
+ | **Maximum** | &le; 9007199254740991 |
195
+
196
+ :::warning Server-set
197
+ Do not include in write requests. This field is set exclusively by the server (Firestore trigger or Admin SDK). Clients that send it will have the value silently ignored or may receive a validation error.
198
+ :::
199
+
200
+ ## <a name="phoneNumberId"></a>7. Property `phoneNumberId`
201
+
202
+ | | |
203
+ | ------------ | -------- |
204
+ | **Type** | `string` |
205
+ | **Required** | Yes |
206
+
207
+ **Description:** (Immutable) Meta phone number ID used for the send (specific line within the WABA).
208
+
209
+ :::info Immutable
210
+ Set at creation only. This field cannot be modified after the document is created. Include it in CREATE payloads; omit it (or leave unchanged) in UPDATE payloads.
211
+ :::
212
+
213
+ ## <a name="kind"></a>8. Property `kind`
214
+
215
+ | | |
216
+ | -------------- | ----------------------------------- |
217
+ | **Type** | `enum (of string)` |
218
+ | **Required** | Yes |
219
+ | **Defined in** | #/definitions/outbound-message-kind |
220
+
221
+ **Description:** (Immutable) Message kind.
222
+
223
+ Must be one of:
224
+ * "otp"
225
+ * "review_request"
226
+
227
+ :::info Immutable
228
+ Set at creation only. This field cannot be modified after the document is created. Include it in CREATE payloads; omit it (or leave unchanged) in UPDATE payloads.
229
+ :::
230
+
231
+ ## <a name="templateName"></a>9. Property `templateName`
232
+
233
+ | | |
234
+ | ------------ | -------- |
235
+ | **Type** | `string` |
236
+ | **Required** | Yes |
237
+
238
+ **Description:** (Immutable) WhatsApp template name used for the send.
239
+
240
+ :::info Immutable
241
+ Set at creation only. This field cannot be modified after the document is created. Include it in CREATE payloads; omit it (or leave unchanged) in UPDATE payloads.
242
+ :::
243
+
244
+ ## <a name="status"></a>10. Property `status`
245
+
246
+ | | |
247
+ | -------------- | ------------------------------------- |
248
+ | **Type** | `enum (of string)` |
249
+ | **Required** | Yes |
250
+ | **Defined in** | #/definitions/outbound-message-status |
251
+
252
+ **Description:** Delivery status. Updated in-place by Meta delivery callbacks.
253
+
254
+ Must be one of:
255
+ * "accepted"
256
+ * "sent"
257
+ * "delivered"
258
+ * "read"
259
+ * "failed"
260
+
261
+ ## <a name="contactWaId"></a>11. Property `contactWaId`
262
+
263
+ | | |
264
+ | ------------ | ---------------- |
265
+ | **Type** | `string or null` |
266
+ | **Required** | No |
267
+
268
+ **Description:** Normalized wa_id returned by Meta on success. May differ from `to`.
269
+
270
+ ## <a name="appId"></a>12. Property `appId`
271
+
272
+ | | |
273
+ | ------------ | ---------------- |
274
+ | **Type** | `string or null` |
275
+ | **Required** | No |
276
+
277
+ **Description:** Tenant appId when applicable.
278
+
279
+ ## <a name="orderUuid"></a>13. Property `orderUuid`
280
+
281
+ | | |
282
+ | ------------ | ---------------- |
283
+ | **Type** | `string or null` |
284
+ | **Required** | No |
285
+
286
+ **Description:** Order reference. Present on review_request messages only.
287
+
288
+ ## <a name="statusUpdatedAt"></a>14. Property `statusUpdatedAt`
289
+
290
+ | | |
291
+ | ------------------------- | ---------------- |
292
+ | **Type** | `combining` |
293
+ | **Required** | No |
294
+ | **Additional properties** | Any type allowed |
295
+
296
+ **Description:** Timestamp of the last status update from a Meta delivery callback.
297
+
298
+ | Any of(Option) |
299
+ | ------------------------------------------------ |
300
+ | [firestore-timestamp](#statusUpdatedAt_anyOf_i0) |
301
+ | [item 1](#statusUpdatedAt_anyOf_i1) |
302
+
303
+ ### <a name="statusUpdatedAt_anyOf_i0"></a>14.1. Property `firestore-timestamp`
304
+
305
+ | | |
306
+ | ------------------------- | ----------------- |
307
+ | **Type** | `object` |
308
+ | **Required** | No |
309
+ | **Additional properties** | Not allowed |
310
+ | **Same definition as** | [sentAt](#sentAt) |
311
+
312
+ **Description:** Firestore Timestamp serialized representation
313
+
314
+ ### <a name="statusUpdatedAt_anyOf_i1"></a>14.2. Property `item 1`
315
+
316
+ | | |
317
+ | ------------ | ------ |
318
+ | **Type** | `null` |
319
+ | **Required** | No |
320
+
321
+ ## <a name="failureCode"></a>15. Property `failureCode`
322
+
323
+ | | |
324
+ | ------------ | ----------------- |
325
+ | **Type** | `integer or null` |
326
+ | **Required** | No |
327
+
328
+ **Description:** Meta error code. Present on failed sends only.
329
+
330
+ | Restrictions | |
331
+ | ------------ | ---------------------- |
332
+ | **Minimum** | &ge; -9007199254740991 |
333
+ | **Maximum** | &le; 9007199254740991 |
334
+
335
+ ## <a name="failureErrors"></a>16. Property `failureErrors`
336
+
337
+ | | |
338
+ | ------------ | --------------- |
339
+ | **Type** | `array or null` |
340
+ | **Required** | No |
341
+
342
+ **Description:** Raw Meta error objects. Present on failed sends only.
343
+
344
+ | | Array restrictions |
345
+ | -------------------- | ------------------ |
346
+ | **Min items** | N/A |
347
+ | **Max items** | N/A |
348
+ | **Items unicity** | False |
349
+ | **Additional items** | False |
350
+ | **Tuple validation** | See below |
351
+
352
+ | Each item of this array must be | Description |
353
+ | ------------------------------------------- | ----------- |
354
+ | [failureErrors items](#failureErrors_items) | - |
355
+
356
+ ### <a name="failureErrors_items"></a>16.1. failureErrors items
357
+
358
+ | | |
359
+ | ------------------------- | ---------------- |
360
+ | **Type** | `object` |
361
+ | **Required** | No |
362
+ | **Additional properties** | Any type allowed |
363
+
364
+ ----------------------------------------------------------------------------------------------------------------------------
365
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-05-16 at 00:18:16 +0000
@@ -4,7 +4,7 @@
4
4
  > Source of truth: Zod schemas in packages/schema/src/
5
5
  > All Firestore documents are scoped under companies/{companyId}/
6
6
 
7
- > Generated: 2026-05-15
7
+ > Generated: 2026-05-16
8
8
 
9
9
  ---
10
10
 
@@ -50,6 +50,14 @@ Values: EARNED, REDEEMED, ADJUSTED, EXPIRED, BONUS, REFUND
50
50
  Core order lifecycle status (D03, D34). Universal across all business types. Replaces the Dashboard's legacy 20-value flat enum (MIG-11).
51
51
  Values: PENDING, CONFIRMED, PROCESSING, READY, COMPLETED, CANCELLED, EXPIRED
52
52
 
53
+ ### OutboundMessageKind
54
+ Outbound WhatsApp message kind. Strict enum — new kinds require a schema version bump (GH#38).
55
+ Values: otp, review_request
56
+
57
+ ### OutboundMessageStatus
58
+ Outbound WhatsApp message delivery status. Lifecycle: accepted → sent → delivered → read, or accepted → failed. Updated in-place by Meta delivery callbacks (GH#38).
59
+ Values: accepted, sent, delivered, read, failed
60
+
53
61
  ### PaymentMethod
54
62
  Unified payment method set with African + global methods (D02).
55
63
  Values: CASH, CREDIT_CARD, ORANGE_MONEY, WAVE, MTN_MONEY, MOOV_MONEY, BANK_TRANSFER, PAYPAL, STRIPE, OTHER
@@ -1510,6 +1518,50 @@ Example:
1510
1518
  }
1511
1519
  ```
1512
1520
 
1521
+ ### WhatsappOutboundMessage
1522
+ Fields: 16 (9 required)
1523
+
1524
+ | Field | Type | Required | Description |
1525
+ |-------|------|----------|-------------|
1526
+ | id | ['string', 'null'] | no | (Read-only) Firestore document ID — wamid on success, generated UUID on failure. |
1527
+ | messageId | string | yes | (Immutable) WhatsApp message ID (wamid) on success; generated UUID on send failure. |
1528
+ | to | string | yes | (Immutable) Recipient phone number in E.164 format. Mirrors inbound `from`. |
1529
+ | waba | WabaLabel | yes | (Immutable) WABA that sent the message. Mirrors inbound `waba`. |
1530
+ | wabaId | string | yes | (Immutable) Meta WABA ID. Mirrors inbound `wabaId`. |
1531
+ | sentAt | FirestoreTimestamp | yes | (Read-only) Server-side send timestamp. Mirrors inbound `receivedAt`. |
1532
+ | phoneNumberId | string | yes | (Immutable) Meta phone number ID used for the send (specific line within the WABA). |
1533
+ | kind | OutboundMessageKind | yes | (Immutable) Message kind. |
1534
+ | templateName | string | yes | (Immutable) WhatsApp template name used for the send. |
1535
+ | status | OutboundMessageStatus | yes | Delivery status. Updated in-place by Meta delivery callbacks. |
1536
+ | contactWaId | ['string', 'null'] | no | Normalized wa_id returned by Meta on success. May differ from `to`. |
1537
+ | appId | ['string', 'null'] | no | Tenant appId when applicable. |
1538
+ | orderUuid | ['string', 'null'] | no | Order reference. Present on review_request messages only. |
1539
+ | statusUpdatedAt | any | no | Timestamp of the last status update from a Meta delivery callback. |
1540
+ | failureCode | ['integer', 'null'] | no | Meta error code. Present on failed sends only. |
1541
+ | failureErrors | ['array', 'null'] | no | Raw Meta error objects. Present on failed sends only. |
1542
+
1543
+ Example:
1544
+ ```json
1545
+ {
1546
+ "id": null,
1547
+ "messageId": "mes_ref123",
1548
+ "to": "to",
1549
+ "waba": "waba",
1550
+ "wabaId": "wab_ref123",
1551
+ "sentAt": "sentAt",
1552
+ "phoneNumberId": "pho_ref123",
1553
+ "kind": "kind",
1554
+ "templateName": "templateName",
1555
+ "status": "status",
1556
+ "contactWaId": null,
1557
+ "appId": null,
1558
+ "orderUuid": null,
1559
+ "statusUpdatedAt": "statusUpdatedAt",
1560
+ "failureCode": null,
1561
+ "failureErrors": null
1562
+ }
1563
+ ```
1564
+
1513
1565
  ---
1514
1566
 
1515
1567
  ## Proposed (Work In Progress)
@@ -122,6 +122,24 @@ components:
122
122
  - EXPIRED
123
123
  description: Core order lifecycle status (D03, D34). Universal across all business
124
124
  types. Replaces the Dashboard's legacy 20-value flat enum (MIG-11).
125
+ OutboundMessageKind:
126
+ type: string
127
+ enum:
128
+ - otp
129
+ - review_request
130
+ description: Outbound WhatsApp message kind. Strict enum — new kinds require
131
+ a schema version bump (GH#38).
132
+ OutboundMessageStatus:
133
+ type: string
134
+ enum:
135
+ - accepted
136
+ - sent
137
+ - delivered
138
+ - read
139
+ - failed
140
+ description: 'Outbound WhatsApp message delivery status. Lifecycle: accepted
141
+ → sent → delivered → read, or accepted → failed. Updated in-place by Meta
142
+ delivery callbacks (GH#38).'
125
143
  PaymentMethod:
126
144
  type: string
127
145
  enum:
@@ -4484,8 +4502,8 @@ components:
4484
4502
  - receivedAt
4485
4503
  additionalProperties: false
4486
4504
  description: 'WhatsappInboundMessage — inbound WhatsApp message persisted from
4487
- Meta Cloud API webhook (GH#36). Collection: whatsapp_inbound_messages/{docId}
4488
- in ratenplate project. Top-level scope: company resolution happens post-ingestion.'
4505
+ Meta Cloud API webhook (GH#36). Collection: whatsapp_inbound_messages/{docId}.
4506
+ Top-level scope: company resolution happens post-ingestion.'
4489
4507
  WhatsappInboundMessageCreate:
4490
4508
  allOf:
4491
4509
  - $ref: '#/components/schemas/WhatsappInboundMessage'
@@ -4505,6 +4523,123 @@ components:
4505
4523
  description: Write payload for partial update (PATCH) of a WhatsappInboundMessage
4506
4524
  document. All fields optional. Fields marked `readOnly` or `x-immutable` must
4507
4525
  not be sent.
4526
+ WhatsappOutboundMessage:
4527
+ type: object
4528
+ properties:
4529
+ id:
4530
+ readOnly: true
4531
+ description: (Read-only) Firestore document ID — wamid on success, generated
4532
+ UUID on failure.
4533
+ type:
4534
+ - string
4535
+ - 'null'
4536
+ messageId:
4537
+ type: string
4538
+ x-immutable: true
4539
+ description: (Immutable) WhatsApp message ID (wamid) on success; generated
4540
+ UUID on send failure.
4541
+ to:
4542
+ type: string
4543
+ x-immutable: true
4544
+ description: (Immutable) Recipient phone number in E.164 format. Mirrors
4545
+ inbound `from`.
4546
+ waba:
4547
+ $ref: '#/components/schemas/WabaLabel'
4548
+ description: (Immutable) WABA that sent the message. Mirrors inbound `waba`.
4549
+ x-immutable: true
4550
+ wabaId:
4551
+ type: string
4552
+ x-immutable: true
4553
+ description: (Immutable) Meta WABA ID. Mirrors inbound `wabaId`.
4554
+ sentAt:
4555
+ $ref: '#/components/schemas/FirestoreTimestamp'
4556
+ description: (Read-only) Server-side send timestamp. Mirrors inbound `receivedAt`.
4557
+ readOnly: true
4558
+ phoneNumberId:
4559
+ type: string
4560
+ x-immutable: true
4561
+ description: (Immutable) Meta phone number ID used for the send (specific
4562
+ line within the WABA).
4563
+ kind:
4564
+ $ref: '#/components/schemas/OutboundMessageKind'
4565
+ description: (Immutable) Message kind.
4566
+ x-immutable: true
4567
+ templateName:
4568
+ type: string
4569
+ x-immutable: true
4570
+ description: (Immutable) WhatsApp template name used for the send.
4571
+ status:
4572
+ $ref: '#/components/schemas/OutboundMessageStatus'
4573
+ description: Delivery status. Updated in-place by Meta delivery callbacks.
4574
+ contactWaId:
4575
+ description: Normalized wa_id returned by Meta on success. May differ from
4576
+ `to`.
4577
+ type:
4578
+ - string
4579
+ - 'null'
4580
+ appId:
4581
+ description: Tenant appId when applicable.
4582
+ type:
4583
+ - string
4584
+ - 'null'
4585
+ orderUuid:
4586
+ description: Order reference. Present on review_request messages only.
4587
+ type:
4588
+ - string
4589
+ - 'null'
4590
+ statusUpdatedAt:
4591
+ anyOf:
4592
+ - $ref: '#/components/schemas/FirestoreTimestamp'
4593
+ - type: 'null'
4594
+ description: Timestamp of the last status update from a Meta delivery callback.
4595
+ failureCode:
4596
+ description: Meta error code. Present on failed sends only.
4597
+ type:
4598
+ - integer
4599
+ - 'null'
4600
+ minimum: -9007199254740991
4601
+ maximum: 9007199254740991
4602
+ failureErrors:
4603
+ description: Raw Meta error objects. Present on failed sends only.
4604
+ type:
4605
+ - array
4606
+ - 'null'
4607
+ items: {}
4608
+ required:
4609
+ - messageId
4610
+ - to
4611
+ - waba
4612
+ - wabaId
4613
+ - sentAt
4614
+ - phoneNumberId
4615
+ - kind
4616
+ - templateName
4617
+ - status
4618
+ additionalProperties: false
4619
+ description: 'WhatsappOutboundMessage — outbound WhatsApp message persisted
4620
+ at send time (GH#38). Collection: whatsapp_outbound_messages/{docId}. Top-level
4621
+ scope. Symmetric counterpart to WhatsappInboundMessage (GH#36).'
4622
+ WhatsappOutboundMessageCreate:
4623
+ allOf:
4624
+ - $ref: '#/components/schemas/WhatsappOutboundMessage'
4625
+ description: Write payload for creating a new WhatsappOutboundMessage document.
4626
+ Fields marked `readOnly` are server-set and must not be included. Fields marked
4627
+ `x-immutable` may be set once at creation.
4628
+ required:
4629
+ - messageId
4630
+ - to
4631
+ - waba
4632
+ - wabaId
4633
+ - phoneNumberId
4634
+ - kind
4635
+ - templateName
4636
+ - status
4637
+ WhatsappOutboundMessageUpdate:
4638
+ allOf:
4639
+ - $ref: '#/components/schemas/WhatsappOutboundMessage'
4640
+ description: Write payload for partial update (PATCH) of a WhatsappOutboundMessage
4641
+ document. All fields optional. Fields marked `readOnly` or `x-immutable` must
4642
+ not be sent.
4508
4643
  PaymentSummary:
4509
4644
  type: object
4510
4645
  properties: