@ingenx-io/valets-schema-mcp-server 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/docs/collections/firestore-paths.md +42 -8
- package/data/docs/enums/attention-status.md +1 -1
- package/data/docs/enums/booking-status.md +1 -1
- package/data/docs/enums/customer-payment-status.md +1 -1
- package/data/docs/enums/customer-payment-target-type.md +1 -1
- package/data/docs/enums/delivery-type.md +1 -1
- package/data/docs/enums/deployment-link-type.md +26 -0
- 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/order-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 +24 -0
- package/data/docs/enums/ticket-status.md +2 -2
- package/data/docs/index.md +9 -3
- package/data/docs/models/allowed-user.md +1 -1
- package/data/docs/models/analytics-backfill.md +398 -0
- package/data/docs/models/analytics-daily.md +351 -0
- package/data/docs/models/analytics-event.md +2 -2
- package/data/docs/models/analytics-hourly.md +372 -0
- package/data/docs/models/booking-version.md +2 -2
- package/data/docs/models/booking.md +2 -2
- 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/order-item.md +2 -2
- package/data/docs/models/order.md +248 -220
- package/data/docs/models/sale.md +2 -2
- package/data/docs/models/site-payment.md +2 -2
- package/data/docs/models/site.md +561 -0
- package/data/docs/models/ticket.md +2 -2
- package/data/static/llms.txt +198 -1
- package/data/static/openapi.yaml +617 -0
- package/data/static/schemas.json +719 -1
- package/package.json +1 -1
package/data/static/openapi.yaml
CHANGED
|
@@ -69,6 +69,17 @@ components:
|
|
|
69
69
|
comes to the business (ON_SITE), collects their order themselves (PICK_UP),
|
|
70
70
|
or receives a physical delivery (DELIVERY). Drives whether fulfillmentStatus
|
|
71
71
|
is relevant.
|
|
72
|
+
DeploymentLinkType:
|
|
73
|
+
type: string
|
|
74
|
+
enum:
|
|
75
|
+
- web
|
|
76
|
+
- mobile
|
|
77
|
+
- pwa
|
|
78
|
+
- app-store
|
|
79
|
+
- play-store
|
|
80
|
+
- other
|
|
81
|
+
description: Category of a Site deployment link (D41). Used for UI icon/labelling
|
|
82
|
+
and deep-link handling.
|
|
72
83
|
EventStatus:
|
|
73
84
|
type: string
|
|
74
85
|
enum:
|
|
@@ -184,6 +195,15 @@ components:
|
|
|
184
195
|
- CANCELLED
|
|
185
196
|
description: Per-date/per-slot booking session status (D19). Dashboard is sole
|
|
186
197
|
writer; Mobile is read-only.
|
|
198
|
+
SiteStatus:
|
|
199
|
+
type: string
|
|
200
|
+
enum:
|
|
201
|
+
- ACTIVE
|
|
202
|
+
- INACTIVE
|
|
203
|
+
- EXPIRED
|
|
204
|
+
- ARCHIVED
|
|
205
|
+
description: Lifecycle status for a Site (D41). Drives whether the site is reachable
|
|
206
|
+
and whether analytics/payments flow.
|
|
187
207
|
TicketStatus:
|
|
188
208
|
type: string
|
|
189
209
|
enum:
|
|
@@ -281,6 +301,260 @@ components:
|
|
|
281
301
|
description: Write payload for partial update (PATCH) of a AllowedUser document.
|
|
282
302
|
All fields optional. Fields marked `readOnly` or `x-immutable` must not be
|
|
283
303
|
sent.
|
|
304
|
+
AnalyticsBackfill:
|
|
305
|
+
type: object
|
|
306
|
+
properties:
|
|
307
|
+
id:
|
|
308
|
+
readOnly: true
|
|
309
|
+
description: (Read-only) Firestore document ID, auto-generated.
|
|
310
|
+
type:
|
|
311
|
+
- string
|
|
312
|
+
- 'null'
|
|
313
|
+
companyId:
|
|
314
|
+
type: string
|
|
315
|
+
x-immutable: true
|
|
316
|
+
description: (Immutable) FK → Company document ID.
|
|
317
|
+
siteId:
|
|
318
|
+
type: string
|
|
319
|
+
x-immutable: true
|
|
320
|
+
description: (Immutable) FK → Site document ID (D40).
|
|
321
|
+
status:
|
|
322
|
+
type: string
|
|
323
|
+
enum:
|
|
324
|
+
- pending
|
|
325
|
+
- running
|
|
326
|
+
- completed
|
|
327
|
+
- failed
|
|
328
|
+
- cancelled
|
|
329
|
+
description: Run status.
|
|
330
|
+
from:
|
|
331
|
+
type: string
|
|
332
|
+
x-immutable: true
|
|
333
|
+
description: (Immutable) Inclusive start date (`YYYY-MM-DD`, UTC).
|
|
334
|
+
to:
|
|
335
|
+
type: string
|
|
336
|
+
x-immutable: true
|
|
337
|
+
description: (Immutable) Inclusive end date (`YYYY-MM-DD`, UTC).
|
|
338
|
+
dryRun:
|
|
339
|
+
type: boolean
|
|
340
|
+
x-immutable: true
|
|
341
|
+
description: (Immutable) When true, rollup writes are skipped — only source
|
|
342
|
+
counts are returned for diffing.
|
|
343
|
+
processedDates:
|
|
344
|
+
type: array
|
|
345
|
+
items:
|
|
346
|
+
type: string
|
|
347
|
+
description: Ordered list of `YYYY-MM-DD` dates already processed by this
|
|
348
|
+
run.
|
|
349
|
+
errors:
|
|
350
|
+
type: array
|
|
351
|
+
items:
|
|
352
|
+
type: object
|
|
353
|
+
properties:
|
|
354
|
+
date:
|
|
355
|
+
type: string
|
|
356
|
+
description: '`YYYY-MM-DD` date that failed.'
|
|
357
|
+
message:
|
|
358
|
+
type: string
|
|
359
|
+
description: Error message captured at failure.
|
|
360
|
+
at:
|
|
361
|
+
$ref: '#/components/schemas/FirestoreTimestamp'
|
|
362
|
+
description: When the error occurred.
|
|
363
|
+
required:
|
|
364
|
+
- date
|
|
365
|
+
- message
|
|
366
|
+
- at
|
|
367
|
+
additionalProperties: false
|
|
368
|
+
description: Per-date errors collected during the run.
|
|
369
|
+
triggeredBy:
|
|
370
|
+
type: string
|
|
371
|
+
x-immutable: true
|
|
372
|
+
description: (Immutable) UID of the admin who triggered the backfill.
|
|
373
|
+
startedAt:
|
|
374
|
+
$ref: '#/components/schemas/FirestoreTimestamp'
|
|
375
|
+
description: (Read-only) When the run actually started.
|
|
376
|
+
readOnly: true
|
|
377
|
+
completedAt:
|
|
378
|
+
anyOf:
|
|
379
|
+
- $ref: '#/components/schemas/FirestoreTimestamp'
|
|
380
|
+
- type: 'null'
|
|
381
|
+
readOnly: true
|
|
382
|
+
description: (Read-only) When the run reached a terminal status.
|
|
383
|
+
required:
|
|
384
|
+
- companyId
|
|
385
|
+
- siteId
|
|
386
|
+
- status
|
|
387
|
+
- from
|
|
388
|
+
- to
|
|
389
|
+
- dryRun
|
|
390
|
+
- processedDates
|
|
391
|
+
- errors
|
|
392
|
+
- triggeredBy
|
|
393
|
+
- startedAt
|
|
394
|
+
additionalProperties: false
|
|
395
|
+
description: 'AnalyticsBackfill run (D42 / ING-304). Collection: companies/{companyId}/sites/{siteId}/analytics_backfills/{runId}.
|
|
396
|
+
Tracks admin-triggered rollup backfill jobs; supports dry-run.'
|
|
397
|
+
AnalyticsBackfillCreate:
|
|
398
|
+
allOf:
|
|
399
|
+
- $ref: '#/components/schemas/AnalyticsBackfill'
|
|
400
|
+
description: Write payload for creating a new AnalyticsBackfill document. Fields
|
|
401
|
+
marked `readOnly` are server-set and must not be included. Fields marked `x-immutable`
|
|
402
|
+
may be set once at creation.
|
|
403
|
+
required:
|
|
404
|
+
- companyId
|
|
405
|
+
- siteId
|
|
406
|
+
- status
|
|
407
|
+
- from
|
|
408
|
+
- to
|
|
409
|
+
- dryRun
|
|
410
|
+
- processedDates
|
|
411
|
+
- errors
|
|
412
|
+
- triggeredBy
|
|
413
|
+
AnalyticsBackfillUpdate:
|
|
414
|
+
allOf:
|
|
415
|
+
- $ref: '#/components/schemas/AnalyticsBackfill'
|
|
416
|
+
description: Write payload for partial update (PATCH) of a AnalyticsBackfill
|
|
417
|
+
document. All fields optional. Fields marked `readOnly` or `x-immutable` must
|
|
418
|
+
not be sent.
|
|
419
|
+
AnalyticsDaily:
|
|
420
|
+
type: object
|
|
421
|
+
properties:
|
|
422
|
+
totalEvents:
|
|
423
|
+
type: integer
|
|
424
|
+
minimum: -9007199254740991
|
|
425
|
+
maximum: 9007199254740991
|
|
426
|
+
description: Total event count within the bucket.
|
|
427
|
+
pageViews:
|
|
428
|
+
type: integer
|
|
429
|
+
minimum: -9007199254740991
|
|
430
|
+
maximum: 9007199254740991
|
|
431
|
+
description: Count of `page_view` + `screen_view` events.
|
|
432
|
+
sessions:
|
|
433
|
+
type: integer
|
|
434
|
+
minimum: -9007199254740991
|
|
435
|
+
maximum: 9007199254740991
|
|
436
|
+
description: Distinct session count within the bucket (by `sessionId`).
|
|
437
|
+
uniqueUsers:
|
|
438
|
+
type: integer
|
|
439
|
+
minimum: -9007199254740991
|
|
440
|
+
maximum: 9007199254740991
|
|
441
|
+
description: Distinct identified `userId` count. Anonymous sessions (userId=null)
|
|
442
|
+
are excluded.
|
|
443
|
+
anonymousSessions:
|
|
444
|
+
type: integer
|
|
445
|
+
minimum: -9007199254740991
|
|
446
|
+
maximum: 9007199254740991
|
|
447
|
+
description: Distinct session count where `userId` was null for the entire
|
|
448
|
+
session.
|
|
449
|
+
orders:
|
|
450
|
+
type: integer
|
|
451
|
+
minimum: -9007199254740991
|
|
452
|
+
maximum: 9007199254740991
|
|
453
|
+
description: Count of `order_submitted` events (or Order documents scoped
|
|
454
|
+
to this site, D43) within the bucket.
|
|
455
|
+
paymentsCompleted:
|
|
456
|
+
type: integer
|
|
457
|
+
minimum: -9007199254740991
|
|
458
|
+
maximum: 9007199254740991
|
|
459
|
+
description: Count of `payment_completed` events within the bucket.
|
|
460
|
+
paymentsFailed:
|
|
461
|
+
type: integer
|
|
462
|
+
minimum: -9007199254740991
|
|
463
|
+
maximum: 9007199254740991
|
|
464
|
+
description: Count of `payment_failed` events within the bucket.
|
|
465
|
+
errors:
|
|
466
|
+
type: integer
|
|
467
|
+
minimum: -9007199254740991
|
|
468
|
+
maximum: 9007199254740991
|
|
469
|
+
description: Count of `error_occurred` + `exception_caught` events within
|
|
470
|
+
the bucket.
|
|
471
|
+
eventCounts:
|
|
472
|
+
type: object
|
|
473
|
+
propertyNames:
|
|
474
|
+
type: string
|
|
475
|
+
additionalProperties:
|
|
476
|
+
type: integer
|
|
477
|
+
minimum: -9007199254740991
|
|
478
|
+
maximum: 9007199254740991
|
|
479
|
+
description: Per-event-name counts — key is the event name (canonical or
|
|
480
|
+
custom), value is the count within the bucket.
|
|
481
|
+
id:
|
|
482
|
+
readOnly: true
|
|
483
|
+
description: (Read-only) Firestore document ID = `YYYY-MM-DD`.
|
|
484
|
+
type:
|
|
485
|
+
- string
|
|
486
|
+
- 'null'
|
|
487
|
+
companyId:
|
|
488
|
+
type: string
|
|
489
|
+
x-immutable: true
|
|
490
|
+
description: (Immutable) FK → Company document ID.
|
|
491
|
+
siteId:
|
|
492
|
+
type: string
|
|
493
|
+
x-immutable: true
|
|
494
|
+
description: (Immutable) FK → Site document ID (D40).
|
|
495
|
+
date:
|
|
496
|
+
type: string
|
|
497
|
+
x-immutable: true
|
|
498
|
+
description: (Immutable) `YYYY-MM-DD` UTC — matches document ID.
|
|
499
|
+
computedAt:
|
|
500
|
+
$ref: '#/components/schemas/FirestoreTimestamp'
|
|
501
|
+
description: (Read-only) When this rollup was last (re)computed. Updated
|
|
502
|
+
on every set/merge.
|
|
503
|
+
readOnly: true
|
|
504
|
+
sourceEventCount:
|
|
505
|
+
readOnly: true
|
|
506
|
+
description: (Read-only, Optional) Total source events scanned when producing
|
|
507
|
+
this rollup. Useful for dry-run diffing.
|
|
508
|
+
type:
|
|
509
|
+
- integer
|
|
510
|
+
- 'null'
|
|
511
|
+
minimum: -9007199254740991
|
|
512
|
+
maximum: 9007199254740991
|
|
513
|
+
required:
|
|
514
|
+
- totalEvents
|
|
515
|
+
- pageViews
|
|
516
|
+
- sessions
|
|
517
|
+
- uniqueUsers
|
|
518
|
+
- anonymousSessions
|
|
519
|
+
- orders
|
|
520
|
+
- paymentsCompleted
|
|
521
|
+
- paymentsFailed
|
|
522
|
+
- errors
|
|
523
|
+
- eventCounts
|
|
524
|
+
- companyId
|
|
525
|
+
- siteId
|
|
526
|
+
- date
|
|
527
|
+
- computedAt
|
|
528
|
+
additionalProperties: false
|
|
529
|
+
description: 'AnalyticsDaily rollup (D42 / ING-304). Collection: companies/{companyId}/sites/{siteId}/analytics_daily/{YYYY-MM-DD}.
|
|
530
|
+
Idempotent set/merge — reruns overwrite. Fall back to raw analytics_events
|
|
531
|
+
for uncovered slices.'
|
|
532
|
+
AnalyticsDailyCreate:
|
|
533
|
+
allOf:
|
|
534
|
+
- $ref: '#/components/schemas/AnalyticsDaily'
|
|
535
|
+
description: Write payload for creating a new AnalyticsDaily document. Fields
|
|
536
|
+
marked `readOnly` are server-set and must not be included. Fields marked `x-immutable`
|
|
537
|
+
may be set once at creation.
|
|
538
|
+
required:
|
|
539
|
+
- totalEvents
|
|
540
|
+
- pageViews
|
|
541
|
+
- sessions
|
|
542
|
+
- uniqueUsers
|
|
543
|
+
- anonymousSessions
|
|
544
|
+
- orders
|
|
545
|
+
- paymentsCompleted
|
|
546
|
+
- paymentsFailed
|
|
547
|
+
- errors
|
|
548
|
+
- eventCounts
|
|
549
|
+
- companyId
|
|
550
|
+
- siteId
|
|
551
|
+
- date
|
|
552
|
+
AnalyticsDailyUpdate:
|
|
553
|
+
allOf:
|
|
554
|
+
- $ref: '#/components/schemas/AnalyticsDaily'
|
|
555
|
+
description: Write payload for partial update (PATCH) of a AnalyticsDaily document.
|
|
556
|
+
All fields optional. Fields marked `readOnly` or `x-immutable` must not be
|
|
557
|
+
sent.
|
|
284
558
|
AnalyticsEvent:
|
|
285
559
|
type: object
|
|
286
560
|
properties:
|
|
@@ -448,6 +722,151 @@ components:
|
|
|
448
722
|
description: Write payload for partial update (PATCH) of a AnalyticsEvent document.
|
|
449
723
|
All fields optional. Fields marked `readOnly` or `x-immutable` must not be
|
|
450
724
|
sent.
|
|
725
|
+
AnalyticsHourly:
|
|
726
|
+
type: object
|
|
727
|
+
properties:
|
|
728
|
+
totalEvents:
|
|
729
|
+
type: integer
|
|
730
|
+
minimum: -9007199254740991
|
|
731
|
+
maximum: 9007199254740991
|
|
732
|
+
description: Total event count within the bucket.
|
|
733
|
+
pageViews:
|
|
734
|
+
type: integer
|
|
735
|
+
minimum: -9007199254740991
|
|
736
|
+
maximum: 9007199254740991
|
|
737
|
+
description: Count of `page_view` + `screen_view` events.
|
|
738
|
+
sessions:
|
|
739
|
+
type: integer
|
|
740
|
+
minimum: -9007199254740991
|
|
741
|
+
maximum: 9007199254740991
|
|
742
|
+
description: Distinct session count within the bucket (by `sessionId`).
|
|
743
|
+
uniqueUsers:
|
|
744
|
+
type: integer
|
|
745
|
+
minimum: -9007199254740991
|
|
746
|
+
maximum: 9007199254740991
|
|
747
|
+
description: Distinct identified `userId` count. Anonymous sessions (userId=null)
|
|
748
|
+
are excluded.
|
|
749
|
+
anonymousSessions:
|
|
750
|
+
type: integer
|
|
751
|
+
minimum: -9007199254740991
|
|
752
|
+
maximum: 9007199254740991
|
|
753
|
+
description: Distinct session count where `userId` was null for the entire
|
|
754
|
+
session.
|
|
755
|
+
orders:
|
|
756
|
+
type: integer
|
|
757
|
+
minimum: -9007199254740991
|
|
758
|
+
maximum: 9007199254740991
|
|
759
|
+
description: Count of `order_submitted` events (or Order documents scoped
|
|
760
|
+
to this site, D43) within the bucket.
|
|
761
|
+
paymentsCompleted:
|
|
762
|
+
type: integer
|
|
763
|
+
minimum: -9007199254740991
|
|
764
|
+
maximum: 9007199254740991
|
|
765
|
+
description: Count of `payment_completed` events within the bucket.
|
|
766
|
+
paymentsFailed:
|
|
767
|
+
type: integer
|
|
768
|
+
minimum: -9007199254740991
|
|
769
|
+
maximum: 9007199254740991
|
|
770
|
+
description: Count of `payment_failed` events within the bucket.
|
|
771
|
+
errors:
|
|
772
|
+
type: integer
|
|
773
|
+
minimum: -9007199254740991
|
|
774
|
+
maximum: 9007199254740991
|
|
775
|
+
description: Count of `error_occurred` + `exception_caught` events within
|
|
776
|
+
the bucket.
|
|
777
|
+
eventCounts:
|
|
778
|
+
type: object
|
|
779
|
+
propertyNames:
|
|
780
|
+
type: string
|
|
781
|
+
additionalProperties:
|
|
782
|
+
type: integer
|
|
783
|
+
minimum: -9007199254740991
|
|
784
|
+
maximum: 9007199254740991
|
|
785
|
+
description: Per-event-name counts — key is the event name (canonical or
|
|
786
|
+
custom), value is the count within the bucket.
|
|
787
|
+
id:
|
|
788
|
+
readOnly: true
|
|
789
|
+
description: (Read-only) Firestore document ID = `YYYY-MM-DD-HH`.
|
|
790
|
+
type:
|
|
791
|
+
- string
|
|
792
|
+
- 'null'
|
|
793
|
+
companyId:
|
|
794
|
+
type: string
|
|
795
|
+
x-immutable: true
|
|
796
|
+
description: (Immutable) FK → Company document ID.
|
|
797
|
+
siteId:
|
|
798
|
+
type: string
|
|
799
|
+
x-immutable: true
|
|
800
|
+
description: (Immutable) FK → Site document ID (D40).
|
|
801
|
+
date:
|
|
802
|
+
type: string
|
|
803
|
+
x-immutable: true
|
|
804
|
+
description: (Immutable) `YYYY-MM-DD` UTC for the bucket day.
|
|
805
|
+
hour:
|
|
806
|
+
type: integer
|
|
807
|
+
minimum: -9007199254740991
|
|
808
|
+
maximum: 9007199254740991
|
|
809
|
+
x-immutable: true
|
|
810
|
+
description: (Immutable) UTC hour of day, 0–23.
|
|
811
|
+
computedAt:
|
|
812
|
+
$ref: '#/components/schemas/FirestoreTimestamp'
|
|
813
|
+
description: (Read-only) When this rollup was last (re)computed.
|
|
814
|
+
readOnly: true
|
|
815
|
+
sourceEventCount:
|
|
816
|
+
readOnly: true
|
|
817
|
+
description: (Read-only, Optional) Total source events scanned when producing
|
|
818
|
+
this rollup.
|
|
819
|
+
type:
|
|
820
|
+
- integer
|
|
821
|
+
- 'null'
|
|
822
|
+
minimum: -9007199254740991
|
|
823
|
+
maximum: 9007199254740991
|
|
824
|
+
required:
|
|
825
|
+
- totalEvents
|
|
826
|
+
- pageViews
|
|
827
|
+
- sessions
|
|
828
|
+
- uniqueUsers
|
|
829
|
+
- anonymousSessions
|
|
830
|
+
- orders
|
|
831
|
+
- paymentsCompleted
|
|
832
|
+
- paymentsFailed
|
|
833
|
+
- errors
|
|
834
|
+
- eventCounts
|
|
835
|
+
- companyId
|
|
836
|
+
- siteId
|
|
837
|
+
- date
|
|
838
|
+
- hour
|
|
839
|
+
- computedAt
|
|
840
|
+
additionalProperties: false
|
|
841
|
+
description: 'AnalyticsHourly rollup (D42 / ING-304). Collection: companies/{companyId}/sites/{siteId}/analytics_hourly/{YYYY-MM-DD-HH}.
|
|
842
|
+
Scheduled-CF writer; idempotent set/merge.'
|
|
843
|
+
AnalyticsHourlyCreate:
|
|
844
|
+
allOf:
|
|
845
|
+
- $ref: '#/components/schemas/AnalyticsHourly'
|
|
846
|
+
description: Write payload for creating a new AnalyticsHourly document. Fields
|
|
847
|
+
marked `readOnly` are server-set and must not be included. Fields marked `x-immutable`
|
|
848
|
+
may be set once at creation.
|
|
849
|
+
required:
|
|
850
|
+
- totalEvents
|
|
851
|
+
- pageViews
|
|
852
|
+
- sessions
|
|
853
|
+
- uniqueUsers
|
|
854
|
+
- anonymousSessions
|
|
855
|
+
- orders
|
|
856
|
+
- paymentsCompleted
|
|
857
|
+
- paymentsFailed
|
|
858
|
+
- errors
|
|
859
|
+
- eventCounts
|
|
860
|
+
- companyId
|
|
861
|
+
- siteId
|
|
862
|
+
- date
|
|
863
|
+
- hour
|
|
864
|
+
AnalyticsHourlyUpdate:
|
|
865
|
+
allOf:
|
|
866
|
+
- $ref: '#/components/schemas/AnalyticsHourly'
|
|
867
|
+
description: Write payload for partial update (PATCH) of a AnalyticsHourly document.
|
|
868
|
+
All fields optional. Fields marked `readOnly` or `x-immutable` must not be
|
|
869
|
+
sent.
|
|
451
870
|
Booking:
|
|
452
871
|
type: object
|
|
453
872
|
properties:
|
|
@@ -2579,6 +2998,23 @@ components:
|
|
|
2579
2998
|
type: string
|
|
2580
2999
|
x-immutable: true
|
|
2581
3000
|
description: (Immutable) FK → Company document ID. Scopes all queries.
|
|
3001
|
+
siteId:
|
|
3002
|
+
x-immutable: true
|
|
3003
|
+
x-note: 'D43 / ADR-003: optional site attribution. Absent/null means company-wide
|
|
3004
|
+
(legacy). When set, the order is attributed to a specific site for analytics
|
|
3005
|
+
and site-scoped dashboards. No migration — existing orders keep null.
|
|
3006
|
+
Flat path; Order continues to live at `companies/{companyId}/orders/{orderId}`.'
|
|
3007
|
+
x-see:
|
|
3008
|
+
decisions:
|
|
3009
|
+
- D43
|
|
3010
|
+
x-when: 'Set at order creation when the client knows which site the order
|
|
3011
|
+
originated from (e.g. SR Single, Lifesense). Leave null for legacy/company-wide
|
|
3012
|
+
orders. Composite index: (companyId, siteId, createdAt).'
|
|
3013
|
+
description: (Immutable, Optional) FK → Site document ID (D43 / ADR-003).
|
|
3014
|
+
null = company-wide.
|
|
3015
|
+
type:
|
|
3016
|
+
- string
|
|
3017
|
+
- 'null'
|
|
2582
3018
|
orderNumber:
|
|
2583
3019
|
type: string
|
|
2584
3020
|
readOnly: true
|
|
@@ -3201,6 +3637,187 @@ components:
|
|
|
3201
3637
|
- $ref: '#/components/schemas/Sale'
|
|
3202
3638
|
description: Write payload for partial update (PATCH) of a Sale document. All
|
|
3203
3639
|
fields optional. Fields marked `readOnly` or `x-immutable` must not be sent.
|
|
3640
|
+
Site:
|
|
3641
|
+
type: object
|
|
3642
|
+
properties:
|
|
3643
|
+
id:
|
|
3644
|
+
readOnly: true
|
|
3645
|
+
description: (Read-only) Firestore document ID, auto-generated.
|
|
3646
|
+
type:
|
|
3647
|
+
- string
|
|
3648
|
+
- 'null'
|
|
3649
|
+
companyId:
|
|
3650
|
+
type: string
|
|
3651
|
+
x-immutable: true
|
|
3652
|
+
description: (Immutable) FK → Company document ID. Scopes all site sub-collections.
|
|
3653
|
+
name:
|
|
3654
|
+
type: string
|
|
3655
|
+
description: Human-readable site name shown in dashboards.
|
|
3656
|
+
description:
|
|
3657
|
+
description: Optional freeform description.
|
|
3658
|
+
type:
|
|
3659
|
+
- string
|
|
3660
|
+
- 'null'
|
|
3661
|
+
status:
|
|
3662
|
+
$ref: '#/components/schemas/SiteStatus'
|
|
3663
|
+
description: Lifecycle status (D41). Clients filter by ACTIVE.
|
|
3664
|
+
x-note: ACTIVE = live and serving traffic. INACTIVE = intentionally disabled
|
|
3665
|
+
by operators. EXPIRED = past expiresAt (derived when isExpired is true;
|
|
3666
|
+
may also be stored explicitly). ARCHIVED = soft-deleted; retained for
|
|
3667
|
+
audit but not listed by default.
|
|
3668
|
+
x-see:
|
|
3669
|
+
decisions:
|
|
3670
|
+
- D41
|
|
3671
|
+
x-when: Written by operators via dashboard or by server triggers (expiration).
|
|
3672
|
+
Clients filter by ACTIVE.
|
|
3673
|
+
deploymentLinks:
|
|
3674
|
+
type: array
|
|
3675
|
+
items:
|
|
3676
|
+
type: object
|
|
3677
|
+
properties:
|
|
3678
|
+
label:
|
|
3679
|
+
type: string
|
|
3680
|
+
description: Human-readable label shown in dashboards (e.g. "Production",
|
|
3681
|
+
"Staging").
|
|
3682
|
+
url:
|
|
3683
|
+
type: string
|
|
3684
|
+
description: Absolute URL or store link.
|
|
3685
|
+
type:
|
|
3686
|
+
$ref: '#/components/schemas/DeploymentLinkType'
|
|
3687
|
+
description: Link category — drives icon/handler selection.
|
|
3688
|
+
x-note: Lowercase by convention — deployment link types are display-oriented
|
|
3689
|
+
labels, not lifecycle states.
|
|
3690
|
+
x-see:
|
|
3691
|
+
decisions:
|
|
3692
|
+
- D41
|
|
3693
|
+
isPrimary:
|
|
3694
|
+
description: If true, this link is used as the canonical deployment
|
|
3695
|
+
URL for the Site.
|
|
3696
|
+
type: boolean
|
|
3697
|
+
required:
|
|
3698
|
+
- label
|
|
3699
|
+
- url
|
|
3700
|
+
- type
|
|
3701
|
+
additionalProperties: false
|
|
3702
|
+
description: Deployment link entry embedded on Site.deploymentLinks[]
|
|
3703
|
+
(D41).
|
|
3704
|
+
description: Ordered list of deployment URLs (web, mobile, PWA, store links).
|
|
3705
|
+
expiresAt:
|
|
3706
|
+
anyOf:
|
|
3707
|
+
- $ref: '#/components/schemas/FirestoreTimestamp'
|
|
3708
|
+
- type: 'null'
|
|
3709
|
+
description: Optional expiration timestamp. When set and elapsed, `isExpired`
|
|
3710
|
+
flips true and status typically moves to EXPIRED.
|
|
3711
|
+
isExpired:
|
|
3712
|
+
readOnly: true
|
|
3713
|
+
description: (Read-only) Derived — true when `expiresAt` is in the past.
|
|
3714
|
+
Maintained by server trigger.
|
|
3715
|
+
type:
|
|
3716
|
+
- boolean
|
|
3717
|
+
- 'null'
|
|
3718
|
+
createdAt:
|
|
3719
|
+
anyOf:
|
|
3720
|
+
- $ref: '#/components/schemas/FirestoreTimestamp'
|
|
3721
|
+
- type: 'null'
|
|
3722
|
+
readOnly: true
|
|
3723
|
+
description: (Read-only) Server-generated creation timestamp.
|
|
3724
|
+
updatedAt:
|
|
3725
|
+
anyOf:
|
|
3726
|
+
- $ref: '#/components/schemas/FirestoreTimestamp'
|
|
3727
|
+
- type: 'null'
|
|
3728
|
+
readOnly: true
|
|
3729
|
+
description: (Read-only) Server-generated update timestamp.
|
|
3730
|
+
createdBy:
|
|
3731
|
+
type: string
|
|
3732
|
+
x-immutable: true
|
|
3733
|
+
description: (Immutable) FK → User/staff UID who created the site.
|
|
3734
|
+
analyticsEnabled:
|
|
3735
|
+
type: boolean
|
|
3736
|
+
description: Feature flag — when false, clients should not emit analytics
|
|
3737
|
+
events for this site.
|
|
3738
|
+
lastAnalyticsSync:
|
|
3739
|
+
anyOf:
|
|
3740
|
+
- $ref: '#/components/schemas/FirestoreTimestamp'
|
|
3741
|
+
- type: 'null'
|
|
3742
|
+
readOnly: true
|
|
3743
|
+
description: (Read-only) Last time the analytics rollup pipeline refreshed
|
|
3744
|
+
`cachedMetrics`.
|
|
3745
|
+
cachedMetrics:
|
|
3746
|
+
readOnly: true
|
|
3747
|
+
denormalized: true
|
|
3748
|
+
x-note: Updated by the rollup pipeline (D42). Readers should treat this
|
|
3749
|
+
as a hint; authoritative counts live in analytics_daily/analytics_hourly.
|
|
3750
|
+
x-see:
|
|
3751
|
+
decisions:
|
|
3752
|
+
- D41
|
|
3753
|
+
- D42
|
|
3754
|
+
description: (Read-only, Denormalized) Cached metrics snapshot for quick
|
|
3755
|
+
dashboard rendering.
|
|
3756
|
+
type:
|
|
3757
|
+
- object
|
|
3758
|
+
- 'null'
|
|
3759
|
+
properties:
|
|
3760
|
+
totalEvents:
|
|
3761
|
+
type: integer
|
|
3762
|
+
minimum: -9007199254740991
|
|
3763
|
+
maximum: 9007199254740991
|
|
3764
|
+
description: All-time event count cached on the Site.
|
|
3765
|
+
totalPageViews:
|
|
3766
|
+
type: integer
|
|
3767
|
+
minimum: -9007199254740991
|
|
3768
|
+
maximum: 9007199254740991
|
|
3769
|
+
description: All-time `page_view` + `screen_view` count.
|
|
3770
|
+
totalSessions:
|
|
3771
|
+
type: integer
|
|
3772
|
+
minimum: -9007199254740991
|
|
3773
|
+
maximum: 9007199254740991
|
|
3774
|
+
description: All-time distinct session count.
|
|
3775
|
+
totalOrders:
|
|
3776
|
+
type: integer
|
|
3777
|
+
minimum: -9007199254740991
|
|
3778
|
+
maximum: 9007199254740991
|
|
3779
|
+
description: All-time order count attributed to this site (via `Order.siteId`,
|
|
3780
|
+
D43).
|
|
3781
|
+
lastEventAt:
|
|
3782
|
+
$ref: '#/components/schemas/FirestoreTimestamp'
|
|
3783
|
+
description: Timestamp of the most recent analytics event seen for this
|
|
3784
|
+
site.
|
|
3785
|
+
required:
|
|
3786
|
+
- totalEvents
|
|
3787
|
+
- totalPageViews
|
|
3788
|
+
- totalSessions
|
|
3789
|
+
- totalOrders
|
|
3790
|
+
additionalProperties: false
|
|
3791
|
+
required:
|
|
3792
|
+
- companyId
|
|
3793
|
+
- name
|
|
3794
|
+
- status
|
|
3795
|
+
- deploymentLinks
|
|
3796
|
+
- createdBy
|
|
3797
|
+
- analyticsEnabled
|
|
3798
|
+
additionalProperties: false
|
|
3799
|
+
description: 'Site model (D41 / ING-304). Collection: companies/{companyId}/sites/{siteId}.
|
|
3800
|
+
Per-company product surface. Sub-collections (magic_link_requests, allowed_users,
|
|
3801
|
+
payments, analytics_events, analytics_daily, analytics_hourly, analytics_backfills)
|
|
3802
|
+
live under this document per D40/D42.'
|
|
3803
|
+
SiteCreate:
|
|
3804
|
+
allOf:
|
|
3805
|
+
- $ref: '#/components/schemas/Site'
|
|
3806
|
+
description: Write payload for creating a new Site document. Fields marked `readOnly`
|
|
3807
|
+
are server-set and must not be included. Fields marked `x-immutable` may be
|
|
3808
|
+
set once at creation.
|
|
3809
|
+
required:
|
|
3810
|
+
- companyId
|
|
3811
|
+
- name
|
|
3812
|
+
- status
|
|
3813
|
+
- deploymentLinks
|
|
3814
|
+
- createdBy
|
|
3815
|
+
- analyticsEnabled
|
|
3816
|
+
SiteUpdate:
|
|
3817
|
+
allOf:
|
|
3818
|
+
- $ref: '#/components/schemas/Site'
|
|
3819
|
+
description: Write payload for partial update (PATCH) of a Site document. All
|
|
3820
|
+
fields optional. Fields marked `readOnly` or `x-immutable` must not be sent.
|
|
3204
3821
|
SitePayment:
|
|
3205
3822
|
type: object
|
|
3206
3823
|
properties:
|