@ingenx-io/valets-schema-mcp-server 0.1.2 → 0.1.3

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 (37) hide show
  1. package/data/docs/collections/firestore-paths.md +1 -0
  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/event-status.md +1 -1
  7. package/data/docs/enums/fulfillment-status.md +1 -1
  8. package/data/docs/enums/loyalty-transaction-type.md +1 -1
  9. package/data/docs/enums/order-status.md +1 -1
  10. package/data/docs/enums/payment-method.md +1 -1
  11. package/data/docs/enums/payment-proof-status.md +1 -1
  12. package/data/docs/enums/payment-status.md +1 -1
  13. package/data/docs/enums/return-status.md +1 -1
  14. package/data/docs/enums/session-status.md +1 -1
  15. package/data/docs/enums/ticket-status.md +1 -1
  16. package/data/docs/index.md +7 -0
  17. package/data/docs/models/booking-version.md +1 -1
  18. package/data/docs/models/booking.md +1 -1
  19. package/data/docs/models/customer-payment-allocation.md +1 -1
  20. package/data/docs/models/customer-payment.md +1 -1
  21. package/data/docs/models/customer.md +1 -1
  22. package/data/docs/models/event.md +1 -1
  23. package/data/docs/models/loyalty-config.md +1 -1
  24. package/data/docs/models/loyalty-reward.md +1 -1
  25. package/data/docs/models/loyalty-status.md +1 -1
  26. package/data/docs/models/loyalty-transaction.md +1 -1
  27. package/data/docs/models/metrics-current.md +1 -1
  28. package/data/docs/models/metrics-daily.md +1 -1
  29. package/data/docs/models/metrics-monthly.md +1 -1
  30. package/data/docs/models/order-item.md +1 -1
  31. package/data/docs/models/order.md +1 -1
  32. package/data/docs/models/payment-summary.md +123 -0
  33. package/data/docs/models/sale.md +1 -1
  34. package/data/docs/models/ticket.md +1 -1
  35. package/data/static/llms.txt +11 -1
  36. package/data/static/schemas.json +44 -1
  37. package/package.json +1 -1
@@ -19,6 +19,7 @@ companies/{companyId}/
19
19
  ├── sales/{saleId}
20
20
  ├── purchases/{purchaseId}
21
21
  ├── customerPayments/{paymentId}
22
+ ├── paymentSummaries/{period}
22
23
  ├── loyaltyTransactions/{transactionId}
23
24
  └── loyaltyConfig (singleton document)
