@ingenx-io/valets-schema-mcp-server 0.1.1 → 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.
- package/data/docs/collections/firestore-paths.md +49 -0
- package/data/docs/decisions/migrations.md +56 -0
- package/data/docs/decisions/summary.md +78 -0
- package/data/docs/enums/booking-status.md +26 -0
- package/data/docs/enums/customer-payment-status.md +26 -0
- package/data/docs/enums/customer-payment-target-type.md +23 -0
- package/data/docs/enums/delivery-type.md +23 -0
- package/data/docs/enums/event-status.md +30 -0
- package/data/docs/enums/fulfillment-status.md +32 -0
- package/data/docs/enums/loyalty-transaction-type.md +32 -0
- package/data/docs/enums/order-status.md +65 -0
- package/data/docs/enums/payment-method.md +36 -0
- package/data/docs/enums/payment-proof-status.md +23 -0
- package/data/docs/enums/payment-status.md +34 -0
- package/data/docs/enums/return-status.md +32 -0
- package/data/docs/enums/session-status.md +32 -0
- package/data/docs/enums/ticket-status.md +29 -0
- package/data/docs/index.md +102 -0
- package/data/docs/models/booking-version.md +295 -0
- package/data/docs/models/booking.md +1754 -0
- package/data/docs/models/customer-payment-allocation.md +336 -0
- package/data/docs/models/customer-payment.md +392 -0
- package/data/docs/models/customer.md +475 -0
- package/data/docs/models/event.md +386 -0
- package/data/docs/models/loyalty-config.md +317 -0
- package/data/docs/models/loyalty-reward.md +236 -0
- package/data/docs/models/loyalty-status.md +328 -0
- package/data/docs/models/loyalty-transaction.md +326 -0
- package/data/docs/models/metrics-current.md +532 -0
- package/data/docs/models/metrics-daily.md +548 -0
- package/data/docs/models/metrics-monthly.md +548 -0
- package/data/docs/models/order-item.md +361 -0
- package/data/docs/models/order.md +1637 -0
- package/data/docs/models/payment-summary.md +123 -0
- package/data/docs/models/sale.md +540 -0
- package/data/docs/models/ticket.md +405 -0
- package/data/docs/triggers/event-ticket-triggers.md +204 -0
- package/data/docs/triggers/loyalty-automation.md +123 -0
- package/data/static/decisions.json +966 -0
- package/data/static/llms.txt +1056 -0
- package/data/static/openapi.yaml +3090 -0
- package/data/static/schemas.json +4055 -0
- package/package.json +1 -1
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "LoyaltyStatus"
|
|
3
|
+
sidebar_label: "LoyaltyStatus"
|
|
4
|
+
sidebar_position: 9
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# LoyaltyStatus
|
|
8
|
+
|
|
9
|
+
<details>
|
|
10
|
+
<summary>Example JSON</summary>
|
|
11
|
+
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"customerId": null,
|
|
15
|
+
"pointsBalance": 340,
|
|
16
|
+
"totalPointsEarned": 1200,
|
|
17
|
+
"redeemedPoints": null,
|
|
18
|
+
"lastActivityDate": "lastActivityDate",
|
|
19
|
+
"lastRedeemedAt": "lastRedeemedAt",
|
|
20
|
+
"tier": null,
|
|
21
|
+
"createdAt": "createdAt",
|
|
22
|
+
"updatedAt": "updatedAt"
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
</details>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
- [1. Property `customerId`](#customerId)
|
|
30
|
+
- [2. Property `pointsBalance`](#pointsBalance)
|
|
31
|
+
- [3. Property `totalPointsEarned`](#totalPointsEarned)
|
|
32
|
+
- [4. Property `redeemedPoints`](#redeemedPoints)
|
|
33
|
+
- [5. Property `lastActivityDate`](#lastActivityDate)
|
|
34
|
+
- [5.1. Property `firestore-timestamp`](#lastActivityDate_anyOf_i0)
|
|
35
|
+
- [5.1.1. Property `_seconds`](#lastActivityDate_anyOf_i0__seconds)
|
|
36
|
+
- [5.1.2. Property `_nanoseconds`](#lastActivityDate_anyOf_i0__nanoseconds)
|
|
37
|
+
- [5.2. Property `item 1`](#lastActivityDate_anyOf_i1)
|
|
38
|
+
- [6. Property `lastRedeemedAt`](#lastRedeemedAt)
|
|
39
|
+
- [6.1. Property `firestore-timestamp`](#lastRedeemedAt_anyOf_i0)
|
|
40
|
+
- [6.2. Property `item 1`](#lastRedeemedAt_anyOf_i1)
|
|
41
|
+
- [7. Property `tier`](#tier)
|
|
42
|
+
- [8. Property `createdAt`](#createdAt)
|
|
43
|
+
- [8.1. Property `firestore-timestamp`](#createdAt_anyOf_i0)
|
|
44
|
+
- [8.2. Property `item 1`](#createdAt_anyOf_i1)
|
|
45
|
+
- [9. Property `updatedAt`](#updatedAt)
|
|
46
|
+
- [9.1. Property `firestore-timestamp`](#updatedAt_anyOf_i0)
|
|
47
|
+
- [9.2. Property `item 1`](#updatedAt_anyOf_i1)
|
|
48
|
+
|
|
49
|
+
| | |
|
|
50
|
+
| ------------------------- | ---------------------------- |
|
|
51
|
+
| **Type** | `object` |
|
|
52
|
+
| **Required** | No |
|
|
53
|
+
| **Additional properties** | Not allowed |
|
|
54
|
+
| **Defined in** | #/definitions/loyalty-status |
|
|
55
|
+
|
|
56
|
+
**Description:** LoyaltyStatus model (D08). Collection: companies/\{companyId\}/customers/\{custId\}/loyalty/status. Source of truth for customer points. Customer doc loyaltyPoints is a derived summary only.
|
|
57
|
+
|
|
58
|
+
| Property | Pattern | Type | Deprecated | Definition | Title/Description |
|
|
59
|
+
| ------------------------------------------ | ------- | --------------- | ---------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
60
|
+
| - [customerId](#customerId ) | No | string or null | No | - | (Immutable) FK → Customer.id. Note: optional despite being in customer subcollection (path already contains custId). |
|
|
61
|
+
| + [pointsBalance](#pointsBalance ) | No | integer | No | - | (Read-only) Current available points balance. Canonical name (D08). Dashboard: pointsBalance, Mobile: currentPoints. Updated by transaction triggers. |
|
|
62
|
+
| + [totalPointsEarned](#totalPointsEarned ) | No | integer | No | - | (Read-only) Lifetime total points earned. Canonical name (D08). Dashboard: totalPointsEarned, Mobile: lifetimePoints. Updated by transaction triggers. |
|
|
63
|
+
| - [redeemedPoints](#redeemedPoints ) | No | integer or null | No | - | (Read-only) Total redeemed points. Updated by transaction triggers. |
|
|
64
|
+
| - [lastActivityDate](#lastActivityDate ) | No | Combination | No | - | (Read-only) Last earn/redeem activity. Canonical name (D08). Mobile alias: lastEarnedAt. |
|
|
65
|
+
| - [lastRedeemedAt](#lastRedeemedAt ) | No | Combination | No | - | (Read-only) Last redemption timestamp. |
|
|
66
|
+
| - [tier](#tier ) | No | string or null | No | - | - |
|
|
67
|
+
| - [createdAt](#createdAt ) | No | Combination | No | - | (Read-only) Server-generated creation timestamp. |
|
|
68
|
+
| - [updatedAt](#updatedAt ) | No | Combination | No | - | (Read-only) Server-generated update timestamp. |
|
|
69
|
+
|
|
70
|
+
## <a name="customerId"></a>1. Property `customerId`
|
|
71
|
+
|
|
72
|
+
| | |
|
|
73
|
+
| ------------ | ---------------- |
|
|
74
|
+
| **Type** | `string or null` |
|
|
75
|
+
| **Required** | No |
|
|
76
|
+
|
|
77
|
+
**Description:** (Immutable) FK → Customer.id. Note: optional despite being in customer subcollection (path already contains custId).
|
|
78
|
+
|
|
79
|
+
:::info Immutable
|
|
80
|
+
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.
|
|
81
|
+
:::
|
|
82
|
+
|
|
83
|
+
## <a name="pointsBalance"></a>2. Property `pointsBalance`
|
|
84
|
+
|
|
85
|
+
| | |
|
|
86
|
+
| ------------ | --------- |
|
|
87
|
+
| **Type** | `integer` |
|
|
88
|
+
| **Required** | Yes |
|
|
89
|
+
|
|
90
|
+
**Description:** (Read-only) Current available points balance. Canonical name (D08). Dashboard: pointsBalance, Mobile: currentPoints. Updated by transaction triggers.
|
|
91
|
+
|
|
92
|
+
| Restrictions | |
|
|
93
|
+
| ------------ | ---------------------- |
|
|
94
|
+
| **Minimum** | ≥ -9007199254740991 |
|
|
95
|
+
| **Maximum** | ≤ 9007199254740991 |
|
|
96
|
+
|
|
97
|
+
:::warning Server-set
|
|
98
|
+
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.
|
|
99
|
+
:::
|
|
100
|
+
|
|
101
|
+
## <a name="totalPointsEarned"></a>3. Property `totalPointsEarned`
|
|
102
|
+
|
|
103
|
+
| | |
|
|
104
|
+
| ------------ | --------- |
|
|
105
|
+
| **Type** | `integer` |
|
|
106
|
+
| **Required** | Yes |
|
|
107
|
+
|
|
108
|
+
**Description:** (Read-only) Lifetime total points earned. Canonical name (D08). Dashboard: totalPointsEarned, Mobile: lifetimePoints. Updated by transaction triggers.
|
|
109
|
+
|
|
110
|
+
| Restrictions | |
|
|
111
|
+
| ------------ | ---------------------- |
|
|
112
|
+
| **Minimum** | ≥ -9007199254740991 |
|
|
113
|
+
| **Maximum** | ≤ 9007199254740991 |
|
|
114
|
+
|
|
115
|
+
:::warning Server-set
|
|
116
|
+
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.
|
|
117
|
+
:::
|
|
118
|
+
|
|
119
|
+
## <a name="redeemedPoints"></a>4. Property `redeemedPoints`
|
|
120
|
+
|
|
121
|
+
| | |
|
|
122
|
+
| ------------ | ----------------- |
|
|
123
|
+
| **Type** | `integer or null` |
|
|
124
|
+
| **Required** | No |
|
|
125
|
+
|
|
126
|
+
**Description:** (Read-only) Total redeemed points. Updated by transaction triggers.
|
|
127
|
+
|
|
128
|
+
| Restrictions | |
|
|
129
|
+
| ------------ | ---------------------- |
|
|
130
|
+
| **Minimum** | ≥ -9007199254740991 |
|
|
131
|
+
| **Maximum** | ≤ 9007199254740991 |
|
|
132
|
+
|
|
133
|
+
:::warning Server-set
|
|
134
|
+
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.
|
|
135
|
+
:::
|
|
136
|
+
|
|
137
|
+
## <a name="lastActivityDate"></a>5. Property `lastActivityDate`
|
|
138
|
+
|
|
139
|
+
| | |
|
|
140
|
+
| ------------------------- | ---------------- |
|
|
141
|
+
| **Type** | `combining` |
|
|
142
|
+
| **Required** | No |
|
|
143
|
+
| **Additional properties** | Any type allowed |
|
|
144
|
+
|
|
145
|
+
**Description:** (Read-only) Last earn/redeem activity. Canonical name (D08). Mobile alias: lastEarnedAt.
|
|
146
|
+
|
|
147
|
+
| Any of(Option) |
|
|
148
|
+
| ------------------------------------------------- |
|
|
149
|
+
| [firestore-timestamp](#lastActivityDate_anyOf_i0) |
|
|
150
|
+
| [item 1](#lastActivityDate_anyOf_i1) |
|
|
151
|
+
|
|
152
|
+
### <a name="lastActivityDate_anyOf_i0"></a>5.1. Property `firestore-timestamp`
|
|
153
|
+
|
|
154
|
+
| | |
|
|
155
|
+
| ------------------------- | --------------------------------- |
|
|
156
|
+
| **Type** | `object` |
|
|
157
|
+
| **Required** | No |
|
|
158
|
+
| **Additional properties** | Not allowed |
|
|
159
|
+
| **Defined in** | #/definitions/firestore-timestamp |
|
|
160
|
+
|
|
161
|
+
**Description:** Firestore Timestamp serialized representation
|
|
162
|
+
|
|
163
|
+
| Property | Pattern | Type | Deprecated | Definition | Title/Description |
|
|
164
|
+
| ---------------------------------------------------------- | ------- | ------- | ---------- | ---------- | ----------------- |
|
|
165
|
+
| + [_seconds](#lastActivityDate_anyOf_i0__seconds ) | No | integer | No | - | - |
|
|
166
|
+
| + [_nanoseconds](#lastActivityDate_anyOf_i0__nanoseconds ) | No | integer | No | - | - |
|
|
167
|
+
|
|
168
|
+
#### <a name="lastActivityDate_anyOf_i0__seconds"></a>5.1.1. Property `_seconds`
|
|
169
|
+
|
|
170
|
+
| | |
|
|
171
|
+
| ------------ | --------- |
|
|
172
|
+
| **Type** | `integer` |
|
|
173
|
+
| **Required** | Yes |
|
|
174
|
+
|
|
175
|
+
| Restrictions | |
|
|
176
|
+
| ------------ | ---------------------- |
|
|
177
|
+
| **Minimum** | ≥ -9007199254740991 |
|
|
178
|
+
| **Maximum** | ≤ 9007199254740991 |
|
|
179
|
+
|
|
180
|
+
#### <a name="lastActivityDate_anyOf_i0__nanoseconds"></a>5.1.2. Property `_nanoseconds`
|
|
181
|
+
|
|
182
|
+
| | |
|
|
183
|
+
| ------------ | --------- |
|
|
184
|
+
| **Type** | `integer` |
|
|
185
|
+
| **Required** | Yes |
|
|
186
|
+
|
|
187
|
+
| Restrictions | |
|
|
188
|
+
| ------------ | ---------------------- |
|
|
189
|
+
| **Minimum** | ≥ -9007199254740991 |
|
|
190
|
+
| **Maximum** | ≤ 9007199254740991 |
|
|
191
|
+
|
|
192
|
+
### <a name="lastActivityDate_anyOf_i1"></a>5.2. Property `item 1`
|
|
193
|
+
|
|
194
|
+
| | |
|
|
195
|
+
| ------------ | ------ |
|
|
196
|
+
| **Type** | `null` |
|
|
197
|
+
| **Required** | No |
|
|
198
|
+
|
|
199
|
+
:::warning Server-set
|
|
200
|
+
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.
|
|
201
|
+
:::
|
|
202
|
+
|
|
203
|
+
## <a name="lastRedeemedAt"></a>6. Property `lastRedeemedAt`
|
|
204
|
+
|
|
205
|
+
| | |
|
|
206
|
+
| ------------------------- | ---------------- |
|
|
207
|
+
| **Type** | `combining` |
|
|
208
|
+
| **Required** | No |
|
|
209
|
+
| **Additional properties** | Any type allowed |
|
|
210
|
+
|
|
211
|
+
**Description:** (Read-only) Last redemption timestamp.
|
|
212
|
+
|
|
213
|
+
| Any of(Option) |
|
|
214
|
+
| ----------------------------------------------- |
|
|
215
|
+
| [firestore-timestamp](#lastRedeemedAt_anyOf_i0) |
|
|
216
|
+
| [item 1](#lastRedeemedAt_anyOf_i1) |
|
|
217
|
+
|
|
218
|
+
### <a name="lastRedeemedAt_anyOf_i0"></a>6.1. Property `firestore-timestamp`
|
|
219
|
+
|
|
220
|
+
| | |
|
|
221
|
+
| ------------------------- | ------------------------------------------------------- |
|
|
222
|
+
| **Type** | `object` |
|
|
223
|
+
| **Required** | No |
|
|
224
|
+
| **Additional properties** | Not allowed |
|
|
225
|
+
| **Same definition as** | [lastActivityDate_anyOf_i0](#lastActivityDate_anyOf_i0) |
|
|
226
|
+
|
|
227
|
+
**Description:** Firestore Timestamp serialized representation
|
|
228
|
+
|
|
229
|
+
### <a name="lastRedeemedAt_anyOf_i1"></a>6.2. Property `item 1`
|
|
230
|
+
|
|
231
|
+
| | |
|
|
232
|
+
| ------------ | ------ |
|
|
233
|
+
| **Type** | `null` |
|
|
234
|
+
| **Required** | No |
|
|
235
|
+
|
|
236
|
+
:::warning Server-set
|
|
237
|
+
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.
|
|
238
|
+
:::
|
|
239
|
+
|
|
240
|
+
## <a name="tier"></a>7. Property `tier`
|
|
241
|
+
|
|
242
|
+
| | |
|
|
243
|
+
| ------------ | ---------------- |
|
|
244
|
+
| **Type** | `string or null` |
|
|
245
|
+
| **Required** | No |
|
|
246
|
+
|
|
247
|
+
## <a name="createdAt"></a>8. Property `createdAt`
|
|
248
|
+
|
|
249
|
+
| | |
|
|
250
|
+
| ------------------------- | ---------------- |
|
|
251
|
+
| **Type** | `combining` |
|
|
252
|
+
| **Required** | No |
|
|
253
|
+
| **Additional properties** | Any type allowed |
|
|
254
|
+
|
|
255
|
+
**Description:** (Read-only) Server-generated creation timestamp.
|
|
256
|
+
|
|
257
|
+
| Any of(Option) |
|
|
258
|
+
| ------------------------------------------ |
|
|
259
|
+
| [firestore-timestamp](#createdAt_anyOf_i0) |
|
|
260
|
+
| [item 1](#createdAt_anyOf_i1) |
|
|
261
|
+
|
|
262
|
+
### <a name="createdAt_anyOf_i0"></a>8.1. Property `firestore-timestamp`
|
|
263
|
+
|
|
264
|
+
| | |
|
|
265
|
+
| ------------------------- | ------------------------------------------------------- |
|
|
266
|
+
| **Type** | `object` |
|
|
267
|
+
| **Required** | No |
|
|
268
|
+
| **Additional properties** | Not allowed |
|
|
269
|
+
| **Same definition as** | [lastActivityDate_anyOf_i0](#lastActivityDate_anyOf_i0) |
|
|
270
|
+
|
|
271
|
+
**Description:** Firestore Timestamp serialized representation
|
|
272
|
+
|
|
273
|
+
### <a name="createdAt_anyOf_i1"></a>8.2. Property `item 1`
|
|
274
|
+
|
|
275
|
+
| | |
|
|
276
|
+
| ------------ | ------ |
|
|
277
|
+
| **Type** | `null` |
|
|
278
|
+
| **Required** | No |
|
|
279
|
+
|
|
280
|
+
:::warning Server-set
|
|
281
|
+
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.
|
|
282
|
+
:::
|
|
283
|
+
|
|
284
|
+
## <a name="updatedAt"></a>9. Property `updatedAt`
|
|
285
|
+
|
|
286
|
+
| | |
|
|
287
|
+
| ------------------------- | ---------------- |
|
|
288
|
+
| **Type** | `combining` |
|
|
289
|
+
| **Required** | No |
|
|
290
|
+
| **Additional properties** | Any type allowed |
|
|
291
|
+
|
|
292
|
+
**Description:** (Read-only) Server-generated update timestamp.
|
|
293
|
+
|
|
294
|
+
| Any of(Option) |
|
|
295
|
+
| ------------------------------------------ |
|
|
296
|
+
| [firestore-timestamp](#updatedAt_anyOf_i0) |
|
|
297
|
+
| [item 1](#updatedAt_anyOf_i1) |
|
|
298
|
+
|
|
299
|
+
### <a name="updatedAt_anyOf_i0"></a>9.1. Property `firestore-timestamp`
|
|
300
|
+
|
|
301
|
+
| | |
|
|
302
|
+
| ------------------------- | ------------------------------------------------------- |
|
|
303
|
+
| **Type** | `object` |
|
|
304
|
+
| **Required** | No |
|
|
305
|
+
| **Additional properties** | Not allowed |
|
|
306
|
+
| **Same definition as** | [lastActivityDate_anyOf_i0](#lastActivityDate_anyOf_i0) |
|
|
307
|
+
|
|
308
|
+
**Description:** Firestore Timestamp serialized representation
|
|
309
|
+
|
|
310
|
+
### <a name="updatedAt_anyOf_i1"></a>9.2. Property `item 1`
|
|
311
|
+
|
|
312
|
+
| | |
|
|
313
|
+
| ------------ | ------ |
|
|
314
|
+
| **Type** | `null` |
|
|
315
|
+
| **Required** | No |
|
|
316
|
+
|
|
317
|
+
----------------------------------------------------------------------------------------------------------------------------
|
|
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
|
+
|
|
320
|
+
:::warning Server-set
|
|
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.
|
|
322
|
+
:::
|
|
323
|
+
|
|
324
|
+
## Related Decisions
|
|
325
|
+
|
|
326
|
+
| Decision | Title |
|
|
327
|
+
|---|---|
|
|
328
|
+
| **D08** | Canonical location for customer points |
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "LoyaltyTransaction"
|
|
3
|
+
sidebar_label: "LoyaltyTransaction"
|
|
4
|
+
sidebar_position: 10
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# LoyaltyTransaction
|
|
8
|
+
|
|
9
|
+
<details>
|
|
10
|
+
<summary>Example JSON</summary>
|
|
11
|
+
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"id": "bk_abc123def456",
|
|
15
|
+
"customerId": null,
|
|
16
|
+
"type": "phone",
|
|
17
|
+
"pointsChange": 50,
|
|
18
|
+
"description": null,
|
|
19
|
+
"reason": null,
|
|
20
|
+
"relatedPurchaseId": null,
|
|
21
|
+
"relatedOrderId": null,
|
|
22
|
+
"relatedRewardId": null,
|
|
23
|
+
"orderId": null,
|
|
24
|
+
"sessionId": null,
|
|
25
|
+
"orderAmount": null,
|
|
26
|
+
"transactionDate": "transactionDate",
|
|
27
|
+
"pointsBalanceAfter": null,
|
|
28
|
+
"createdBy": null,
|
|
29
|
+
"createdByName": null
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
</details>
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
- [1. Property `id`](#id)
|
|
37
|
+
- [2. Property `customerId`](#customerId)
|
|
38
|
+
- [3. Property `type`](#type)
|
|
39
|
+
- [4. Property `pointsChange`](#pointsChange)
|
|
40
|
+
- [5. Property `description`](#description)
|
|
41
|
+
- [6. Property `reason`](#reason)
|
|
42
|
+
- [7. Property `relatedPurchaseId`](#relatedPurchaseId)
|
|
43
|
+
- [8. Property `relatedOrderId`](#relatedOrderId)
|
|
44
|
+
- [9. Property `relatedRewardId`](#relatedRewardId)
|
|
45
|
+
- [10. Property `orderId`](#orderId)
|
|
46
|
+
- [11. Property `sessionId`](#sessionId)
|
|
47
|
+
- [12. Property `orderAmount`](#orderAmount)
|
|
48
|
+
- [13. Property `transactionDate`](#transactionDate)
|
|
49
|
+
- [13.1. Property `_seconds`](#transactionDate__seconds)
|
|
50
|
+
- [13.2. Property `_nanoseconds`](#transactionDate__nanoseconds)
|
|
51
|
+
- [14. Property `pointsBalanceAfter`](#pointsBalanceAfter)
|
|
52
|
+
- [15. Property `createdBy`](#createdBy)
|
|
53
|
+
- [16. Property `createdByName`](#createdByName)
|
|
54
|
+
|
|
55
|
+
| | |
|
|
56
|
+
| ------------------------- | --------------------------------- |
|
|
57
|
+
| **Type** | `object` |
|
|
58
|
+
| **Required** | No |
|
|
59
|
+
| **Additional properties** | Not allowed |
|
|
60
|
+
| **Defined in** | #/definitions/loyalty-transaction |
|
|
61
|
+
|
|
62
|
+
**Description:** LoyaltyTransaction model (D07). Collection: companies/\{companyId\}/customers/\{custId\}/loyaltyTransactions/\{txId\}. Type values use SCREAMING_SNAKE per D04 (MIG-05 migrates lowercase).
|
|
63
|
+
|
|
64
|
+
| Property | Pattern | Type | Deprecated | Definition | Title/Description |
|
|
65
|
+
| -------------------------------------------- | ------- | ---------------- | ---------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
66
|
+
| + [id](#id ) | No | string | No | - | (Read-only) Firestore document ID. |
|
|
67
|
+
| - [customerId](#customerId ) | No | string or null | No | - | (Immutable) FK → Customer.id. Note: optional despite being in customer subcollection. |
|
|
68
|
+
| + [type](#type ) | No | enum (of string) | No | In #/definitions/loyalty-transaction-type | (Immutable) Transaction type (D07). SCREAMING_SNAKE per D04. MIG-05 migrates legacy lowercase values. |
|
|
69
|
+
| + [pointsChange](#pointsChange ) | No | integer | No | - | (Immutable) Points delta (+/-). Canonical name (D07). Dashboard: pointsChange, Mobile: points. |
|
|
70
|
+
| - [description](#description ) | No | string or null | No | - | - |
|
|
71
|
+
| - [reason](#reason ) | No | string or null | No | - | - |
|
|
72
|
+
| - [relatedPurchaseId](#relatedPurchaseId ) | No | string or null | No | - | (Immutable) FK → Sale.id. Linked sale that triggered this transaction. |
|
|
73
|
+
| - [relatedOrderId](#relatedOrderId ) | No | string or null | No | - | (Immutable) FK → Order.id. Linked order that triggered this transaction. |
|
|
74
|
+
| - [relatedRewardId](#relatedRewardId ) | No | string or null | No | - | (Immutable) FK → LoyaltyReward.id. Reward redeemed in this transaction. |
|
|
75
|
+
| - [orderId](#orderId ) | No | string or null | No | - | (Immutable) FK → Order.id. Note: may overlap with relatedOrderId — naming inconsistency from Mobile. |
|
|
76
|
+
| - [sessionId](#sessionId ) | No | string or null | No | - | Session/booking reference. Context-dependent identifier. |
|
|
77
|
+
| - [orderAmount](#orderAmount ) | No | number or null | No | - | - |
|
|
78
|
+
| + [transactionDate](#transactionDate ) | No | object | No | In #/definitions/firestore-timestamp | (Immutable) When the transaction occurred. Canonical name (D07). Dashboard: transactionDate, Mobile: createdAt. |
|
|
79
|
+
| - [pointsBalanceAfter](#pointsBalanceAfter ) | No | integer or null | No | - | (Read-only) Running balance after this transaction. Canonical name (D07). Dashboard: pointsBalanceAfter, Mobile: balanceAfter. Server-calculated. |
|
|
80
|
+
| - [createdBy](#createdBy ) | No | string or null | No | - | (Immutable) FK → User/staff UID who created this transaction. |
|
|
81
|
+
| - [createdByName](#createdByName ) | No | string or null | No | - | (Immutable, Denormalized) From User display name at creation time. |
|
|
82
|
+
|
|
83
|
+
## <a name="id"></a>1. Property `id`
|
|
84
|
+
|
|
85
|
+
| | |
|
|
86
|
+
| ------------ | -------- |
|
|
87
|
+
| **Type** | `string` |
|
|
88
|
+
| **Required** | Yes |
|
|
89
|
+
|
|
90
|
+
**Description:** (Read-only) Firestore document ID.
|
|
91
|
+
|
|
92
|
+
:::warning Server-set
|
|
93
|
+
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.
|
|
94
|
+
:::
|
|
95
|
+
|
|
96
|
+
## <a name="customerId"></a>2. Property `customerId`
|
|
97
|
+
|
|
98
|
+
| | |
|
|
99
|
+
| ------------ | ---------------- |
|
|
100
|
+
| **Type** | `string or null` |
|
|
101
|
+
| **Required** | No |
|
|
102
|
+
|
|
103
|
+
**Description:** (Immutable) FK → Customer.id. Note: optional despite being in customer subcollection.
|
|
104
|
+
|
|
105
|
+
:::info Immutable
|
|
106
|
+
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.
|
|
107
|
+
:::
|
|
108
|
+
|
|
109
|
+
## <a name="type"></a>3. Property `type`
|
|
110
|
+
|
|
111
|
+
| | |
|
|
112
|
+
| -------------- | -------------------------------------- |
|
|
113
|
+
| **Type** | `enum (of string)` |
|
|
114
|
+
| **Required** | Yes |
|
|
115
|
+
| **Defined in** | #/definitions/loyalty-transaction-type |
|
|
116
|
+
|
|
117
|
+
**Description:** (Immutable) Transaction type (D07). SCREAMING_SNAKE per D04. MIG-05 migrates legacy lowercase values.
|
|
118
|
+
|
|
119
|
+
Must be one of:
|
|
120
|
+
* "EARNED"
|
|
121
|
+
* "REDEEMED"
|
|
122
|
+
* "ADJUSTED"
|
|
123
|
+
* "EXPIRED"
|
|
124
|
+
* "BONUS"
|
|
125
|
+
* "REFUND"
|
|
126
|
+
|
|
127
|
+
:::info Immutable
|
|
128
|
+
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.
|
|
129
|
+
:::
|
|
130
|
+
|
|
131
|
+
## <a name="pointsChange"></a>4. Property `pointsChange`
|
|
132
|
+
|
|
133
|
+
| | |
|
|
134
|
+
| ------------ | --------- |
|
|
135
|
+
| **Type** | `integer` |
|
|
136
|
+
| **Required** | Yes |
|
|
137
|
+
|
|
138
|
+
**Description:** (Immutable) Points delta (+/-). Canonical name (D07). Dashboard: pointsChange, Mobile: points.
|
|
139
|
+
|
|
140
|
+
| Restrictions | |
|
|
141
|
+
| ------------ | ---------------------- |
|
|
142
|
+
| **Minimum** | ≥ -9007199254740991 |
|
|
143
|
+
| **Maximum** | ≤ 9007199254740991 |
|
|
144
|
+
|
|
145
|
+
:::info Immutable
|
|
146
|
+
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.
|
|
147
|
+
:::
|
|
148
|
+
|
|
149
|
+
## <a name="description"></a>5. Property `description`
|
|
150
|
+
|
|
151
|
+
| | |
|
|
152
|
+
| ------------ | ---------------- |
|
|
153
|
+
| **Type** | `string or null` |
|
|
154
|
+
| **Required** | No |
|
|
155
|
+
|
|
156
|
+
## <a name="reason"></a>6. Property `reason`
|
|
157
|
+
|
|
158
|
+
| | |
|
|
159
|
+
| ------------ | ---------------- |
|
|
160
|
+
| **Type** | `string or null` |
|
|
161
|
+
| **Required** | No |
|
|
162
|
+
|
|
163
|
+
## <a name="relatedPurchaseId"></a>7. Property `relatedPurchaseId`
|
|
164
|
+
|
|
165
|
+
| | |
|
|
166
|
+
| ------------ | ---------------- |
|
|
167
|
+
| **Type** | `string or null` |
|
|
168
|
+
| **Required** | No |
|
|
169
|
+
|
|
170
|
+
**Description:** (Immutable) FK → Sale.id. Linked sale that triggered this transaction.
|
|
171
|
+
|
|
172
|
+
:::info Immutable
|
|
173
|
+
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.
|
|
174
|
+
:::
|
|
175
|
+
|
|
176
|
+
## <a name="relatedOrderId"></a>8. Property `relatedOrderId`
|
|
177
|
+
|
|
178
|
+
| | |
|
|
179
|
+
| ------------ | ---------------- |
|
|
180
|
+
| **Type** | `string or null` |
|
|
181
|
+
| **Required** | No |
|
|
182
|
+
|
|
183
|
+
**Description:** (Immutable) FK → Order.id. Linked order that triggered this transaction.
|
|
184
|
+
|
|
185
|
+
:::info Immutable
|
|
186
|
+
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.
|
|
187
|
+
:::
|
|
188
|
+
|
|
189
|
+
## <a name="relatedRewardId"></a>9. Property `relatedRewardId`
|
|
190
|
+
|
|
191
|
+
| | |
|
|
192
|
+
| ------------ | ---------------- |
|
|
193
|
+
| **Type** | `string or null` |
|
|
194
|
+
| **Required** | No |
|
|
195
|
+
|
|
196
|
+
**Description:** (Immutable) FK → LoyaltyReward.id. Reward redeemed in this transaction.
|
|
197
|
+
|
|
198
|
+
:::info Immutable
|
|
199
|
+
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.
|
|
200
|
+
:::
|
|
201
|
+
|
|
202
|
+
## <a name="orderId"></a>10. Property `orderId`
|
|
203
|
+
|
|
204
|
+
| | |
|
|
205
|
+
| ------------ | ---------------- |
|
|
206
|
+
| **Type** | `string or null` |
|
|
207
|
+
| **Required** | No |
|
|
208
|
+
|
|
209
|
+
**Description:** (Immutable) FK → Order.id. Note: may overlap with relatedOrderId — naming inconsistency from Mobile.
|
|
210
|
+
|
|
211
|
+
:::info Immutable
|
|
212
|
+
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.
|
|
213
|
+
:::
|
|
214
|
+
|
|
215
|
+
## <a name="sessionId"></a>11. Property `sessionId`
|
|
216
|
+
|
|
217
|
+
| | |
|
|
218
|
+
| ------------ | ---------------- |
|
|
219
|
+
| **Type** | `string or null` |
|
|
220
|
+
| **Required** | No |
|
|
221
|
+
|
|
222
|
+
**Description:** Session/booking reference. Context-dependent identifier.
|
|
223
|
+
|
|
224
|
+
## <a name="orderAmount"></a>12. Property `orderAmount`
|
|
225
|
+
|
|
226
|
+
| | |
|
|
227
|
+
| ------------ | ---------------- |
|
|
228
|
+
| **Type** | `number or null` |
|
|
229
|
+
| **Required** | No |
|
|
230
|
+
|
|
231
|
+
## <a name="transactionDate"></a>13. Property `transactionDate`
|
|
232
|
+
|
|
233
|
+
| | |
|
|
234
|
+
| ------------------------- | --------------------------------- |
|
|
235
|
+
| **Type** | `object` |
|
|
236
|
+
| **Required** | Yes |
|
|
237
|
+
| **Additional properties** | Not allowed |
|
|
238
|
+
| **Defined in** | #/definitions/firestore-timestamp |
|
|
239
|
+
|
|
240
|
+
**Description:** (Immutable) When the transaction occurred. Canonical name (D07). Dashboard: transactionDate, Mobile: createdAt.
|
|
241
|
+
|
|
242
|
+
| Property | Pattern | Type | Deprecated | Definition | Title/Description |
|
|
243
|
+
| ------------------------------------------------ | ------- | ------- | ---------- | ---------- | ----------------- |
|
|
244
|
+
| + [_seconds](#transactionDate__seconds ) | No | integer | No | - | - |
|
|
245
|
+
| + [_nanoseconds](#transactionDate__nanoseconds ) | No | integer | No | - | - |
|
|
246
|
+
|
|
247
|
+
### <a name="transactionDate__seconds"></a>13.1. Property `_seconds`
|
|
248
|
+
|
|
249
|
+
| | |
|
|
250
|
+
| ------------ | --------- |
|
|
251
|
+
| **Type** | `integer` |
|
|
252
|
+
| **Required** | Yes |
|
|
253
|
+
|
|
254
|
+
| Restrictions | |
|
|
255
|
+
| ------------ | ---------------------- |
|
|
256
|
+
| **Minimum** | ≥ -9007199254740991 |
|
|
257
|
+
| **Maximum** | ≤ 9007199254740991 |
|
|
258
|
+
|
|
259
|
+
### <a name="transactionDate__nanoseconds"></a>13.2. Property `_nanoseconds`
|
|
260
|
+
|
|
261
|
+
| | |
|
|
262
|
+
| ------------ | --------- |
|
|
263
|
+
| **Type** | `integer` |
|
|
264
|
+
| **Required** | Yes |
|
|
265
|
+
|
|
266
|
+
| Restrictions | |
|
|
267
|
+
| ------------ | ---------------------- |
|
|
268
|
+
| **Minimum** | ≥ -9007199254740991 |
|
|
269
|
+
| **Maximum** | ≤ 9007199254740991 |
|
|
270
|
+
|
|
271
|
+
:::info Immutable
|
|
272
|
+
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.
|
|
273
|
+
:::
|
|
274
|
+
|
|
275
|
+
## <a name="pointsBalanceAfter"></a>14. Property `pointsBalanceAfter`
|
|
276
|
+
|
|
277
|
+
| | |
|
|
278
|
+
| ------------ | ----------------- |
|
|
279
|
+
| **Type** | `integer or null` |
|
|
280
|
+
| **Required** | No |
|
|
281
|
+
|
|
282
|
+
**Description:** (Read-only) Running balance after this transaction. Canonical name (D07). Dashboard: pointsBalanceAfter, Mobile: balanceAfter. Server-calculated.
|
|
283
|
+
|
|
284
|
+
| Restrictions | |
|
|
285
|
+
| ------------ | ---------------------- |
|
|
286
|
+
| **Minimum** | ≥ -9007199254740991 |
|
|
287
|
+
| **Maximum** | ≤ 9007199254740991 |
|
|
288
|
+
|
|
289
|
+
:::warning Server-set
|
|
290
|
+
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.
|
|
291
|
+
:::
|
|
292
|
+
|
|
293
|
+
## <a name="createdBy"></a>15. Property `createdBy`
|
|
294
|
+
|
|
295
|
+
| | |
|
|
296
|
+
| ------------ | ---------------- |
|
|
297
|
+
| **Type** | `string or null` |
|
|
298
|
+
| **Required** | No |
|
|
299
|
+
|
|
300
|
+
**Description:** (Immutable) FK → User/staff UID who created this transaction.
|
|
301
|
+
|
|
302
|
+
:::info Immutable
|
|
303
|
+
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
|
+
:::
|
|
305
|
+
|
|
306
|
+
## <a name="createdByName"></a>16. Property `createdByName`
|
|
307
|
+
|
|
308
|
+
| | |
|
|
309
|
+
| ------------ | ---------------- |
|
|
310
|
+
| **Type** | `string or null` |
|
|
311
|
+
| **Required** | No |
|
|
312
|
+
|
|
313
|
+
**Description:** (Immutable, Denormalized) From User display name at creation time.
|
|
314
|
+
|
|
315
|
+
----------------------------------------------------------------------------------------------------------------------------
|
|
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
|
+
|
|
318
|
+
:::info Immutable
|
|
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.
|
|
320
|
+
:::
|
|
321
|
+
|
|
322
|
+
## Related Decisions
|
|
323
|
+
|
|
324
|
+
| Decision | Title |
|
|
325
|
+
|---|---|
|
|
326
|
+
| **D23** | Firebase loyalty automation |
|