@ingenx-io/valets-schema-mcp-server 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/data/docs/collections/firestore-paths.md +32 -20
- package/data/docs/enums/app-status.md +24 -0
- package/data/docs/enums/attention-status.md +2 -2
- package/data/docs/enums/booking-status.md +2 -2
- package/data/docs/enums/customer-payment-status.md +2 -2
- package/data/docs/enums/customer-payment-target-type.md +2 -2
- package/data/docs/enums/delivery-type.md +2 -2
- package/data/docs/enums/deployment-link-type.md +2 -2
- package/data/docs/enums/event-status.md +2 -2
- package/data/docs/enums/fulfillment-status.md +2 -2
- package/data/docs/enums/loyalty-transaction-type.md +2 -2
- package/data/docs/enums/notification-channel.md +2 -2
- package/data/docs/enums/notification-entity-type.md +2 -2
- package/data/docs/enums/notification-status.md +2 -2
- package/data/docs/enums/order-status.md +2 -2
- package/data/docs/enums/outbound-message-format.md +2 -2
- package/data/docs/enums/outbound-message-purpose.md +2 -2
- package/data/docs/enums/outbound-message-status.md +2 -2
- package/data/docs/enums/payment-method.md +2 -2
- package/data/docs/enums/payment-proof-status.md +2 -2
- package/data/docs/enums/payment-status.md +2 -2
- package/data/docs/enums/pending-issue.md +2 -2
- package/data/docs/enums/return-status.md +2 -2
- package/data/docs/enums/session-status.md +2 -2
- package/data/docs/enums/site-status.md +2 -2
- package/data/docs/enums/stocktake-frequency.md +2 -2
- package/data/docs/enums/stocktake-item-status.md +2 -2
- package/data/docs/enums/stocktake-status.md +2 -2
- package/data/docs/enums/ticket-status.md +2 -2
- package/data/docs/enums/waba-label.md +2 -2
- package/data/docs/enums/whatsapp-button-sub-type.md +2 -2
- package/data/docs/enums/whatsapp-template-component.md +2 -2
- package/data/docs/enums/whatsapp-template-status.md +2 -2
- package/data/docs/index.md +9 -5
- package/data/docs/models/allowed-user.md +7 -7
- package/data/docs/models/analytics-backfill.md +7 -7
- package/data/docs/models/analytics-daily.md +6 -6
- package/data/docs/models/analytics-event.md +7 -7
- package/data/docs/models/analytics-hourly.md +6 -6
- package/data/docs/models/app-payment.md +200 -0
- package/data/docs/models/app.md +561 -0
- package/data/docs/models/booking-version.md +2 -2
- package/data/docs/models/booking.md +127 -127
- package/data/docs/models/customer-payment-allocation.md +20 -20
- package/data/docs/models/customer-payment.md +23 -23
- package/data/docs/models/customer.md +11 -11
- package/data/docs/models/event.md +22 -22
- package/data/docs/models/loyalty-config.md +4 -4
- package/data/docs/models/loyalty-reward.md +3 -3
- package/data/docs/models/loyalty-status.md +6 -6
- package/data/docs/models/loyalty-transaction.md +2 -2
- package/data/docs/models/magic-link-request.md +9 -9
- package/data/docs/models/metrics-current.md +169 -37
- package/data/docs/models/metrics-daily.md +172 -40
- package/data/docs/models/metrics-monthly.md +172 -40
- package/data/docs/models/notification-record.md +3 -3
- package/data/docs/models/order-item.md +6 -6
- package/data/docs/models/order.md +78 -78
- package/data/docs/models/sale.md +18 -18
- package/data/docs/models/site-payment.md +2 -2
- package/data/docs/models/site.md +2 -2
- package/data/docs/models/stocktake-item.md +4 -4
- package/data/docs/models/stocktake.md +5 -5
- package/data/docs/models/ticket.md +3 -3
- package/data/docs/models/user.md +249 -0
- package/data/docs/models/whatsapp-inbound-message.md +2 -2
- package/data/docs/models/whatsapp-outbound-lifecycle-event.md +2 -2
- package/data/docs/models/whatsapp-outbound-message.md +6 -6
- package/data/docs/models/whatsapp-template.md +2 -2
- package/data/static/cookbook.json +150 -0
- package/data/static/llms.txt +179 -33
- package/data/static/openapi.yaml +626 -60
- package/data/static/schemas.json +680 -69
- package/index.js +32 -0
- package/package.json +1 -1
package/data/static/llms.txt
CHANGED
|
@@ -4,12 +4,16 @@
|
|
|
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-
|
|
7
|
+
> Generated: 2026-05-30
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
## Enums
|
|
12
12
|
|
|
13
|
+
### AppStatus
|
|
14
|
+
Lifecycle status for an App (formerly Site — renamed per decision #40 / D44). Drives whether the app is reachable and whether analytics/payments flow.
|
|
15
|
+
Values: ACTIVE, INACTIVE, EXPIRED, ARCHIVED
|
|
16
|
+
|
|
13
17
|
### AttentionStatus
|
|
14
18
|
Operational attention status for Order and Booking (D39). Controls home-page queue assignment. Server-owned — set via triggers or callable fn only.
|
|
15
19
|
Values: ACTIVE, STALE, ON_HOLD, ESCALATED
|
|
@@ -145,7 +149,7 @@ Fields: 9 (8 required)
|
|
|
145
149
|
|-------|------|----------|-------------|
|
|
146
150
|
| id | ['string', 'null'] | no | (Read-only) Firestore document ID = contact identifier (email or E.164 phone), URL-escaped. |
|
|
147
151
|
| companyId | string | yes | (Immutable) FK → Company document ID. |
|
|
148
|
-
|
|
|
152
|
+
| appId | string | yes | (Immutable) FK → App document ID (D40 sub-tenant scope, renamed per D44). |
|
|
149
153
|
| contact | string | yes | Email or E.164 phone number. Canonical identifier for this user within the site. |
|
|
150
154
|
| tier | string | yes | Access tier. Free string per site (ING-304 open question — tier values are site-specific today). |
|
|
151
155
|
| amount | number | yes | Amount paid. Generalized from amount_xof per D40 decision. |
|
|
@@ -158,7 +162,7 @@ Example:
|
|
|
158
162
|
{
|
|
159
163
|
"id": null,
|
|
160
164
|
"companyId": "comp_xyz789",
|
|
161
|
-
"
|
|
165
|
+
"appId": "app_ref123",
|
|
162
166
|
"contact": "contact",
|
|
163
167
|
"tier": "Gold",
|
|
164
168
|
"amount": 45000,
|
|
@@ -175,7 +179,7 @@ Fields: 12 (10 required)
|
|
|
175
179
|
|-------|------|----------|-------------|
|
|
176
180
|
| id | ['string', 'null'] | no | (Read-only) Firestore document ID, auto-generated. |
|
|
177
181
|
| companyId | string | yes | (Immutable) FK → Company document ID. |
|
|
178
|
-
|
|
|
182
|
+
| appId | string | yes | (Immutable) FK → Site document ID (D40). |
|
|
179
183
|
| status | enum(5) | yes | Run status. |
|
|
180
184
|
| from | string | yes | (Immutable) Inclusive start date (`YYYY-MM-DD`, UTC). |
|
|
181
185
|
| to | string | yes | (Immutable) Inclusive end date (`YYYY-MM-DD`, UTC). |
|
|
@@ -194,7 +198,7 @@ Example:
|
|
|
194
198
|
{
|
|
195
199
|
"id": null,
|
|
196
200
|
"companyId": "comp_xyz789",
|
|
197
|
-
"
|
|
201
|
+
"appId": "app_ref123",
|
|
198
202
|
"status": "pending",
|
|
199
203
|
"from": "from",
|
|
200
204
|
"to": "to",
|
|
@@ -232,7 +236,7 @@ Fields: 16 (14 required)
|
|
|
232
236
|
| eventCounts | record<string,integer> | yes | Per-event-name counts — key is the event name (canonical or custom), value is the count within the bucket. |
|
|
233
237
|
| id | ['string', 'null'] | no | (Read-only) Firestore document ID = `YYYY-MM-DD`. |
|
|
234
238
|
| companyId | string | yes | (Immutable) FK → Company document ID. |
|
|
235
|
-
|
|
|
239
|
+
| appId | string | yes | (Immutable) FK → Site document ID (D40). |
|
|
236
240
|
| date | string | yes | (Immutable) `YYYY-MM-DD` UTC — matches document ID. |
|
|
237
241
|
| computedAt | FirestoreTimestamp | yes | (Read-only) When this rollup was last (re)computed. Updated on every set/merge. |
|
|
238
242
|
| sourceEventCount | ['integer', 'null'] | no | (Read-only, Optional) Total source events scanned when producing this rollup. Useful for dry-run diffing. |
|
|
@@ -252,7 +256,7 @@ Example:
|
|
|
252
256
|
"eventCounts": {},
|
|
253
257
|
"id": null,
|
|
254
258
|
"companyId": "comp_xyz789",
|
|
255
|
-
"
|
|
259
|
+
"appId": "app_ref123",
|
|
256
260
|
"date": "2026-02-15",
|
|
257
261
|
"computedAt": "computedAt",
|
|
258
262
|
"sourceEventCount": null
|
|
@@ -266,7 +270,7 @@ Fields: 12 (10 required)
|
|
|
266
270
|
|-------|------|----------|-------------|
|
|
267
271
|
| id | ['string', 'null'] | no | (Read-only) Firestore document ID. Equal to eventId. |
|
|
268
272
|
| companyId | string | yes | (Immutable) FK → Company document ID. |
|
|
269
|
-
|
|
|
273
|
+
| appId | string | yes | (Immutable) FK → App document ID (D40 sub-tenant scope, renamed per D44). |
|
|
270
274
|
| eventId | string | yes | (Immutable) Client-generated UUID. Matches document ID. |
|
|
271
275
|
| eventName | string | yes | Event name. Free string; canonical vocabulary is encouraged (see CANONICAL_ANALYTICS_EVENT_NAMES). |
|
|
272
276
|
| timestamp | string | yes | Client-side ISO 8601 — "when it happened on device". Can diverge from serverTimestamp for queued offline events. |
|
|
@@ -297,7 +301,7 @@ Example:
|
|
|
297
301
|
{
|
|
298
302
|
"id": null,
|
|
299
303
|
"companyId": "comp_xyz789",
|
|
300
|
-
"
|
|
304
|
+
"appId": "app_ref123",
|
|
301
305
|
"eventId": "eve_ref123",
|
|
302
306
|
"eventName": "eventName",
|
|
303
307
|
"timestamp": "timestamp",
|
|
@@ -327,7 +331,7 @@ Fields: 17 (15 required)
|
|
|
327
331
|
| eventCounts | record<string,integer> | yes | Per-event-name counts — key is the event name (canonical or custom), value is the count within the bucket. |
|
|
328
332
|
| id | ['string', 'null'] | no | (Read-only) Firestore document ID = `YYYY-MM-DD-HH`. |
|
|
329
333
|
| companyId | string | yes | (Immutable) FK → Company document ID. |
|
|
330
|
-
|
|
|
334
|
+
| appId | string | yes | (Immutable) FK → Site document ID (D40). |
|
|
331
335
|
| date | string | yes | (Immutable) `YYYY-MM-DD` UTC for the bucket day. |
|
|
332
336
|
| hour | integer | yes | (Immutable) UTC hour of day, 0–23. |
|
|
333
337
|
| computedAt | FirestoreTimestamp | yes | (Read-only) When this rollup was last (re)computed. |
|
|
@@ -348,7 +352,7 @@ Example:
|
|
|
348
352
|
"eventCounts": {},
|
|
349
353
|
"id": null,
|
|
350
354
|
"companyId": "comp_xyz789",
|
|
351
|
-
"
|
|
355
|
+
"appId": "app_ref123",
|
|
352
356
|
"date": "2026-02-15",
|
|
353
357
|
"hour": 0,
|
|
354
358
|
"computedAt": "computedAt",
|
|
@@ -356,6 +360,88 @@ Example:
|
|
|
356
360
|
}
|
|
357
361
|
```
|
|
358
362
|
|
|
363
|
+
### App
|
|
364
|
+
Fields: 14 (6 required)
|
|
365
|
+
|
|
366
|
+
| Field | Type | Required | Description |
|
|
367
|
+
|-------|------|----------|-------------|
|
|
368
|
+
| id | ['string', 'null'] | no | (Read-only) Firestore document ID, auto-generated. |
|
|
369
|
+
| companyId | string | yes | (Immutable) FK → Company document ID. Scopes all app sub-collections. |
|
|
370
|
+
| name | string | yes | Human-readable app name shown in dashboards. |
|
|
371
|
+
| description | ['string', 'null'] | no | Optional freeform description. |
|
|
372
|
+
| status | AppStatus | yes | Lifecycle status (D41/D44). Clients filter by ACTIVE. |
|
|
373
|
+
| deploymentLinks | array<object> | yes | Ordered list of deployment URLs (web, mobile, PWA, store links). |
|
|
374
|
+
| deploymentLinks[].label | string | yes | Human-readable label shown in dashboards (e.g. "Production", "Staging"). |
|
|
375
|
+
| deploymentLinks[].url | string | yes | Absolute URL or store link. |
|
|
376
|
+
| deploymentLinks[].type | DeploymentLinkType | yes | Link category — drives icon/handler selection. |
|
|
377
|
+
| deploymentLinks[].isPrimary | boolean | no | If true, this link is used as the canonical deployment URL for the App. |
|
|
378
|
+
| expiresAt | any | no | Optional expiration timestamp. When set and elapsed, `isExpired` flips true and status typically moves to EXPIRED. |
|
|
379
|
+
| isExpired | ['boolean', 'null'] | no | (Read-only) Derived — true when `expiresAt` is in the past. Maintained by server trigger. |
|
|
380
|
+
| createdAt | any | no | (Read-only) Server-generated creation timestamp. |
|
|
381
|
+
| updatedAt | any | no | (Read-only) Server-generated update timestamp. |
|
|
382
|
+
| createdBy | string | yes | (Immutable) FK → User/staff UID who created the app. |
|
|
383
|
+
| analyticsEnabled | boolean | yes | Feature flag — when false, clients should not emit analytics events for this app. |
|
|
384
|
+
| lastAnalyticsSync | any | no | (Read-only) Last time the analytics rollup pipeline refreshed `cachedMetrics`. |
|
|
385
|
+
| cachedMetrics | ['object', 'null'] | no | (Read-only, Denormalized) Cached metrics snapshot for quick dashboard rendering. |
|
|
386
|
+
|
|
387
|
+
Example:
|
|
388
|
+
```json
|
|
389
|
+
{
|
|
390
|
+
"id": null,
|
|
391
|
+
"companyId": "comp_xyz789",
|
|
392
|
+
"name": "Amadou Diallo",
|
|
393
|
+
"description": null,
|
|
394
|
+
"status": "status",
|
|
395
|
+
"deploymentLinks": [
|
|
396
|
+
{
|
|
397
|
+
"label": "label",
|
|
398
|
+
"url": "https://storage.example.com/url.jpg",
|
|
399
|
+
"type": "phone"
|
|
400
|
+
}
|
|
401
|
+
],
|
|
402
|
+
"expiresAt": "expiresAt",
|
|
403
|
+
"isExpired": null,
|
|
404
|
+
"createdAt": "createdAt",
|
|
405
|
+
"updatedAt": "updatedAt",
|
|
406
|
+
"createdBy": "staff_k0f1",
|
|
407
|
+
"analyticsEnabled": true,
|
|
408
|
+
"lastAnalyticsSync": "lastAnalyticsSync",
|
|
409
|
+
"cachedMetrics": null
|
|
410
|
+
}
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
### AppPayment
|
|
414
|
+
Fields: 10 (9 required)
|
|
415
|
+
|
|
416
|
+
| Field | Type | Required | Description |
|
|
417
|
+
|-------|------|----------|-------------|
|
|
418
|
+
| id | ['string', 'null'] | no | (Read-only) Firestore document ID, auto-generated. |
|
|
419
|
+
| companyId | string | yes | (Immutable) FK → Company document ID. |
|
|
420
|
+
| appId | string | yes | (Immutable) FK → App document ID (D40 sub-tenant scope, renamed from siteId per D44). |
|
|
421
|
+
| contact | string | yes | Email or E.164 phone number. Matches AllowedUser.contact. |
|
|
422
|
+
| sessionId | string | yes | Payment provider checkout session ID (e.g. Wave). Usable for dedup across dual writes. |
|
|
423
|
+
| transactionId | string | yes | Payment provider transaction ID. |
|
|
424
|
+
| tier | string | yes | Access tier. Free string per app (ING-304 open question). |
|
|
425
|
+
| amount | number | yes | Amount paid. Generalized from amount_xof per D40 decision. |
|
|
426
|
+
| currency | string | yes | Currency code (ISO 4217). Defaults to XOF for legacy SR-Single parity. |
|
|
427
|
+
| paidAt | FirestoreTimestamp | yes | RFC3339Nano UTC when payment was completed. |
|
|
428
|
+
|
|
429
|
+
Example:
|
|
430
|
+
```json
|
|
431
|
+
{
|
|
432
|
+
"id": null,
|
|
433
|
+
"companyId": "comp_xyz789",
|
|
434
|
+
"appId": "app_ref123",
|
|
435
|
+
"contact": "contact",
|
|
436
|
+
"sessionId": "ses_ref123",
|
|
437
|
+
"transactionId": "tra_ref123",
|
|
438
|
+
"tier": "Gold",
|
|
439
|
+
"amount": 45000,
|
|
440
|
+
"currency": "XOF",
|
|
441
|
+
"paidAt": "pai_ref123"
|
|
442
|
+
}
|
|
443
|
+
```
|
|
444
|
+
|
|
359
445
|
### Booking
|
|
360
446
|
Fields: 52 (7 required)
|
|
361
447
|
|
|
@@ -382,9 +468,9 @@ Fields: 52 (7 required)
|
|
|
382
468
|
| bookingDates[].selectedTimeSlots[].isNotMainPurposeReason | string | no | |
|
|
383
469
|
| bookingDates[].selectedTimeSlots[].isNotMainPurposeOtherReason | string | no | |
|
|
384
470
|
| bookingDates[].selectedTimeSlots[]._deleted | boolean | no | Soft-delete flag. Dashboard writes; Mobile filters (IG-6). |
|
|
385
|
-
| bookingDates[].selectedTimeSlots[]._deletedAt | FirestoreTimestamp | no | Firestore Timestamp
|
|
471
|
+
| bookingDates[].selectedTimeSlots[]._deletedAt | FirestoreTimestamp | no | Firestore Timestamp — Admin SDK form: { _seconds, _nanoseconds }. See types/firestore.ts for REST API v1 and client SDK serialization notes (#10). |
|
|
386
472
|
| bookingDates[].selectedTimeSlots[]._deletedBy | string | no | FK → User/staff UID who soft-deleted this item. |
|
|
387
|
-
| bookingDates[].selectedTimeSlots[]._lastModifiedAt | FirestoreTimestamp | no | Firestore Timestamp
|
|
473
|
+
| bookingDates[].selectedTimeSlots[]._lastModifiedAt | FirestoreTimestamp | no | Firestore Timestamp — Admin SDK form: { _seconds, _nanoseconds }. See types/firestore.ts for REST API v1 and client SDK serialization notes (#10). |
|
|
388
474
|
| bookingDates[].selectedTimeSlots[]._lastModifiedBy | string | no | FK → User/staff UID who last modified this item. |
|
|
389
475
|
| bookingDates[].selectedTimeSlots[]._version | number | no | Monotonic version counter for conflict detection. |
|
|
390
476
|
| bookingDates[].slotKitTypes | record<string,string> | yes | Kit type per slot (IG-11). Firebase parity gap — exists in Firestore but Firebase type lacked it. |
|
|
@@ -397,9 +483,9 @@ Fields: 52 (7 required)
|
|
|
397
483
|
| bookingDates[].slotStatusUpdatedAt | record<string,FirestoreTimestamp> | no | |
|
|
398
484
|
| bookingDates[].slotStatusUpdatedBy | record<string,string> | no | |
|
|
399
485
|
| bookingDates[]._deleted | boolean | no | Soft-delete flag. Dashboard writes; Mobile filters (IG-6). |
|
|
400
|
-
| bookingDates[]._deletedAt | FirestoreTimestamp | no | Firestore Timestamp
|
|
486
|
+
| bookingDates[]._deletedAt | FirestoreTimestamp | no | Firestore Timestamp — Admin SDK form: { _seconds, _nanoseconds }. See types/firestore.ts for REST API v1 and client SDK serialization notes (#10). |
|
|
401
487
|
| bookingDates[]._deletedBy | string | no | FK → User/staff UID who soft-deleted this item. |
|
|
402
|
-
| bookingDates[]._lastModifiedAt | FirestoreTimestamp | no | Firestore Timestamp
|
|
488
|
+
| bookingDates[]._lastModifiedAt | FirestoreTimestamp | no | Firestore Timestamp — Admin SDK form: { _seconds, _nanoseconds }. See types/firestore.ts for REST API v1 and client SDK serialization notes (#10). |
|
|
403
489
|
| bookingDates[]._lastModifiedBy | string | no | FK → User/staff UID who last modified this item. |
|
|
404
490
|
| bookingDates[]._version | number | no | Monotonic version counter for conflict detection. |
|
|
405
491
|
| customerId | ['string', 'null'] | no | FK → Customer.id (Firestore doc ID). Links booking to customer record. |
|
|
@@ -429,18 +515,18 @@ Fields: 52 (7 required)
|
|
|
429
515
|
| purchaseId | ['string', 'null'] | no | FK → Sale.id. Link to associated Sale document. |
|
|
430
516
|
| paymentStatusChangeReason | ['string', 'null'] | no | |
|
|
431
517
|
| paymentStatusChangedBy | ['string', 'null'] | no | FK → User/staff UID who changed payment status. |
|
|
432
|
-
| paymentStatusChangedAt | any | no | Firestore Timestamp
|
|
518
|
+
| paymentStatusChangedAt | any | no | Firestore Timestamp — Admin SDK form: { _seconds, _nanoseconds }. See types/firestore.ts for REST API v1 and client SDK serialization notes (#10). |
|
|
433
519
|
| paymentProofUrl | ['string', 'null'] | no | URL to uploaded payment proof image/document. |
|
|
434
520
|
| paymentProofStatus | any | no | Payment proof review status. Used by Order and Booking payment proof workflows. |
|
|
435
|
-
| paymentProofAddedAt | any | no | Firestore Timestamp
|
|
521
|
+
| paymentProofAddedAt | any | no | Firestore Timestamp — Admin SDK form: { _seconds, _nanoseconds }. See types/firestore.ts for REST API v1 and client SDK serialization notes (#10). |
|
|
436
522
|
| paymentProofAddedBy | ['string', 'null'] | no | FK → User/staff UID who uploaded the payment proof. |
|
|
437
523
|
| paymentProofReviewedBy | ['string', 'null'] | no | FK → User/staff UID who reviewed the payment proof. |
|
|
438
|
-
| paymentProofReviewedAt | any | no | Firestore Timestamp
|
|
524
|
+
| paymentProofReviewedAt | any | no | Firestore Timestamp — Admin SDK form: { _seconds, _nanoseconds }. See types/firestore.ts for REST API v1 and client SDK serialization notes (#10). |
|
|
439
525
|
| paymentProofRejectionReason | ['string', 'null'] | no | |
|
|
440
526
|
| cancellationRequestedById | ['string', 'null'] | no | FK → User/staff UID who requested cancellation. |
|
|
441
527
|
| cancellationRequestReason | ['string', 'null'] | no | |
|
|
442
528
|
| cancellationProcessedById | ['string', 'null'] | no | FK → User/staff UID who processed the cancellation. |
|
|
443
|
-
| cancellationProcessedAt | any | no | Firestore Timestamp
|
|
529
|
+
| cancellationProcessedAt | any | no | Firestore Timestamp — Admin SDK form: { _seconds, _nanoseconds }. See types/firestore.ts for REST API v1 and client SDK serialization notes (#10). |
|
|
444
530
|
| cancelledByRole | ['string', 'null'] | no | |
|
|
445
531
|
| cancellationReason | ['string', 'null'] | no | |
|
|
446
532
|
| createdAt | FirestoreTimestamp | yes | (Read-only) Server-generated creation timestamp. |
|
|
@@ -613,7 +699,7 @@ Fields: 17 (12 required)
|
|
|
613
699
|
| customerName | ['string', 'null'] | no | (Denormalized) From Customer.name at write time. |
|
|
614
700
|
| amount | number | yes | |
|
|
615
701
|
| currency | string | yes | Currency code. Locked to XOF (West African CFA franc) for now. |
|
|
616
|
-
| paymentDate | FirestoreTimestamp | yes | Firestore Timestamp
|
|
702
|
+
| paymentDate | FirestoreTimestamp | yes | Firestore Timestamp — Admin SDK form: { _seconds, _nanoseconds }. See types/firestore.ts for REST API v1 and client SDK serialization notes (#10). |
|
|
617
703
|
| paymentMethod | PaymentMethod | yes | Unified payment method set with African + global methods (D02). |
|
|
618
704
|
| referenceNumber | string | yes | Unique payment reference (receipt number, transaction ID, etc.). |
|
|
619
705
|
| allocatedAmount | number | yes | (Read-only) Total amount allocated to bookings/orders/purchases via allocations. Server-calculated. |
|
|
@@ -663,7 +749,7 @@ Fields: 14 (8 required)
|
|
|
663
749
|
| allocatedAmount | number | yes | (Immutable) Amount allocated in this allocation. Set at creation. |
|
|
664
750
|
| transferredToAllocationId | ['string', 'null'] | no | FK → CustomerPaymentAllocation.id. Self-reference for transfer chains. |
|
|
665
751
|
| transferredFromAllocationId | ['string', 'null'] | no | FK → CustomerPaymentAllocation.id. Self-reference for transfer chains. |
|
|
666
|
-
| transferredAt | any | no | Firestore Timestamp
|
|
752
|
+
| transferredAt | any | no | Firestore Timestamp — Admin SDK form: { _seconds, _nanoseconds }. See types/firestore.ts for REST API v1 and client SDK serialization notes (#10). |
|
|
667
753
|
| createdBy | string | yes | (Immutable) FK → User/staff UID who created this allocation. |
|
|
668
754
|
| createdByName | ['string', 'null'] | no | (Immutable, Denormalized) From User display name at creation time. |
|
|
669
755
|
| createdAt | FirestoreTimestamp | yes | (Read-only) Server-generated creation timestamp. |
|
|
@@ -698,8 +784,8 @@ Fields: 15 (9 required)
|
|
|
698
784
|
| name | string | yes | |
|
|
699
785
|
| description | ['string', 'null'] | no | |
|
|
700
786
|
| location | ['string', 'null'] | no | |
|
|
701
|
-
| startDate | FirestoreTimestamp | yes | Firestore Timestamp
|
|
702
|
-
| endDate | any | no | Firestore Timestamp
|
|
787
|
+
| startDate | FirestoreTimestamp | yes | Firestore Timestamp — Admin SDK form: { _seconds, _nanoseconds }. See types/firestore.ts for REST API v1 and client SDK serialization notes (#10). |
|
|
788
|
+
| endDate | any | no | Firestore Timestamp — Admin SDK form: { _seconds, _nanoseconds }. See types/firestore.ts for REST API v1 and client SDK serialization notes (#10). |
|
|
703
789
|
| status | EventStatus | yes | Event lifecycle status (D32). SCREAMING_SNAKE per D04. MIG-09 migrates legacy lowercase values. |
|
|
704
790
|
| maxTickets | ['integer', 'null'] | no | |
|
|
705
791
|
| ticketsSold | integer | yes | (Read-only) Counter: total tickets sold. Updated by Firebase triggers (D28). |
|
|
@@ -879,7 +965,7 @@ Fields: 15 (11 required)
|
|
|
879
965
|
|-------|------|----------|-------------|
|
|
880
966
|
| id | ['string', 'null'] | no | (Read-only) Firestore document ID. 16-byte random hex. |
|
|
881
967
|
| companyId | string | yes | (Immutable) FK → Company document ID. |
|
|
882
|
-
|
|
|
968
|
+
| appId | string | yes | (Immutable) FK → App document ID (D40 sub-tenant scope, renamed per D44). |
|
|
883
969
|
| email | string | yes | Populated if identifier is email; empty string if phone. Mutually exclusive with phone per document. |
|
|
884
970
|
| phone | string | yes | Populated if identifier is E.164 format (starts with +); empty string if email. |
|
|
885
971
|
| ip | string | yes | Client IP from X-Forwarded-For or RemoteAddr. |
|
|
@@ -898,7 +984,7 @@ Example:
|
|
|
898
984
|
{
|
|
899
985
|
"id": null,
|
|
900
986
|
"companyId": "comp_xyz789",
|
|
901
|
-
"
|
|
987
|
+
"appId": "app_ref123",
|
|
902
988
|
"email": "amadou@example.com",
|
|
903
989
|
"phone": "+225 07 00 11 22",
|
|
904
990
|
"ip": "ip",
|
|
@@ -915,7 +1001,7 @@ Example:
|
|
|
915
1001
|
```
|
|
916
1002
|
|
|
917
1003
|
### MetricsCurrent
|
|
918
|
-
Fields:
|
|
1004
|
+
Fields: 30 (25 required)
|
|
919
1005
|
|
|
920
1006
|
| Field | Type | Required | Description |
|
|
921
1007
|
|-------|------|----------|-------------|
|
|
@@ -942,6 +1028,11 @@ Fields: 25 (25 required)
|
|
|
942
1028
|
| lowStockItemsCount | integer | yes | (Read-only) Active stock items where currentQuantity <= minimumQuantity. Current state, always full recalc. |
|
|
943
1029
|
| activeRecurringPaymentsCount | integer | yes | (Read-only) Recurring payments with status ACTIVE. Current state, always full recalc. |
|
|
944
1030
|
| monthlyRecurringRevenue | number | yes | (Read-only) Sum of amount for ACTIVE + MONTHLY recurring payments. Always full recalc. |
|
|
1031
|
+
| escalatedOrdersCount | ['integer', 'null'] | no | (Read-only, Optional) Orders currently in an escalated state. Present once the current aggregator rewrites the document. |
|
|
1032
|
+
| staleOrdersCount | ['integer', 'null'] | no | (Read-only, Optional) Orders that have been in an incomplete status beyond the stale threshold. |
|
|
1033
|
+
| staleBookingsCount | ['integer', 'null'] | no | (Read-only, Optional) Bookings that have been in an incomplete status beyond the stale threshold. |
|
|
1034
|
+
| onHoldOrdersCount | ['integer', 'null'] | no | (Read-only, Optional) Orders currently in an on-hold state. |
|
|
1035
|
+
| paymentsByMethod | ['object', 'null'] | no | (Read-only, Optional) Map of PaymentMethod → total amount for the current day. Empty map {} until first payment. |
|
|
945
1036
|
| computedForDay | string | yes | (Read-only) YYYY-MM-DD string indicating which day these metrics reflect. Used to detect day boundaries and trigger midnight resets. |
|
|
946
1037
|
| generatedAt | FirestoreTimestamp | yes | (Read-only) Server timestamp of the last metrics write. |
|
|
947
1038
|
|
|
@@ -971,13 +1062,18 @@ Example:
|
|
|
971
1062
|
"lowStockItemsCount": 2,
|
|
972
1063
|
"activeRecurringPaymentsCount": 2,
|
|
973
1064
|
"monthlyRecurringRevenue": 0,
|
|
1065
|
+
"escalatedOrdersCount": null,
|
|
1066
|
+
"staleOrdersCount": null,
|
|
1067
|
+
"staleBookingsCount": null,
|
|
1068
|
+
"onHoldOrdersCount": null,
|
|
1069
|
+
"paymentsByMethod": null,
|
|
974
1070
|
"computedForDay": "computedForDay",
|
|
975
1071
|
"generatedAt": "generatedAt"
|
|
976
1072
|
}
|
|
977
1073
|
```
|
|
978
1074
|
|
|
979
1075
|
### MetricsDaily
|
|
980
|
-
Fields:
|
|
1076
|
+
Fields: 31 (26 required)
|
|
981
1077
|
|
|
982
1078
|
| Field | Type | Required | Description |
|
|
983
1079
|
|-------|------|----------|-------------|
|
|
@@ -1004,6 +1100,11 @@ Fields: 26 (26 required)
|
|
|
1004
1100
|
| lowStockItemsCount | integer | yes | (Read-only) Active stock items where currentQuantity <= minimumQuantity. Current state, always full recalc. |
|
|
1005
1101
|
| activeRecurringPaymentsCount | integer | yes | (Read-only) Recurring payments with status ACTIVE. Current state, always full recalc. |
|
|
1006
1102
|
| monthlyRecurringRevenue | number | yes | (Read-only) Sum of amount for ACTIVE + MONTHLY recurring payments. Always full recalc. |
|
|
1103
|
+
| escalatedOrdersCount | ['integer', 'null'] | no | (Read-only, Optional) Orders currently in an escalated state. Present once the current aggregator rewrites the document. |
|
|
1104
|
+
| staleOrdersCount | ['integer', 'null'] | no | (Read-only, Optional) Orders that have been in an incomplete status beyond the stale threshold. |
|
|
1105
|
+
| staleBookingsCount | ['integer', 'null'] | no | (Read-only, Optional) Bookings that have been in an incomplete status beyond the stale threshold. |
|
|
1106
|
+
| onHoldOrdersCount | ['integer', 'null'] | no | (Read-only, Optional) Orders currently in an on-hold state. |
|
|
1107
|
+
| paymentsByMethod | ['object', 'null'] | no | (Read-only, Optional) Map of PaymentMethod → total amount for the current day. Empty map {} until first payment. |
|
|
1007
1108
|
| computedForDay | string | yes | (Read-only) YYYY-MM-DD string indicating which day these metrics reflect. Used to detect day boundaries and trigger midnight resets. |
|
|
1008
1109
|
| generatedAt | FirestoreTimestamp | yes | (Read-only) Server timestamp of the last metrics write. |
|
|
1009
1110
|
| date | string | yes | (Read-only) YYYY-MM-DD document ID repeated as a field. Identifies the day this snapshot covers. |
|
|
@@ -1034,6 +1135,11 @@ Example:
|
|
|
1034
1135
|
"lowStockItemsCount": 2,
|
|
1035
1136
|
"activeRecurringPaymentsCount": 2,
|
|
1036
1137
|
"monthlyRecurringRevenue": 0,
|
|
1138
|
+
"escalatedOrdersCount": null,
|
|
1139
|
+
"staleOrdersCount": null,
|
|
1140
|
+
"staleBookingsCount": null,
|
|
1141
|
+
"onHoldOrdersCount": null,
|
|
1142
|
+
"paymentsByMethod": null,
|
|
1037
1143
|
"computedForDay": "computedForDay",
|
|
1038
1144
|
"generatedAt": "generatedAt",
|
|
1039
1145
|
"date": "2026-02-15"
|
|
@@ -1041,7 +1147,7 @@ Example:
|
|
|
1041
1147
|
```
|
|
1042
1148
|
|
|
1043
1149
|
### MetricsMonthly
|
|
1044
|
-
Fields:
|
|
1150
|
+
Fields: 31 (26 required)
|
|
1045
1151
|
|
|
1046
1152
|
| Field | Type | Required | Description |
|
|
1047
1153
|
|-------|------|----------|-------------|
|
|
@@ -1068,6 +1174,11 @@ Fields: 26 (26 required)
|
|
|
1068
1174
|
| lowStockItemsCount | integer | yes | (Read-only) Active stock items where currentQuantity <= minimumQuantity. Current state, always full recalc. |
|
|
1069
1175
|
| activeRecurringPaymentsCount | integer | yes | (Read-only) Recurring payments with status ACTIVE. Current state, always full recalc. |
|
|
1070
1176
|
| monthlyRecurringRevenue | number | yes | (Read-only) Sum of amount for ACTIVE + MONTHLY recurring payments. Always full recalc. |
|
|
1177
|
+
| escalatedOrdersCount | ['integer', 'null'] | no | (Read-only, Optional) Orders currently in an escalated state. Present once the current aggregator rewrites the document. |
|
|
1178
|
+
| staleOrdersCount | ['integer', 'null'] | no | (Read-only, Optional) Orders that have been in an incomplete status beyond the stale threshold. |
|
|
1179
|
+
| staleBookingsCount | ['integer', 'null'] | no | (Read-only, Optional) Bookings that have been in an incomplete status beyond the stale threshold. |
|
|
1180
|
+
| onHoldOrdersCount | ['integer', 'null'] | no | (Read-only, Optional) Orders currently in an on-hold state. |
|
|
1181
|
+
| paymentsByMethod | ['object', 'null'] | no | (Read-only, Optional) Map of PaymentMethod → total amount for the current day. Empty map {} until first payment. |
|
|
1071
1182
|
| computedForDay | string | yes | (Read-only) YYYY-MM-DD string indicating which day these metrics reflect. Used to detect day boundaries and trigger midnight resets. |
|
|
1072
1183
|
| generatedAt | FirestoreTimestamp | yes | (Read-only) Server timestamp of the last metrics write. |
|
|
1073
1184
|
| month | string | yes | (Read-only) YYYY-MM document ID repeated as a field. Identifies the month this rollup covers. |
|
|
@@ -1098,6 +1209,11 @@ Example:
|
|
|
1098
1209
|
"lowStockItemsCount": 2,
|
|
1099
1210
|
"activeRecurringPaymentsCount": 2,
|
|
1100
1211
|
"monthlyRecurringRevenue": 0,
|
|
1212
|
+
"escalatedOrdersCount": null,
|
|
1213
|
+
"staleOrdersCount": null,
|
|
1214
|
+
"staleBookingsCount": null,
|
|
1215
|
+
"onHoldOrdersCount": null,
|
|
1216
|
+
"paymentsByMethod": null,
|
|
1101
1217
|
"computedForDay": "computedForDay",
|
|
1102
1218
|
"generatedAt": "generatedAt",
|
|
1103
1219
|
"month": "month"
|
|
@@ -1172,7 +1288,7 @@ Fields: 48 (8 required)
|
|
|
1172
1288
|
| id | string | yes | (Read-only) Firestore document ID. Note: some models also have uid; see ID conventions. |
|
|
1173
1289
|
| uid | string | yes | (Read-only) Entity UID. Often mirrors id. |
|
|
1174
1290
|
| companyId | string | yes | (Immutable) FK → Company document ID. Scopes all queries. |
|
|
1175
|
-
|
|
|
1291
|
+
| appId | ['string', 'null'] | no | (Immutable, Optional) FK → App document ID (D43 / ADR-003, renamed from siteId per D44). null = company-wide. |
|
|
1176
1292
|
| orderNumber | string | yes | (Read-only) Server-generated order number. |
|
|
1177
1293
|
| status | OrderStatus | yes | Core lifecycle status (D34, MIG-11). See OrderStatus enum for the legacy value migration mapping. |
|
|
1178
1294
|
| paymentStatus | any | no | Payment lifecycle (D34). Null until payment is initiated. |
|
|
@@ -1192,14 +1308,14 @@ Fields: 48 (8 required)
|
|
|
1192
1308
|
| amountPaid | ['number', 'null'] | no | Amount of `amount` paid to date. Derived from payment allocations. |
|
|
1193
1309
|
| total | ['number', 'null'] | no | Mobile-only legacy total field. Deprecated — use `amount`. |
|
|
1194
1310
|
| createdAt | FirestoreTimestamp | yes | (Read-only) Server-generated creation timestamp. |
|
|
1195
|
-
| orderDate | FirestoreTimestamp | yes | Firestore Timestamp
|
|
1311
|
+
| orderDate | FirestoreTimestamp | yes | Firestore Timestamp — Admin SDK form: { _seconds, _nanoseconds }. See types/firestore.ts for REST API v1 and client SDK serialization notes (#10). |
|
|
1196
1312
|
| PROCESSING_ON | any | no | (Read-only) Timestamp when order entered PROCESSING (D04 SCREAMING_SNAKE). MIG-01 renames from camelCase. |
|
|
1197
1313
|
| COMPLETED_ON | any | no | (Read-only) Timestamp when order completed (D04 SCREAMING_SNAKE). MIG-01 renames from camelCase. |
|
|
1198
1314
|
| CANCELLED_ON | any | no | (Read-only) Timestamp when order cancelled (D04 SCREAMING_SNAKE). MIG-01 renames from camelCase. |
|
|
1199
1315
|
| cancellationReason | ['string', 'null'] | no | |
|
|
1200
1316
|
| shippingCarrier | ['string', 'null'] | no | |
|
|
1201
1317
|
| trackingNumber | ['string', 'null'] | no | |
|
|
1202
|
-
| estimatedDeliveryDate | any | no | Firestore Timestamp
|
|
1318
|
+
| estimatedDeliveryDate | any | no | Firestore Timestamp — Admin SDK form: { _seconds, _nanoseconds }. See types/firestore.ts for REST API v1 and client SDK serialization notes (#10). |
|
|
1203
1319
|
| shippingCost | ['number', 'null'] | no | |
|
|
1204
1320
|
| paymentProofUrl | ['string', 'null'] | no | URL to uploaded payment proof image/document. |
|
|
1205
1321
|
| paymentProofStatus | any | no | Payment proof review status. |
|
|
@@ -1224,7 +1340,7 @@ Example:
|
|
|
1224
1340
|
"id": "bk_abc123def456",
|
|
1225
1341
|
"uid": "user_u8x92kqm",
|
|
1226
1342
|
"companyId": "comp_xyz789",
|
|
1227
|
-
"
|
|
1343
|
+
"appId": null,
|
|
1228
1344
|
"orderNumber": "ORD-2026-0042",
|
|
1229
1345
|
"status": "status",
|
|
1230
1346
|
"paymentStatus": "paymentStatus",
|
|
@@ -1323,7 +1439,7 @@ Fields: 12 (1 required)
|
|
|
1323
1439
|
| notes | ['string', 'null'] | no | |
|
|
1324
1440
|
| orderId | ['string', 'null'] | no | FK → Order.id. Link to associated Order document. |
|
|
1325
1441
|
| bookingId | ['string', 'null'] | no | FK → Booking.id. Link to associated Booking document (IG-12). |
|
|
1326
|
-
| purchaseDate | FirestoreTimestamp | yes | Firestore Timestamp
|
|
1442
|
+
| purchaseDate | FirestoreTimestamp | yes | Firestore Timestamp — Admin SDK form: { _seconds, _nanoseconds }. See types/firestore.ts for REST API v1 and client SDK serialization notes (#10). |
|
|
1327
1443
|
| createdAt | any | no | (Read-only) Server-generated creation timestamp. |
|
|
1328
1444
|
|
|
1329
1445
|
Example:
|
|
@@ -1568,6 +1684,36 @@ Example:
|
|
|
1568
1684
|
}
|
|
1569
1685
|
```
|
|
1570
1686
|
|
|
1687
|
+
### User
|
|
1688
|
+
Fields: 9 (0 required)
|
|
1689
|
+
|
|
1690
|
+
| Field | Type | Required | Description |
|
|
1691
|
+
|-------|------|----------|-------------|
|
|
1692
|
+
| id | ['string', 'null'] | no | (Read-only) Firebase Auth UID. Matches the Firestore document ID. |
|
|
1693
|
+
| displayName | ['string', 'null'] | no | User display name from Firebase Auth or manually set. |
|
|
1694
|
+
| email | ['string', 'null'] | no | Email address. Present for email/Google auth users. |
|
|
1695
|
+
| phoneE164 | ['string', 'null'] | no | E.164-normalized phone number (e.g. +2250777471485). Canonical phone identity field; used for WhatsApp OTP lookup via indexed query. |
|
|
1696
|
+
| companyId | ['string', 'null'] | no | (Immutable) FK → Company document ID. Present for staff accounts scoped to a company. |
|
|
1697
|
+
| role | ['string', 'null'] | no | Staff role within the company (e.g. admin, manager, staff). Application-defined. |
|
|
1698
|
+
| isActive | ['boolean', 'null'] | no | Whether this user account is active. Inactive accounts are denied access. |
|
|
1699
|
+
| createdAt | any | no | (Read-only) When the user document was created. |
|
|
1700
|
+
| updatedAt | any | no | (Read-only) When the user document was last updated. |
|
|
1701
|
+
|
|
1702
|
+
Example:
|
|
1703
|
+
```json
|
|
1704
|
+
{
|
|
1705
|
+
"id": null,
|
|
1706
|
+
"displayName": null,
|
|
1707
|
+
"email": null,
|
|
1708
|
+
"phoneE164": null,
|
|
1709
|
+
"companyId": null,
|
|
1710
|
+
"role": null,
|
|
1711
|
+
"isActive": null,
|
|
1712
|
+
"createdAt": "createdAt",
|
|
1713
|
+
"updatedAt": "updatedAt"
|
|
1714
|
+
}
|
|
1715
|
+
```
|
|
1716
|
+
|
|
1571
1717
|
### WhatsappInboundMessage
|
|
1572
1718
|
Fields: 13 (7 required)
|
|
1573
1719
|
|