24
25
  ```
@@ -23,4 +23,4 @@ Must be one of:
23
23
  * "COMPLETED_MIXED"
24
24
 
25
25
  ----------------------------------------------------------------------------------------------------------------------------
26
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
26
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
@@ -23,4 +23,4 @@ Must be one of:
23
23
  * "CANCELLED"
24
24
 
25
25
  ----------------------------------------------------------------------------------------------------------------------------
26
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
26
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
@@ -20,4 +20,4 @@ Must be one of:
20
20
  * "PURCHASE"
21
21
 
22
22
  ----------------------------------------------------------------------------------------------------------------------------
23
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
23
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
@@ -20,4 +20,4 @@ Must be one of:
20
20
  * "DELIVERY"
21
21
 
22
22
  ----------------------------------------------------------------------------------------------------------------------------
23
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
23
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
@@ -21,7 +21,7 @@ Must be one of:
21
21
  * "COMPLETED"
22
22
 
23
23
  ----------------------------------------------------------------------------------------------------------------------------
24
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
24
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
25
25
 
26
26
  ## Related Decisions
27
27
 
@@ -23,7 +23,7 @@ Must be one of:
23
23
  * "PICKED_UP"
24
24
 
25
25
  ----------------------------------------------------------------------------------------------------------------------------
26
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
26
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
27
27
 
28
28
  ## Related Decisions
29
29
 
@@ -23,7 +23,7 @@ Must be one of:
23
23
  * "REFUND"
24
24
 
25
25
  ----------------------------------------------------------------------------------------------------------------------------
26
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
26
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
27
27
 
28
28
  ## Related Decisions
29
29
 
@@ -24,7 +24,7 @@ Must be one of:
24
24
  * "EXPIRED"
25
25
 
26
26
  ----------------------------------------------------------------------------------------------------------------------------
27
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
27
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
28
28
 
29
29
  ## Related Decisions
30
30
 
@@ -27,7 +27,7 @@ Must be one of:
27
27
  * "OTHER"
28
28
 
29
29
  ----------------------------------------------------------------------------------------------------------------------------
30
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
30
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
31
31
 
32
32
  ## Related Decisions
33
33
 
@@ -20,4 +20,4 @@ Must be one of:
20
20
  * "REJECTED"
21
21
 
22
22
  ----------------------------------------------------------------------------------------------------------------------------
23
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
23
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
@@ -24,7 +24,7 @@ Must be one of:
24
24
  * "PARTIALLY_REFUNDED"
25
25
 
26
26
  ----------------------------------------------------------------------------------------------------------------------------
27
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
27
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
28
28
 
29
29
  ## Related Decisions
30
30
 
@@ -23,7 +23,7 @@ Must be one of:
23
23
  * "EXCHANGE_COMPLETED"
24
24
 
25
25
  ----------------------------------------------------------------------------------------------------------------------------
26
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
26
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
27
27
 
28
28
  ## Related Decisions
29
29
 
@@ -23,7 +23,7 @@ Must be one of:
23
23
  * "CANCELLED"
24
24
 
25
25
  ----------------------------------------------------------------------------------------------------------------------------
26
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
26
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
27
27
 
28
28
  ## Related Decisions
29
29
 
@@ -20,7 +20,7 @@ Must be one of:
20
20
  * "CANCELLED"
21
21
 
22
22
  ----------------------------------------------------------------------------------------------------------------------------
23
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
23
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
24
24
 
25
25
  ## Related Decisions
26
26
 
@@ -79,6 +79,13 @@ Core Firestore document schemas:
79
79
 
80
80
 
81
81
 
82
+ | Enum | Values | Description |
83
+ |------|--------|-------------|
84
+ | [AttentionStatus](proposed/enums/attention-status) | 4 values | Operational attention status for Order and Booking (D39). Controls home-page queue assignment. Server-owned — set via triggers or callable fn only. |
85
+ | [PendingIssue](proposed/enums/pending-issue) | 11 values | Specific detected conditions on an Order or Booking requiring human action (D39). Stored as an array — multiple issues can be active simultaneously. Server-owned. |
86
+
87
+
88
+
82
89
 
83
90
  ## Machine-friendly formats
84
91
 
@@ -270,7 +270,7 @@ Dot-notation paths for nested fields (e.g. "bookingDates.0.status"). Populated b
270
270
  | **Additional properties** | Any type allowed |
271
271
 
272
272
  ----------------------------------------------------------------------------------------------------------------------------
273
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
273
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
274
274
 
275
275
  :::warning Server-set
276
276
  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.
@@ -1739,7 +1739,7 @@ Set at creation only. This field cannot be modified after the document is create
1739
1739
  **Description:** When true, suppresses Firebase notification triggers (D20/IG-8).
1740
1740
 
1741
1741
  ----------------------------------------------------------------------------------------------------------------------------
1742
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
1742
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
1743
1743
 
1744
1744
  ## Related Decisions
1745
1745
 
@@ -329,7 +329,7 @@ Set at creation only. This field cannot be modified after the document is create
329
329
  | **Maximum** | ≤ 9007199254740991 |
330
330
 
331
331
  ----------------------------------------------------------------------------------------------------------------------------
332
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
332
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
333
333
 
334
334
  :::warning Server-set
335
335
  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.
@@ -379,7 +379,7 @@ Do not include in write requests. This field is set exclusively by the server (F
379
379
  | **Required** | No |
380
380
 
381
381
  ----------------------------------------------------------------------------------------------------------------------------
382
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
382
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
383
383
 
384
384
  :::warning Server-set
385
385
  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.
@@ -459,7 +459,7 @@ Do not include in write requests. This field is set exclusively by the server (F
459
459
  **Description:** (Read-only, Denormalized) Derived summary from loyalty/status subcollection (D08). Source of truth is LoyaltyStatus.pointsBalance.
460
460
 
461
461
  ----------------------------------------------------------------------------------------------------------------------------
462
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
462
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
463
463
 
464
464
  :::warning Server-set
465
465
  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.
@@ -372,7 +372,7 @@ Do not include in write requests. This field is set exclusively by the server (F
372
372
  **Description:** (Immutable) FK → User/staff UID who created this event.
373
373
 
374
374
  ----------------------------------------------------------------------------------------------------------------------------
375
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
375
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
376
376
 
377
377
  :::info Immutable
378
378
  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.
@@ -304,7 +304,7 @@ Do not include in write requests. This field is set exclusively by the server (F
304
304
  | **Required** | No |
305
305
 
306
306
  ----------------------------------------------------------------------------------------------------------------------------
307
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
307
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
308
308
 
309
309
  :::warning Server-set
310
310
  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.
@@ -229,7 +229,7 @@ Do not include in write requests. This field is set exclusively by the server (F
229
229
  | **Required** | No |
230
230
 
231
231
  ----------------------------------------------------------------------------------------------------------------------------
232
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
232
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
233
233
 
234
234
  :::warning Server-set
235
235
  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.
@@ -315,7 +315,7 @@ Do not include in write requests. This field is set exclusively by the server (F
315
315
  | **Required** | No |
316
316
 
317
317
  ----------------------------------------------------------------------------------------------------------------------------
318
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
318
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
319
319
 
320
320
  :::warning Server-set
321
321
  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.
@@ -313,7 +313,7 @@ Set at creation only. This field cannot be modified after the document is create
313
313
  **Description:** (Immutable, Denormalized) From User display name at creation time.
314
314
 
315
315
  ----------------------------------------------------------------------------------------------------------------------------
316
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
316
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
317
317
 
318
318
  :::info Immutable
319
319
  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.
@@ -525,7 +525,7 @@ Do not include in write requests. This field is set exclusively by the server (F
525
525
  | **Maximum** | ≤ 9007199254740991 |
526
526
 
527
527
  ----------------------------------------------------------------------------------------------------------------------------
528
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
528
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
529
529
 
530
530
  :::warning Server-set
531
531
  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.
@@ -541,7 +541,7 @@ Do not include in write requests. This field is set exclusively by the server (F
541
541
  **Description:** (Read-only) YYYY-MM-DD document ID repeated as a field. Identifies the day this snapshot covers.
542
542
 
543
543
  ----------------------------------------------------------------------------------------------------------------------------
544
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
544
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
545
545
 
546
546
  :::warning Server-set
547
547
  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.
@@ -541,7 +541,7 @@ Do not include in write requests. This field is set exclusively by the server (F
541
541
  **Description:** (Read-only) YYYY-MM document ID repeated as a field. Identifies the month this rollup covers.
542
542
 
543
543
  ----------------------------------------------------------------------------------------------------------------------------
544
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
544
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
545
545
 
546
546
  :::warning Server-set
547
547
  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.
@@ -350,7 +350,7 @@ TBD/WIP — Originally from the archived Couchbase Lite (CBL) restaurant flow. C
350
350
  | **Required** | No |
351
351
 
352
352
  ----------------------------------------------------------------------------------------------------------------------------
353
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
353
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
354
354
 
355
355
  :::warning Server-set
356
356
  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.
@@ -1624,7 +1624,7 @@ Set only by the mobile app when the user manually edits the order total. Dashboa
1624
1624
  **Description:** FK → Sale.id. Link to associated Sale document.
1625
1625
 
1626
1626
  ----------------------------------------------------------------------------------------------------------------------------
1627
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
1627
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
1628
1628
 
1629
1629
  ## Related Decisions
1630
1630
 
@@ -0,0 +1,123 @@
1
+ ---
2
+ title: "PaymentSummary"
3
+ sidebar_label: "PaymentSummary"
4
+ sidebar_position: 99
5
+ ---
6
+
7
+ # PaymentSummary
8
+
9
+ **Collection:** `companies/{companyId}/paymentSummaries/{period}`
10
+
11
+ Aggregated payment totals broken down by payment method for a given period. This is a **server-owned, read-only** model — clients never write to it directly. It is maintained by Cloud Function triggers that fire on `Order.payments[]` and `CustomerPayment` changes.
12
+
13
+ ## Schema
14
+
15
+ <details>
16
+ <summary>Example JSON</summary>
17
+
18
+ ```json
19
+ {
20
+ "id": "2026-03-09",
21
+ "companyId": "comp_xyz789",
22
+ "period": "2026-03-09",
23
+ "periodType": "DAILY",
24
+ "paymentsByMethod": {
25
+ "CASH": { "total": 245000, "count": 12 },
26
+ "WAVE": { "total": 180000, "count": 8 },
27
+ "ORANGE_MONEY": { "total": 95000, "count": 5 }
28
+ },
29
+ "grandTotal": 520000,
30
+ "totalCount": 25,
31
+ "currency": "XOF",
32
+ "lastUpdatedAt": { "_seconds": 1741478400, "_nanoseconds": 0 },
33
+ "createdAt": { "_seconds": 1741435200, "_nanoseconds": 0 }
34
+ }
35
+ ```
36
+
37
+ </details>
38
+
39
+ ## Fields
40
+
41
+ | Field | Type | Required | Description |
42
+ |-------|------|----------|-------------|
43
+ | `id` | `string` | — | (Read-only) Document ID. Matches the period key. |
44
+ | `companyId` | `string` | + | (Immutable) FK → Company document ID. |
45
+ | `period` | `string` | + | Period key: `YYYY-MM-DD` (daily), `YYYY-Www` (weekly), `YYYY-MM` (monthly). |
46
+ | `periodType` | `enum` | + | `DAILY`, `WEEKLY`, or `MONTHLY`. |
47
+ | `paymentsByMethod` | `map` | + | Keyed by PaymentMethod enum value. Each value has `total` (number) and `count` (integer). |
48
+ | `grandTotal` | `number` | + | (Read-only) Sum of all `paymentsByMethod[*].total`. |
49
+ | `totalCount` | `integer` | + | (Read-only) Sum of all `paymentsByMethod[*].count`. |
50
+ | `currency` | `string` | + | Locked to `XOF`. |
51
+ | `lastUpdatedAt` | `Timestamp` | — | (Read-only) Last increment timestamp. |
52
+ | `createdAt` | `Timestamp` | + | (Read-only) Server-generated creation timestamp. |
53
+
54
+ :::info PaymentMethod keys
55
+ The `paymentsByMethod` map uses [PaymentMethod](/enums/payment-method) enum values as keys: `CASH`, `WAVE`, `ORANGE_MONEY`, `CREDIT_CARD`, etc. Missing keys imply zero for that method.
56
+ :::
57
+
58
+ :::warning Server-owned
59
+ This document is entirely server-set. All fields are computed by Cloud Function triggers. Clients should treat it as read-only.
60
+ :::
61
+
62
+ ## Trigger design
63
+
64
+ ### Source events
65
+
66
+ The summary is updated by **two independent triggers**:
67
+
68
+ 1. **`onOrderPaymentChange`** — fires when `Order.payments[]` array changes (new payment added or existing payment updated). Computes the delta and applies `FieldValue.increment()` to the matching `paymentsByMethod.{method}.total` and `.count`, plus `grandTotal` and `totalCount`.
69
+
70
+ 2. **`onCustomerPaymentWrite`** — fires on `CustomerPayment` create/update. Same increment logic for standalone customer payments not tied to an order.
71
+
72
+ ### Increment pattern
73
+
74
+ ```typescript
75
+ // Pseudo-code for the trigger
76
+ const summaryRef = db.doc(
77
+ `companies/${companyId}/paymentSummaries/${todayKey}`
78
+ );
79
+
80
+ await summaryRef.set({
81
+ companyId,
82
+ period: todayKey,
83
+ periodType: 'DAILY',
84
+ currency: 'XOF',
85
+ [`paymentsByMethod.${method}.total`]: FieldValue.increment(amount),
86
+ [`paymentsByMethod.${method}.count`]: FieldValue.increment(1),
87
+ grandTotal: FieldValue.increment(amount),
88
+ totalCount: FieldValue.increment(1),
89
+ lastUpdatedAt: FieldValue.serverTimestamp(),
90
+ createdAt: FieldValue.serverTimestamp(), // only sets on first write (merge)
91
+ }, { merge: true });
92
+ ```
93
+
94
+ ### Idempotency
95
+
96
+ To avoid double-counting on trigger retries, the trigger should check if the payment has already been counted (e.g., via a `_summarized` flag on the payment or by comparing `before`/`after` snapshots in the `onUpdate` trigger).
97
+
98
+ ### Rollups
99
+
100
+ A scheduled Cloud Function (daily at midnight WAT) can roll up daily summaries into weekly and monthly documents. This is optional — daily granularity alone may be sufficient for the dashboard.
101
+
102
+ ## Querying
103
+
104
+ ```typescript
105
+ // Get today's summary
106
+ const today = '2026-03-09';
107
+ const snap = await db.doc(`companies/${companyId}/paymentSummaries/${today}`).get();
108
+ const summary = snap.data(); // PaymentSummary
109
+
110
+ // Get summaries for a date range
111
+ const snaps = await db.collection(`companies/${companyId}/paymentSummaries`)
112
+ .where('periodType', '==', 'DAILY')
113
+ .where('period', '>=', '2026-03-01')
114
+ .where('period', '<=', '2026-03-09')
115
+ .get();
116
+ ```
117
+
118
+ ## Related
119
+
120
+ - [PaymentMethod](/enums/payment-method) — enum used as map keys
121
+ - [CustomerPayment](/models/customer-payment) — source event for trigger
122
+ - [Order](/models/order) — `payments[]` array is the other source event
123
+ - Decision D02 — Unified PaymentMethod enum
@@ -524,7 +524,7 @@ Set at creation only. This field cannot be modified after the document is create
524
524
  | **Required** | No |
525
525
 
526
526
  ----------------------------------------------------------------------------------------------------------------------------
527
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-03-09 at 13:15:53 +0000
527
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +0000
528
528
 
529
529
  :::warning Server-set
530
530
  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-03-09 at 13:15:53 +0000
391
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-04-06 at 19:27:48 +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.
@@ -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-03-09
7
+ > Generated: 2026-04-06
8
8
 
9
9
  ---
10
10
 
@@ -1004,6 +1004,16 @@ Example:
1004
1004
 
1005
1005
  > These schemas are under review and not yet part of @valets/schema. Shape may change.
1006
1006
 
1007
+ ### Proposed Enums
1008
+
1009
+ #### AttentionStatus [proposed]
1010
+ Operational attention status for Order and Booking (D39). Controls home-page queue assignment. Server-owned — set via triggers or callable fn only.
1011
+ Values: ACTIVE, STALE, ON_HOLD, ESCALATED
1012
+
1013
+ #### PendingIssue [proposed]
1014
+ Specific detected conditions on an Order or Booking requiring human action (D39). Stored as an array — multiple issues can be active simultaneously. Server-owned.
1015
+ Values: PAYMENT_PROOF_PENDING, PAYMENT_PROOF_REJECTED, AMOUNT_DISCREPANCY, RETURN_UNRESOLVED, OVERDUE_DELIVERY, SESSION_OVERDUE, PAYMENT_INCOMPLETE, CANCELLATION_REQUESTED, UNREFUNDED_CANCELLATION, UPCOMING_UNPAID, NO_SHOW_UNRESOLVED
1016
+
1007
1017
  ### Proposed Models
1008
1018
 
1009
1019
  #### PaymentSummary [proposed]
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "description": "@valets/schema \u2014 consolidated schema bundle",
4
- "generated": "2026-03-09T13:15:53.632648+00:00",
4
+ "generated": "2026-04-06T19:27:48.749605+00:00",
5
5
  "schemas": {
6
6
  "booking": {
7
7
  "type": "object",
@@ -3846,6 +3846,24 @@
3846
3846
  ],
3847
3847
  "description": "Event ticket status (D32). VALID = active and unused."
3848
3848
  },
3849
+ "attention-status": {
3850
+ "type": "string",
3851
+ "enum": [
3852
+ "ACTIVE",
3853
+ "STALE",
3854
+ "ON_HOLD",
3855
+ "ESCALATED"
3856
+ ],
3857
+ "description": "Operational attention status for Order and Booking (D39). Controls home-page queue assignment. Server-owned \u2014 set via triggers or callable fn only.",
3858
+ "x-note": "ACTIVE = normal urgent queue (default). STALE = idle past threshold, moved to review queue \u2014 excluded from pendingOrdersCount. ON_HOLD = intentionally paused by manager via callable fn. ESCALATED = ignored past second threshold.",
3859
+ "x-see": {
3860
+ "decisions": [
3861
+ "D39"
3862
+ ]
3863
+ },
3864
+ "x-when": "Set by server automation or callable fn. Mobile and Dashboard read this field; never write it directly. ON_HOLD is the only human-initiated transition \u2014 goes through a dedicated callable function.",
3865
+ "x-status": "proposed"
3866
+ },
3849
3867
  "payment-summary": {
3850
3868
  "type": "object",
3851
3869
  "properties": {
@@ -4007,6 +4025,31 @@
4007
4025
  "additionalProperties": false,
4008
4026
  "description": "Aggregated payment totals by method for a given period. Collection: companies/{companyId}/paymentSummaries/{period}. Server-owned \u2014 all fields are set by Cloud Function triggers on Order.payments[] and CustomerPayment writes. Clients must never write to this collection.",
4009
4027
  "x-status": "proposed"
4028
+ },
4029
+ "pending-issue": {
4030
+ "type": "string",
4031
+ "enum": [
4032
+ "PAYMENT_PROOF_PENDING",
4033
+ "PAYMENT_PROOF_REJECTED",
4034
+ "AMOUNT_DISCREPANCY",
4035
+ "RETURN_UNRESOLVED",
4036
+ "OVERDUE_DELIVERY",
4037
+ "SESSION_OVERDUE",
4038
+ "PAYMENT_INCOMPLETE",
4039
+ "CANCELLATION_REQUESTED",
4040
+ "UNREFUNDED_CANCELLATION",
4041
+ "UPCOMING_UNPAID",
4042
+ "NO_SHOW_UNRESOLVED"
4043
+ ],
4044
+ "description": "Specific detected conditions on an Order or Booking requiring human action (D39). Stored as an array \u2014 multiple issues can be active simultaneously. Server-owned.",
4045
+ "x-note": "Shared: PAYMENT_PROOF_PENDING (proof uploaded, awaiting review), PAYMENT_PROOF_REJECTED (proof rejected, needs resubmission), AMOUNT_DISCREPANCY (amountPaid does not reconcile with amount/paymentStatus). Order-only: RETURN_UNRESOLVED (return/exchange stuck), OVERDUE_DELIVERY (estimatedDeliveryDate past, not yet delivered). Booking-only: SESSION_OVERDUE (session date passed, status not updated), PAYMENT_INCOMPLETE (sessions completed but payment not recorded), CANCELLATION_REQUESTED (cancellation not actioned), UNREFUNDED_CANCELLATION (cancelled with amountPaid > 0 and no refund), UPCOMING_UNPAID (session within 48h, payment not recorded), NO_SHOW_UNRESOLVED (no-show without follow-up).",
4046
+ "x-see": {
4047
+ "decisions": [
4048
+ "D39"
4049
+ ]
4050
+ },
4051
+ "x-when": "Set and cleared by server automation or triggers. Never affects pendingOrdersCount or pendingBookingsCount \u2014 orthogonal to urgency. Multiple values can be active at once (stored as PendingIssue[] on Order/Booking).",
4052
+ "x-status": "proposed"
4010
4053
  }
4011
4054
  }
4012
4055
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ingenx-io/valets-schema-mcp-server",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "MCP server exposing @valets/schema documentation to AI agents",
5
5
  "type": "module",
6
6
  "main": "index.js",