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

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 +23 -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 +366 -0
  55. package/data/static/llms.txt +53 -1
  56. package/data/static/openapi.yaml +138 -2
  57. package/data/static/schemas.json +159 -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:20:07 +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:20:07 +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:20:07 +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:20:07 +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:20:07 +0000
@@ -0,0 +1,366 @@
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
+ * "adhoc"
227
+
228
+ :::info Immutable
229
+ 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.
230
+ :::
231
+
232
+ ## <a name="templateName"></a>9. Property `templateName`
233
+
234
+ | | |
235
+ | ------------ | -------- |
236
+ | **Type** | `string` |
237
+ | **Required** | Yes |
238
+
239
+ **Description:** (Immutable) WhatsApp template name used for the send.
240
+
241
+ :::info Immutable
242
+ 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.
243
+ :::
244
+
245
+ ## <a name="status"></a>10. Property `status`
246
+
247
+ | | |
248
+ | -------------- | ------------------------------------- |
249
+ | **Type** | `enum (of string)` |
250
+ | **Required** | Yes |
251
+ | **Defined in** | #/definitions/outbound-message-status |
252
+
253
+ **Description:** Delivery status. Updated in-place by Meta delivery callbacks.
254
+
255
+ Must be one of:
256
+ * "accepted"
257
+ * "sent"
258
+ * "delivered"
259
+ * "read"
260
+ * "failed"
261
+
262
+ ## <a name="contactWaId"></a>11. Property `contactWaId`
263
+
264
+ | | |
265
+ | ------------ | ---------------- |
266
+ | **Type** | `string or null` |
267
+ | **Required** | No |
268
+
269
+ **Description:** Normalized wa_id returned by Meta on success. May differ from `to`.
270
+
271
+ ## <a name="appId"></a>12. Property `appId`
272
+
273
+ | | |
274
+ | ------------ | ---------------- |
275
+ | **Type** | `string or null` |
276
+ | **Required** | No |
277
+
278
+ **Description:** Tenant appId when applicable.
279
+
280
+ ## <a name="orderUuid"></a>13. Property `orderUuid`
281
+
282
+ | | |
283
+ | ------------ | ---------------- |
284
+ | **Type** | `string or null` |
285
+ | **Required** | No |
286
+
287
+ **Description:** Order reference. Present on review_request messages only.
288
+
289
+ ## <a name="statusUpdatedAt"></a>14. Property `statusUpdatedAt`
290
+
291
+ | | |
292
+ | ------------------------- | ---------------- |
293
+ | **Type** | `combining` |
294
+ | **Required** | No |
295
+ | **Additional properties** | Any type allowed |
296
+
297
+ **Description:** Timestamp of the last status update from a Meta delivery callback.
298
+
299
+ | Any of(Option) |
300
+ | ------------------------------------------------ |
301
+ | [firestore-timestamp](#statusUpdatedAt_anyOf_i0) |
302
+ | [item 1](#statusUpdatedAt_anyOf_i1) |
303
+
304
+ ### <a name="statusUpdatedAt_anyOf_i0"></a>14.1. Property `firestore-timestamp`
305
+
306
+ | | |
307
+ | ------------------------- | ----------------- |
308
+ | **Type** | `object` |
309
+ | **Required** | No |
310
+ | **Additional properties** | Not allowed |
311
+ | **Same definition as** | [sentAt](#sentAt) |
312
+
313
+ **Description:** Firestore Timestamp serialized representation
314
+
315
+ ### <a name="statusUpdatedAt_anyOf_i1"></a>14.2. Property `item 1`
316
+
317
+ | | |
318
+ | ------------ | ------ |
319
+ | **Type** | `null` |
320
+ | **Required** | No |
321
+
322
+ ## <a name="failureCode"></a>15. Property `failureCode`
323
+
324
+ | | |
325
+ | ------------ | ----------------- |
326
+ | **Type** | `integer or null` |
327
+ | **Required** | No |
328
+
329
+ **Description:** Meta error code. Present on failed sends only.
330
+
331
+ | Restrictions | |
332
+ | ------------ | ---------------------- |
333
+ | **Minimum** | &ge; -9007199254740991 |
334
+ | **Maximum** | &le; 9007199254740991 |
335
+
336
+ ## <a name="failureErrors"></a>16. Property `failureErrors`
337
+
338
+ | | |
339
+ | ------------ | --------------- |
340
+ | **Type** | `array or null` |
341
+ | **Required** | No |
342
+
343
+ **Description:** Raw Meta error objects. Present on failed sends only.
344
+
345
+ | | Array restrictions |
346
+ | -------------------- | ------------------ |
347
+ | **Min items** | N/A |
348
+ | **Max items** | N/A |
349
+ | **Items unicity** | False |
350
+ | **Additional items** | False |
351
+ | **Tuple validation** | See below |
352
+
353
+ | Each item of this array must be | Description |
354
+ | ------------------------------------------- | ----------- |
355
+ | [failureErrors items](#failureErrors_items) | - |
356
+
357
+ ### <a name="failureErrors_items"></a>16.1. failureErrors items
358
+
359
+ | | |
360
+ | ------------------------- | ---------------- |
361
+ | **Type** | `object` |
362
+ | **Required** | No |
363
+ | **Additional properties** | Any type allowed |
364
+
365
+ ----------------------------------------------------------------------------------------------------------------------------
366
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-05-16 at 00:20:07 +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, adhoc
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,25 @@ 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
+ - adhoc
131
+ description: Outbound WhatsApp message kind. Strict enum — new kinds require
132
+ a schema version bump (GH#38).
133
+ OutboundMessageStatus:
134
+ type: string
135
+ enum:
136
+ - accepted
137
+ - sent
138
+ - delivered
139
+ - read
140
+ - failed
141
+ description: 'Outbound WhatsApp message delivery status. Lifecycle: accepted
142
+ → sent → delivered → read, or accepted → failed. Updated in-place by Meta
143
+ delivery callbacks (GH#38).'
125
144
  PaymentMethod:
126
145
  type: string
127
146
  enum:
@@ -4484,8 +4503,8 @@ components:
4484
4503
  - receivedAt
4485
4504
  additionalProperties: false
4486
4505
  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.'
4506
+ Meta Cloud API webhook (GH#36). Collection: whatsapp_inbound_messages/{docId}.
4507
+ Top-level scope: company resolution happens post-ingestion.'
4489
4508
  WhatsappInboundMessageCreate:
4490
4509
  allOf:
4491
4510
  - $ref: '#/components/schemas/WhatsappInboundMessage'
@@ -4505,6 +4524,123 @@ components:
4505
4524
  description: Write payload for partial update (PATCH) of a WhatsappInboundMessage
4506
4525
  document. All fields optional. Fields marked `readOnly` or `x-immutable` must
4507
4526
  not be sent.
4527
+ WhatsappOutboundMessage:
4528
+ type: object
4529
+ properties:
4530
+ id:
4531
+ readOnly: true
4532
+ description: (Read-only) Firestore document ID — wamid on success, generated
4533
+ UUID on failure.
4534
+ type:
4535
+ - string
4536
+ - 'null'
4537
+ messageId:
4538
+ type: string
4539
+ x-immutable: true
4540
+ description: (Immutable) WhatsApp message ID (wamid) on success; generated
4541
+ UUID on send failure.
4542
+ to:
4543
+ type: string
4544
+ x-immutable: true
4545
+ description: (Immutable) Recipient phone number in E.164 format. Mirrors
4546
+ inbound `from`.
4547
+ waba:
4548
+ $ref: '#/components/schemas/WabaLabel'
4549
+ description: (Immutable) WABA that sent the message. Mirrors inbound `waba`.
4550
+ x-immutable: true
4551
+ wabaId:
4552
+ type: string
4553
+ x-immutable: true
4554
+ description: (Immutable) Meta WABA ID. Mirrors inbound `wabaId`.
4555
+ sentAt:
4556
+ $ref: '#/components/schemas/FirestoreTimestamp'
4557
+ description: (Read-only) Server-side send timestamp. Mirrors inbound `receivedAt`.
4558
+ readOnly: true
4559
+ phoneNumberId:
4560
+ type: string
4561
+ x-immutable: true
4562
+ description: (Immutable) Meta phone number ID used for the send (specific
4563
+ line within the WABA).
4564
+ kind:
4565
+ $ref: '#/components/schemas/OutboundMessageKind'
4566
+ description: (Immutable) Message kind.
4567
+ x-immutable: true
4568
+ templateName:
4569
+ type: string
4570
+ x-immutable: true
4571
+ description: (Immutable) WhatsApp template name used for the send.
4572
+ status:
4573
+ $ref: '#/components/schemas/OutboundMessageStatus'
4574
+ description: Delivery status. Updated in-place by Meta delivery callbacks.
4575
+ contactWaId:
4576
+ description: Normalized wa_id returned by Meta on success. May differ from
4577
+ `to`.
4578
+ type:
4579
+ - string
4580
+ - 'null'
4581
+ appId:
4582
+ description: Tenant appId when applicable.
4583
+ type:
4584
+ - string
4585
+ - 'null'
4586
+ orderUuid:
4587
+ description: Order reference. Present on review_request messages only.
4588
+ type:
4589
+ - string
4590
+ - 'null'
4591
+ statusUpdatedAt:
4592
+ anyOf:
4593
+ - $ref: '#/components/schemas/FirestoreTimestamp'
4594
+ - type: 'null'
4595
+ description: Timestamp of the last status update from a Meta delivery callback.
4596
+ failureCode:
4597
+ description: Meta error code. Present on failed sends only.
4598
+ type:
4599
+ - integer
4600
+ - 'null'
4601
+ minimum: -9007199254740991
4602
+ maximum: 9007199254740991
4603
+ failureErrors:
4604
+ description: Raw Meta error objects. Present on failed sends only.
4605
+ type:
4606
+ - array
4607
+ - 'null'
4608
+ items: {}
4609
+ required:
4610
+ - messageId
4611
+ - to
4612
+ - waba
4613
+ - wabaId
4614
+ - sentAt
4615
+ - phoneNumberId
4616
+ - kind
4617
+ - templateName
4618
+ - status
4619
+ additionalProperties: false
4620
+ description: 'WhatsappOutboundMessage — outbound WhatsApp message persisted
4621
+ at send time (GH#38). Collection: whatsapp_outbound_messages/{docId}. Top-level
4622
+ scope. Symmetric counterpart to WhatsappInboundMessage (GH#36).'
4623
+ WhatsappOutboundMessageCreate:
4624
+ allOf:
4625
+ - $ref: '#/components/schemas/WhatsappOutboundMessage'
4626
+ description: Write payload for creating a new WhatsappOutboundMessage document.
4627
+ Fields marked `readOnly` are server-set and must not be included. Fields marked
4628
+ `x-immutable` may be set once at creation.
4629
+ required:
4630
+ - messageId
4631
+ - to
4632
+ - waba
4633
+ - wabaId
4634
+ - phoneNumberId
4635
+ - kind
4636
+ - templateName
4637
+ - status
4638
+ WhatsappOutboundMessageUpdate:
4639
+ allOf:
4640
+ - $ref: '#/components/schemas/WhatsappOutboundMessage'
4641
+ description: Write payload for partial update (PATCH) of a WhatsappOutboundMessage
4642
+ document. All fields optional. Fields marked `readOnly` or `x-immutable` must
4643
+ not be sent.
4508
4644
  PaymentSummary:
4509
4645
  type: object
4510
4646
  properties: