@ingenx-io/valets-schema-mcp-server 0.2.5 → 0.2.6
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/data/docs/enums/app-status.md +1 -1
- package/data/docs/enums/attention-status.md +1 -1
- package/data/docs/enums/booking-status.md +1 -1
- package/data/docs/enums/contract-status.md +24 -0
- 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/milestone-status.md +23 -0
- 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 +3 -3
- 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 +11 -5
- package/data/docs/models/allowed-user.md +1 -1
- package/data/docs/models/analytics-backfill.md +1 -1
- package/data/docs/models/analytics-daily.md +1 -1
- package/data/docs/models/analytics-event.md +1 -1
- package/data/docs/models/analytics-hourly.md +1 -1
- package/data/docs/models/app-payment.md +1 -1
- package/data/docs/models/app.md +45 -21
- package/data/docs/models/booking-version.md +1 -1
- package/data/docs/models/booking.md +1 -1
- package/data/docs/models/contract.md +454 -0
- package/data/docs/models/customer-payment-allocation.md +2 -2
- package/data/docs/models/customer-payment.md +2 -2
- package/data/docs/models/customer.md +2 -2
- package/data/docs/models/event.md +2 -2
- package/data/docs/models/loyalty-config.md +2 -2
- package/data/docs/models/loyalty-reward.md +2 -2
- package/data/docs/models/loyalty-status.md +2 -2
- package/data/docs/models/loyalty-transaction.md +2 -2
- package/data/docs/models/magic-link-request.md +2 -2
- package/data/docs/models/metrics-current.md +2 -2
- package/data/docs/models/metrics-daily.md +2 -2
- package/data/docs/models/metrics-monthly.md +2 -2
- package/data/docs/models/notification-record.md +2 -2
- package/data/docs/models/order-item.md +2 -2
- package/data/docs/models/order.md +238 -218
- package/data/docs/models/outbound-payment-allocation.md +195 -0
- package/data/docs/models/outbound-payment.md +318 -0
- package/data/docs/models/payment-webhook-endpoint.md +191 -0
- package/data/docs/models/sale.md +2 -2
- package/data/docs/models/site-payment.md +2 -2
- package/data/docs/models/site.md +2 -2
- package/data/docs/models/stocktake-item.md +2 -2
- package/data/docs/models/stocktake.md +2 -2
- package/data/docs/models/ticket.md +2 -2
- package/data/docs/models/user.md +2 -2
- package/data/docs/models/whatsapp-inbound-message.md +6 -2
- package/data/docs/models/whatsapp-outbound-lifecycle-event.md +2 -2
- package/data/docs/models/whatsapp-outbound-message.md +39 -23
- package/data/docs/models/whatsapp-template.md +6 -2
- package/data/static/llms.txt +145 -5
- package/data/static/openapi.yaml +456 -14
- package/data/static/schemas.json +477 -9
- package/package.json +1 -1
package/data/static/schemas.json
CHANGED
|
@@ -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-05-
|
|
4
|
+
"generated": "2026-05-30T13:38:45.949066+00:00",
|
|
5
5
|
"schemas": {
|
|
6
6
|
"allowed-user": {
|
|
7
7
|
"type": "object",
|
|
@@ -745,16 +745,23 @@
|
|
|
745
745
|
]
|
|
746
746
|
},
|
|
747
747
|
"status": {
|
|
748
|
-
"
|
|
749
|
-
|
|
750
|
-
|
|
748
|
+
"anyOf": [
|
|
749
|
+
{
|
|
750
|
+
"$ref": "#/definitions/app-status"
|
|
751
|
+
},
|
|
752
|
+
{
|
|
753
|
+
"type": "null"
|
|
754
|
+
}
|
|
755
|
+
],
|
|
756
|
+
"x-note": "Real Firestore documents may be missing this field on pre-backfill records (#26). Treat absent as ACTIVE. A backfill script will populate status=ACTIVE on all existing documents; once confirmed, this field will be promoted to required.",
|
|
757
|
+
"x-when": "Written by operators via dashboard or by server triggers (expiration). Clients must not use server-side `where(status == ACTIVE)` until backfill is complete \u2014 filter client-side instead, treating absent as ACTIVE.",
|
|
758
|
+
"description": "Lifecycle status (D41/D44). Optional pending backfill of pre-existing records (#26) \u2014 treat absent as ACTIVE. Clients filter by ACTIVE.",
|
|
751
759
|
"x-see": {
|
|
752
760
|
"decisions": [
|
|
753
761
|
"D41",
|
|
754
762
|
"D44"
|
|
755
763
|
]
|
|
756
|
-
}
|
|
757
|
-
"x-when": "Written by operators via dashboard or by server triggers (expiration). Clients filter by ACTIVE."
|
|
764
|
+
}
|
|
758
765
|
},
|
|
759
766
|
"deploymentLinks": {
|
|
760
767
|
"type": "array",
|
|
@@ -915,7 +922,6 @@
|
|
|
915
922
|
"required": [
|
|
916
923
|
"companyId",
|
|
917
924
|
"name",
|
|
918
|
-
"status",
|
|
919
925
|
"deploymentLinks",
|
|
920
926
|
"createdBy",
|
|
921
927
|
"analyticsEnabled"
|
|
@@ -1919,6 +1925,192 @@
|
|
|
1919
1925
|
"snapshot": {}
|
|
1920
1926
|
}
|
|
1921
1927
|
},
|
|
1928
|
+
"contract": {
|
|
1929
|
+
"type": "object",
|
|
1930
|
+
"properties": {
|
|
1931
|
+
"id": {
|
|
1932
|
+
"readOnly": true,
|
|
1933
|
+
"description": "(Read-only) Firestore document ID, auto-generated.",
|
|
1934
|
+
"type": [
|
|
1935
|
+
"string",
|
|
1936
|
+
"null"
|
|
1937
|
+
]
|
|
1938
|
+
},
|
|
1939
|
+
"companyId": {
|
|
1940
|
+
"type": "string",
|
|
1941
|
+
"x-immutable": true,
|
|
1942
|
+
"description": "(Immutable) FK \u2192 Company document ID."
|
|
1943
|
+
},
|
|
1944
|
+
"payeeId": {
|
|
1945
|
+
"type": "string",
|
|
1946
|
+
"x-immutable": true,
|
|
1947
|
+
"description": "(Immutable) FK \u2192 Payee document ID. Full Payee model tracked in #20."
|
|
1948
|
+
},
|
|
1949
|
+
"title": {
|
|
1950
|
+
"type": "string",
|
|
1951
|
+
"description": "Contract title or reference name shown in dashboards."
|
|
1952
|
+
},
|
|
1953
|
+
"description": {
|
|
1954
|
+
"description": "Optional freeform description of the contract scope.",
|
|
1955
|
+
"type": [
|
|
1956
|
+
"string",
|
|
1957
|
+
"null"
|
|
1958
|
+
]
|
|
1959
|
+
},
|
|
1960
|
+
"status": {
|
|
1961
|
+
"$ref": "#/definitions/contract-status",
|
|
1962
|
+
"description": "Contract lifecycle status (#14). Query by ACTIVE \u2014 do not use an isActive boolean."
|
|
1963
|
+
},
|
|
1964
|
+
"currency": {
|
|
1965
|
+
"type": "string",
|
|
1966
|
+
"const": "XOF",
|
|
1967
|
+
"description": "Currency code. Locked to XOF (#18). Multi-currency support requires a deliberate schema version bump."
|
|
1968
|
+
},
|
|
1969
|
+
"totalAmount": {
|
|
1970
|
+
"type": "number",
|
|
1971
|
+
"description": "Total contract value (XOF)."
|
|
1972
|
+
},
|
|
1973
|
+
"startDate": {
|
|
1974
|
+
"type": "string",
|
|
1975
|
+
"description": "Contract start date (ISO 8601 YYYY-MM-DD)."
|
|
1976
|
+
},
|
|
1977
|
+
"endDate": {
|
|
1978
|
+
"description": "Contract end date (ISO 8601 YYYY-MM-DD). Absent for open-ended contracts.",
|
|
1979
|
+
"type": [
|
|
1980
|
+
"string",
|
|
1981
|
+
"null"
|
|
1982
|
+
]
|
|
1983
|
+
},
|
|
1984
|
+
"milestones": {
|
|
1985
|
+
"description": "Ordered list of payment milestones. Embedded in the contract document (#17).",
|
|
1986
|
+
"type": [
|
|
1987
|
+
"array",
|
|
1988
|
+
"null"
|
|
1989
|
+
],
|
|
1990
|
+
"items": {
|
|
1991
|
+
"type": "object",
|
|
1992
|
+
"properties": {
|
|
1993
|
+
"id": {
|
|
1994
|
+
"type": "string",
|
|
1995
|
+
"description": "Client-generated milestone ID (UUID or slug). Unique within the contract."
|
|
1996
|
+
},
|
|
1997
|
+
"title": {
|
|
1998
|
+
"type": "string",
|
|
1999
|
+
"description": "Milestone description or deliverable name."
|
|
2000
|
+
},
|
|
2001
|
+
"amount": {
|
|
2002
|
+
"type": "number",
|
|
2003
|
+
"description": "Amount due at this milestone (XOF)."
|
|
2004
|
+
},
|
|
2005
|
+
"dueDate": {
|
|
2006
|
+
"description": "ISO 8601 date string (YYYY-MM-DD) when the milestone is due. OVERDUE is derived at read time from dueDate \u2014 not stored.",
|
|
2007
|
+
"type": "string"
|
|
2008
|
+
},
|
|
2009
|
+
"status": {
|
|
2010
|
+
"$ref": "#/definitions/milestone-status",
|
|
2011
|
+
"x-note": "Existing Firestore documents may have lowercase values (pending, invoiced, paid) from before this enum was introduced (#17). Normalize on read or via migration script.",
|
|
2012
|
+
"description": "Milestone payment status (#17). OVERDUE is derived at read time from dueDate, not stored."
|
|
2013
|
+
},
|
|
2014
|
+
"invoicedAt": {
|
|
2015
|
+
"$ref": "#/definitions/firestore-timestamp",
|
|
2016
|
+
"description": "When the invoice was issued for this milestone."
|
|
2017
|
+
},
|
|
2018
|
+
"paidAt": {
|
|
2019
|
+
"$ref": "#/definitions/firestore-timestamp",
|
|
2020
|
+
"description": "When payment was received for this milestone."
|
|
2021
|
+
},
|
|
2022
|
+
"notes": {
|
|
2023
|
+
"description": "Optional notes for this milestone.",
|
|
2024
|
+
"type": "string"
|
|
2025
|
+
}
|
|
2026
|
+
},
|
|
2027
|
+
"required": [
|
|
2028
|
+
"id",
|
|
2029
|
+
"title",
|
|
2030
|
+
"amount",
|
|
2031
|
+
"status"
|
|
2032
|
+
],
|
|
2033
|
+
"additionalProperties": false,
|
|
2034
|
+
"description": "ContractMilestone \u2014 embedded sub-object on Contract (#17). Not a separate collection."
|
|
2035
|
+
}
|
|
2036
|
+
},
|
|
2037
|
+
"notes": {
|
|
2038
|
+
"description": "Optional internal notes.",
|
|
2039
|
+
"type": [
|
|
2040
|
+
"string",
|
|
2041
|
+
"null"
|
|
2042
|
+
]
|
|
2043
|
+
},
|
|
2044
|
+
"createdBy": {
|
|
2045
|
+
"type": "string",
|
|
2046
|
+
"x-immutable": true,
|
|
2047
|
+
"description": "(Immutable) FK \u2192 User/staff UID who created the contract."
|
|
2048
|
+
},
|
|
2049
|
+
"createdAt": {
|
|
2050
|
+
"anyOf": [
|
|
2051
|
+
{
|
|
2052
|
+
"$ref": "#/definitions/firestore-timestamp"
|
|
2053
|
+
},
|
|
2054
|
+
{
|
|
2055
|
+
"type": "null"
|
|
2056
|
+
}
|
|
2057
|
+
],
|
|
2058
|
+
"readOnly": true,
|
|
2059
|
+
"description": "(Read-only) Server-generated creation timestamp."
|
|
2060
|
+
},
|
|
2061
|
+
"updatedAt": {
|
|
2062
|
+
"anyOf": [
|
|
2063
|
+
{
|
|
2064
|
+
"$ref": "#/definitions/firestore-timestamp"
|
|
2065
|
+
},
|
|
2066
|
+
{
|
|
2067
|
+
"type": "null"
|
|
2068
|
+
}
|
|
2069
|
+
],
|
|
2070
|
+
"readOnly": true,
|
|
2071
|
+
"description": "(Read-only) Server-generated update timestamp."
|
|
2072
|
+
}
|
|
2073
|
+
},
|
|
2074
|
+
"required": [
|
|
2075
|
+
"companyId",
|
|
2076
|
+
"payeeId",
|
|
2077
|
+
"title",
|
|
2078
|
+
"status",
|
|
2079
|
+
"currency",
|
|
2080
|
+
"totalAmount",
|
|
2081
|
+
"startDate",
|
|
2082
|
+
"createdBy"
|
|
2083
|
+
],
|
|
2084
|
+
"additionalProperties": false,
|
|
2085
|
+
"description": "Contract model (GH#14/#17/#18). Collection: companies/{companyId}/contracts/{contractId}. Service/supplier contract between a company and a Payee. No isActive field \u2014 query by status. Currency locked to XOF. Milestones use MilestoneStatus enum (no stored OVERDUE).",
|
|
2086
|
+
"example": {
|
|
2087
|
+
"id": null,
|
|
2088
|
+
"companyId": "comp_xyz789",
|
|
2089
|
+
"payeeId": "pay_ref123",
|
|
2090
|
+
"title": "title",
|
|
2091
|
+
"description": null,
|
|
2092
|
+
"status": "status",
|
|
2093
|
+
"currency": "XOF",
|
|
2094
|
+
"totalAmount": 45000,
|
|
2095
|
+
"startDate": "2026-02-15",
|
|
2096
|
+
"endDate": null,
|
|
2097
|
+
"milestones": null,
|
|
2098
|
+
"notes": null,
|
|
2099
|
+
"createdBy": "staff_k0f1",
|
|
2100
|
+
"createdAt": "createdAt",
|
|
2101
|
+
"updatedAt": "updatedAt"
|
|
2102
|
+
}
|
|
2103
|
+
},
|
|
2104
|
+
"contract-status": {
|
|
2105
|
+
"type": "string",
|
|
2106
|
+
"enum": [
|
|
2107
|
+
"DRAFT",
|
|
2108
|
+
"ACTIVE",
|
|
2109
|
+
"COMPLETED",
|
|
2110
|
+
"TERMINATED"
|
|
2111
|
+
],
|
|
2112
|
+
"description": "Lifecycle status of a Contract. DRAFT = not yet signed. ACTIVE = in force. COMPLETED = all milestones paid and obligations met. TERMINATED = ended early by either party."
|
|
2113
|
+
},
|
|
1922
2114
|
"customer": {
|
|
1923
2115
|
"type": "object",
|
|
1924
2116
|
"properties": {
|
|
@@ -3992,6 +4184,16 @@
|
|
|
3992
4184
|
"month": "month"
|
|
3993
4185
|
}
|
|
3994
4186
|
},
|
|
4187
|
+
"milestone-status": {
|
|
4188
|
+
"type": "string",
|
|
4189
|
+
"enum": [
|
|
4190
|
+
"PENDING",
|
|
4191
|
+
"INVOICED",
|
|
4192
|
+
"PAID"
|
|
4193
|
+
],
|
|
4194
|
+
"x-note": "OVERDUE is intentionally excluded \u2014 due-date derivation should be computed at read time from dueDate, not stored. Stored OVERDUE would require a cron to keep it consistent. Existing lowercase values (pending, invoiced, paid) from pre-schema documents need normalization on read or via migration (#17).",
|
|
4195
|
+
"description": "Status of a ContractMilestone (#17). PENDING = created, not yet invoiced. INVOICED = invoice issued, awaiting payment. PAID = payment received."
|
|
4196
|
+
},
|
|
3995
4197
|
"notification-channel": {
|
|
3996
4198
|
"type": "string",
|
|
3997
4199
|
"enum": [
|
|
@@ -4288,6 +4490,15 @@
|
|
|
4288
4490
|
"readOnly": true,
|
|
4289
4491
|
"description": "(Read-only) Server-generated order number."
|
|
4290
4492
|
},
|
|
4493
|
+
"followUpUrl": {
|
|
4494
|
+
"x-note": "Standardized casing is followUpUrl (not followUpURL). Mobile legacy code reads both casings for backward compat but writes followUpUrl going forward (#6).",
|
|
4495
|
+
"x-when": "Used by mobile to generate QR codes on printed receipts. If absent, the mobile app derives a deterministic fallback: https://zahoui.web.app/reviews?orderNumber={orderNumber}.",
|
|
4496
|
+
"description": "Optional URL for receipt QR code / post-order follow-up. Canonical casing: followUpUrl (#6).",
|
|
4497
|
+
"type": [
|
|
4498
|
+
"string",
|
|
4499
|
+
"null"
|
|
4500
|
+
]
|
|
4501
|
+
},
|
|
4291
4502
|
"status": {
|
|
4292
4503
|
"$ref": "#/definitions/order-status",
|
|
4293
4504
|
"description": "Core lifecycle status (D34, MIG-11). See OrderStatus enum for the legacy value migration mapping.",
|
|
@@ -4874,6 +5085,7 @@
|
|
|
4874
5085
|
"companyId": "comp_xyz789",
|
|
4875
5086
|
"appId": null,
|
|
4876
5087
|
"orderNumber": "ORD-2026-0042",
|
|
5088
|
+
"followUpUrl": null,
|
|
4877
5089
|
"status": "status",
|
|
4878
5090
|
"paymentStatus": "paymentStatus",
|
|
4879
5091
|
"fulfillmentStatus": "fulfillmentStatus",
|
|
@@ -5196,6 +5408,191 @@
|
|
|
5196
5408
|
],
|
|
5197
5409
|
"description": "Outbound WhatsApp message delivery status. Lifecycle: queued \u2192 sent \u2192 delivered \u2192 read, or queued \u2192 failed. The dashboard creates the message with status `queued`; the whatsapp-server backend owns every transition after, updating in place from Meta delivery callbacks (GH#43)."
|
|
5198
5410
|
},
|
|
5411
|
+
"outbound-payment": {
|
|
5412
|
+
"type": "object",
|
|
5413
|
+
"properties": {
|
|
5414
|
+
"id": {
|
|
5415
|
+
"readOnly": true,
|
|
5416
|
+
"description": "(Read-only) Firestore document ID, auto-generated.",
|
|
5417
|
+
"type": [
|
|
5418
|
+
"string",
|
|
5419
|
+
"null"
|
|
5420
|
+
]
|
|
5421
|
+
},
|
|
5422
|
+
"companyId": {
|
|
5423
|
+
"type": "string",
|
|
5424
|
+
"x-immutable": true,
|
|
5425
|
+
"description": "(Immutable) FK \u2192 Company document ID."
|
|
5426
|
+
},
|
|
5427
|
+
"payeeId": {
|
|
5428
|
+
"type": "string",
|
|
5429
|
+
"x-immutable": true,
|
|
5430
|
+
"description": "(Immutable) FK \u2192 Payee document ID. Full Payee model tracked in #20."
|
|
5431
|
+
},
|
|
5432
|
+
"contractId": {
|
|
5433
|
+
"x-immutable": true,
|
|
5434
|
+
"description": "(Immutable, Optional) FK \u2192 Contract document ID. Absent for ad-hoc payments outside a formal contract.",
|
|
5435
|
+
"type": [
|
|
5436
|
+
"string",
|
|
5437
|
+
"null"
|
|
5438
|
+
]
|
|
5439
|
+
},
|
|
5440
|
+
"amount": {
|
|
5441
|
+
"type": "number",
|
|
5442
|
+
"description": "Amount paid (XOF)."
|
|
5443
|
+
},
|
|
5444
|
+
"currency": {
|
|
5445
|
+
"type": "string",
|
|
5446
|
+
"const": "XOF",
|
|
5447
|
+
"description": "Currency code. Locked to XOF \u2014 consistent with Contract and CustomerPayment."
|
|
5448
|
+
},
|
|
5449
|
+
"method": {
|
|
5450
|
+
"$ref": "#/definitions/payment-method",
|
|
5451
|
+
"description": "Payment method used (e.g. BANK_TRANSFER, MOBILE_MONEY, CHECK)."
|
|
5452
|
+
},
|
|
5453
|
+
"reference": {
|
|
5454
|
+
"description": "Optional payment reference \u2014 bank transaction number, check number, Wave ref, etc.",
|
|
5455
|
+
"type": [
|
|
5456
|
+
"string",
|
|
5457
|
+
"null"
|
|
5458
|
+
]
|
|
5459
|
+
},
|
|
5460
|
+
"paidAt": {
|
|
5461
|
+
"$ref": "#/definitions/firestore-timestamp",
|
|
5462
|
+
"description": "When the payment was made."
|
|
5463
|
+
},
|
|
5464
|
+
"notes": {
|
|
5465
|
+
"description": "Optional internal notes.",
|
|
5466
|
+
"type": [
|
|
5467
|
+
"string",
|
|
5468
|
+
"null"
|
|
5469
|
+
]
|
|
5470
|
+
},
|
|
5471
|
+
"createdBy": {
|
|
5472
|
+
"type": "string",
|
|
5473
|
+
"x-immutable": true,
|
|
5474
|
+
"description": "(Immutable) FK \u2192 User/staff UID who recorded the payment."
|
|
5475
|
+
},
|
|
5476
|
+
"createdAt": {
|
|
5477
|
+
"anyOf": [
|
|
5478
|
+
{
|
|
5479
|
+
"$ref": "#/definitions/firestore-timestamp"
|
|
5480
|
+
},
|
|
5481
|
+
{
|
|
5482
|
+
"type": "null"
|
|
5483
|
+
}
|
|
5484
|
+
],
|
|
5485
|
+
"readOnly": true,
|
|
5486
|
+
"description": "(Read-only) Server-generated creation timestamp."
|
|
5487
|
+
},
|
|
5488
|
+
"updatedAt": {
|
|
5489
|
+
"anyOf": [
|
|
5490
|
+
{
|
|
5491
|
+
"$ref": "#/definitions/firestore-timestamp"
|
|
5492
|
+
},
|
|
5493
|
+
{
|
|
5494
|
+
"type": "null"
|
|
5495
|
+
}
|
|
5496
|
+
],
|
|
5497
|
+
"readOnly": true,
|
|
5498
|
+
"description": "(Read-only) Server-generated update timestamp."
|
|
5499
|
+
}
|
|
5500
|
+
},
|
|
5501
|
+
"required": [
|
|
5502
|
+
"companyId",
|
|
5503
|
+
"payeeId",
|
|
5504
|
+
"amount",
|
|
5505
|
+
"currency",
|
|
5506
|
+
"method",
|
|
5507
|
+
"paidAt",
|
|
5508
|
+
"createdBy"
|
|
5509
|
+
],
|
|
5510
|
+
"additionalProperties": false,
|
|
5511
|
+
"description": "OutboundPayment (GH#15). Collection: companies/{companyId}/outboundPayments/{paymentId}. Single outbound transfer to a Payee. Canonical name chosen over SupplierPayment/VendorPayment \u2014 direction-based, agnostic of payee type. Currency locked to XOF.",
|
|
5512
|
+
"example": {
|
|
5513
|
+
"id": null,
|
|
5514
|
+
"companyId": "comp_xyz789",
|
|
5515
|
+
"payeeId": "pay_ref123",
|
|
5516
|
+
"contractId": null,
|
|
5517
|
+
"amount": 45000,
|
|
5518
|
+
"currency": "XOF",
|
|
5519
|
+
"method": "method",
|
|
5520
|
+
"reference": null,
|
|
5521
|
+
"paidAt": "pai_ref123",
|
|
5522
|
+
"notes": null,
|
|
5523
|
+
"createdBy": "staff_k0f1",
|
|
5524
|
+
"createdAt": "createdAt",
|
|
5525
|
+
"updatedAt": "updatedAt"
|
|
5526
|
+
}
|
|
5527
|
+
},
|
|
5528
|
+
"outbound-payment-allocation": {
|
|
5529
|
+
"type": "object",
|
|
5530
|
+
"properties": {
|
|
5531
|
+
"id": {
|
|
5532
|
+
"readOnly": true,
|
|
5533
|
+
"description": "(Read-only) Firestore document ID, auto-generated.",
|
|
5534
|
+
"type": [
|
|
5535
|
+
"string",
|
|
5536
|
+
"null"
|
|
5537
|
+
]
|
|
5538
|
+
},
|
|
5539
|
+
"outboundPaymentId": {
|
|
5540
|
+
"type": "string",
|
|
5541
|
+
"x-immutable": true,
|
|
5542
|
+
"description": "(Immutable) FK \u2192 OutboundPayment document ID (parent)."
|
|
5543
|
+
},
|
|
5544
|
+
"expenseId": {
|
|
5545
|
+
"type": "string",
|
|
5546
|
+
"x-immutable": true,
|
|
5547
|
+
"description": "(Immutable) FK \u2192 Expense document ID. Full Expense model tracked in #20."
|
|
5548
|
+
},
|
|
5549
|
+
"companyId": {
|
|
5550
|
+
"type": "string",
|
|
5551
|
+
"x-immutable": true,
|
|
5552
|
+
"description": "(Immutable) FK \u2192 Company document ID. Denormalized for collection-group queries."
|
|
5553
|
+
},
|
|
5554
|
+
"amount": {
|
|
5555
|
+
"type": "number",
|
|
5556
|
+
"description": "Amount of this payment allocated to the referenced expense (XOF)."
|
|
5557
|
+
},
|
|
5558
|
+
"notes": {
|
|
5559
|
+
"description": "Optional notes about this allocation.",
|
|
5560
|
+
"type": [
|
|
5561
|
+
"string",
|
|
5562
|
+
"null"
|
|
5563
|
+
]
|
|
5564
|
+
},
|
|
5565
|
+
"allocatedAt": {
|
|
5566
|
+
"anyOf": [
|
|
5567
|
+
{
|
|
5568
|
+
"$ref": "#/definitions/firestore-timestamp"
|
|
5569
|
+
},
|
|
5570
|
+
{
|
|
5571
|
+
"type": "null"
|
|
5572
|
+
}
|
|
5573
|
+
],
|
|
5574
|
+
"readOnly": true,
|
|
5575
|
+
"description": "(Read-only) When this allocation was recorded."
|
|
5576
|
+
}
|
|
5577
|
+
},
|
|
5578
|
+
"required": [
|
|
5579
|
+
"outboundPaymentId",
|
|
5580
|
+
"expenseId",
|
|
5581
|
+
"companyId",
|
|
5582
|
+
"amount"
|
|
5583
|
+
],
|
|
5584
|
+
"additionalProperties": false,
|
|
5585
|
+
"description": "OutboundPaymentAllocation (GH#15). Subcollection: companies/{companyId}/outboundPayments/{paymentId}/allocations/{allocationId}. Links an OutboundPayment to an Expense. Supports partial and multi-expense allocations.",
|
|
5586
|
+
"example": {
|
|
5587
|
+
"id": null,
|
|
5588
|
+
"outboundPaymentId": "out_ref123",
|
|
5589
|
+
"expenseId": "exp_ref123",
|
|
5590
|
+
"companyId": "comp_xyz789",
|
|
5591
|
+
"amount": 45000,
|
|
5592
|
+
"notes": null,
|
|
5593
|
+
"allocatedAt": "allocatedAt"
|
|
5594
|
+
}
|
|
5595
|
+
},
|
|
5199
5596
|
"payment-method": {
|
|
5200
5597
|
"type": "string",
|
|
5201
5598
|
"enum": [
|
|
@@ -5234,6 +5631,70 @@
|
|
|
5234
5631
|
],
|
|
5235
5632
|
"description": "Payment lifecycle status (D01 amended). Used by Order, Sale/Purchase, Booking."
|
|
5236
5633
|
},
|
|
5634
|
+
"payment-webhook-endpoint": {
|
|
5635
|
+
"type": "object",
|
|
5636
|
+
"properties": {
|
|
5637
|
+
"token": {
|
|
5638
|
+
"type": "string",
|
|
5639
|
+
"x-immutable": true,
|
|
5640
|
+
"description": "(Immutable) base64url-encoded 24-byte random token. Also the Firestore document ID and the URL path segment."
|
|
5641
|
+
},
|
|
5642
|
+
"company": {
|
|
5643
|
+
"type": "string",
|
|
5644
|
+
"x-immutable": true,
|
|
5645
|
+
"description": "(Immutable) Company slug (e.g. gerko_studios). Identifies the tenant that owns this endpoint."
|
|
5646
|
+
},
|
|
5647
|
+
"provider": {
|
|
5648
|
+
"type": "string",
|
|
5649
|
+
"enum": [
|
|
5650
|
+
"wave",
|
|
5651
|
+
"jeko"
|
|
5652
|
+
],
|
|
5653
|
+
"x-immutable": true,
|
|
5654
|
+
"description": "(Immutable) Payment provider whose webhooks this endpoint accepts."
|
|
5655
|
+
},
|
|
5656
|
+
"secret": {
|
|
5657
|
+
"type": "string",
|
|
5658
|
+
"x-note": "Provider-specific webhook signing secret. Used to verify HMAC-SHA256 signatures on inbound payloads. Never expose to clients.",
|
|
5659
|
+
"readOnly": true,
|
|
5660
|
+
"description": "Webhook signing secret for HMAC verification. Backend-only \u2014 never returned to dashboard or mobile clients."
|
|
5661
|
+
},
|
|
5662
|
+
"active": {
|
|
5663
|
+
"type": "boolean",
|
|
5664
|
+
"description": "Whether this endpoint is currently active. Inactive endpoints reject incoming webhooks."
|
|
5665
|
+
},
|
|
5666
|
+
"createdAt": {
|
|
5667
|
+
"anyOf": [
|
|
5668
|
+
{
|
|
5669
|
+
"$ref": "#/definitions/firestore-timestamp"
|
|
5670
|
+
},
|
|
5671
|
+
{
|
|
5672
|
+
"type": "null"
|
|
5673
|
+
}
|
|
5674
|
+
],
|
|
5675
|
+
"readOnly": true,
|
|
5676
|
+
"description": "(Read-only) When this endpoint was provisioned."
|
|
5677
|
+
}
|
|
5678
|
+
},
|
|
5679
|
+
"required": [
|
|
5680
|
+
"token",
|
|
5681
|
+
"company",
|
|
5682
|
+
"provider",
|
|
5683
|
+
"secret",
|
|
5684
|
+
"active"
|
|
5685
|
+
],
|
|
5686
|
+
"additionalProperties": false,
|
|
5687
|
+
"x-internal": true,
|
|
5688
|
+
"description": "PaymentWebhookEndpoint (GH#41). Collection: payment_webhook_endpoints/{token}. Top-level, not tenant-scoped. Provisioned by superadmin; used by the backend to verify inbound payment webhooks from Wave and Jeko. The delivery log collection (raw webhook payloads + verification outcomes) is tracked in GH#41 \u2014 shape TBD.",
|
|
5689
|
+
"example": {
|
|
5690
|
+
"token": "token",
|
|
5691
|
+
"company": "company",
|
|
5692
|
+
"provider": "wave",
|
|
5693
|
+
"secret": "secret",
|
|
5694
|
+
"active": true,
|
|
5695
|
+
"createdAt": "createdAt"
|
|
5696
|
+
}
|
|
5697
|
+
},
|
|
5237
5698
|
"pending-issue": {
|
|
5238
5699
|
"type": "string",
|
|
5239
5700
|
"enum": [
|
|
@@ -6431,7 +6892,8 @@
|
|
|
6431
6892
|
"cmz",
|
|
6432
6893
|
"val"
|
|
6433
6894
|
],
|
|
6434
|
-
"
|
|
6895
|
+
"x-note": "cmz = \"IngenX - Chez Miss Zahoui\", phone number ID 446424085225188, used for chez_miss_zahoui_* companies. val = \"IngenX - Valets\", phone number ID 425582173979125, used for all other companies. Templates are approved at WABA level \u2014 if cmz and val share a WABA ID, all templates are available to both. Routing logic: functions/src/orders/order.ts#isSender2Company. See messaging/whatsapp-platform-constraints (#50).",
|
|
6896
|
+
"description": "WABA label identifying which Meta Business Account sent/received the message. cmz = Chez Miss Zahoui sender; val = Valets sender. See WhatsApp platform constraints doc (#50)."
|
|
6435
6897
|
},
|
|
6436
6898
|
"whatsapp-button-sub-type": {
|
|
6437
6899
|
"type": "string",
|
|
@@ -6459,6 +6921,7 @@
|
|
|
6459
6921
|
},
|
|
6460
6922
|
"waba": {
|
|
6461
6923
|
"$ref": "#/definitions/waba-label",
|
|
6924
|
+
"x-note": "cmz = \"IngenX - Chez Miss Zahoui\", phone number ID 446424085225188, used for chez_miss_zahoui_* companies. val = \"IngenX - Valets\", phone number ID 425582173979125, used for all other companies. Templates are approved at WABA level \u2014 if cmz and val share a WABA ID, all templates are available to both. Routing logic: functions/src/orders/order.ts#isSender2Company. See messaging/whatsapp-platform-constraints (#50).",
|
|
6462
6925
|
"description": "(Immutable) Human-readable WABA label (cmz | val). See WabaLabel enum.",
|
|
6463
6926
|
"x-immutable": true
|
|
6464
6927
|
},
|
|
@@ -6716,10 +7179,13 @@
|
|
|
6716
7179
|
"to": {
|
|
6717
7180
|
"type": "string",
|
|
6718
7181
|
"x-immutable": true,
|
|
6719
|
-
"
|
|
7182
|
+
"x-note": "This is the Meta wa_id (digits only, no leading +), NOT a literal E.164 string. Meta normalizes phone numbers in non-obvious ways (e.g. +2250777471485 \u2192 wa_id 22577471485, dropping the trunk zero). The only reliable source is Meta's contacts[].wa_id from the send response \u2014 do not derive from E.164 by stripping + alone. The dashboard conversational sends and the whatsapp-server OTP path both use the wa_id form. Confirmed in prod: ING-368.",
|
|
7183
|
+
"x-when": "Set at enqueue time to the recipient's Meta wa_id. Use inbound WhatsappInboundMessage.from (also wa_id) as the join key for the conversation thread.",
|
|
7184
|
+
"description": "(Immutable) Recipient Meta wa_id \u2014 digits only, no leading + (e.g. 22577471485). Equal to the inbound `from` for the same conversation. NOT literal E.164; see x-note (#54)."
|
|
6720
7185
|
},
|
|
6721
7186
|
"waba": {
|
|
6722
7187
|
"$ref": "#/definitions/waba-label",
|
|
7188
|
+
"x-note": "cmz = \"IngenX - Chez Miss Zahoui\", phone number ID 446424085225188, used for chez_miss_zahoui_* companies. val = \"IngenX - Valets\", phone number ID 425582173979125, used for all other companies. Templates are approved at WABA level \u2014 if cmz and val share a WABA ID, all templates are available to both. Routing logic: functions/src/orders/order.ts#isSender2Company. See messaging/whatsapp-platform-constraints (#50).",
|
|
6723
7189
|
"description": "(Immutable) WABA that will send the message. Mirrors inbound `waba`.",
|
|
6724
7190
|
"x-immutable": true
|
|
6725
7191
|
},
|
|
@@ -6826,6 +7292,7 @@
|
|
|
6826
7292
|
},
|
|
6827
7293
|
"wamid": {
|
|
6828
7294
|
"readOnly": true,
|
|
7295
|
+
"x-note": "Useful for audit and dedup. Does NOT enable reply-threading for template messages \u2014 Meta silently ignores context.message_id on templates. Threading only works for kind=text within the 24-hour service window (#50).",
|
|
6829
7296
|
"description": "(Read-only) WhatsApp message ID returned by Meta once the backend sends. Absent while queued or on failure.",
|
|
6830
7297
|
"type": [
|
|
6831
7298
|
"string",
|
|
@@ -6936,6 +7403,7 @@
|
|
|
6936
7403
|
},
|
|
6937
7404
|
"waba": {
|
|
6938
7405
|
"$ref": "#/definitions/waba-label",
|
|
7406
|
+
"x-note": "cmz = \"IngenX - Chez Miss Zahoui\", phone number ID 446424085225188, used for chez_miss_zahoui_* companies. val = \"IngenX - Valets\", phone number ID 425582173979125, used for all other companies. Templates are approved at WABA level \u2014 if cmz and val share a WABA ID, all templates are available to both. Routing logic: functions/src/orders/order.ts#isSender2Company. See messaging/whatsapp-platform-constraints (#50).",
|
|
6939
7407
|
"description": "(Read-only) WABA label this template is approved on. Templates are WABA-scoped. Mirrors WhatsappOutboundMessage.waba.",
|
|
6940
7408
|
"readOnly": true
|
|
6941
7409
|
},
|