@voyant-travel/openapi 0.2.6 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/package.json +8 -5
  2. package/spec/admin/accommodations.json +1395 -0
  3. package/spec/admin/action-ledger.json +6202 -0
  4. package/spec/admin/booking-requirements.json +5689 -0
  5. package/spec/admin/bookings.json +18794 -0
  6. package/spec/admin/catalog.json +690 -0
  7. package/spec/admin/distribution.json +19581 -0
  8. package/spec/admin/external-refs.json +1382 -0
  9. package/spec/admin/extras.json +4648 -0
  10. package/spec/admin/finance.json +35506 -0
  11. package/spec/admin/identity.json +4072 -0
  12. package/spec/admin/legal.json +14339 -0
  13. package/spec/admin/markets.json +5286 -0
  14. package/spec/admin/notifications.json +8409 -0
  15. package/spec/admin/operations.json +39806 -0
  16. package/spec/admin/operator-settings.json +1389 -0
  17. package/spec/admin/pricing.json +10640 -0
  18. package/spec/admin/products.json +22131 -0
  19. package/spec/admin/promotions.json +2730 -0
  20. package/spec/admin/quotes.json +7033 -0
  21. package/spec/admin/relationships.json +13911 -0
  22. package/spec/admin/sellability.json +4840 -0
  23. package/spec/admin/storefront.json +1953 -0
  24. package/spec/admin/suppliers.json +5850 -0
  25. package/spec/admin/trips.json +9357 -0
  26. package/spec/framework-admin.json +2812 -552
  27. package/spec/framework-openapi.json +2710 -276
  28. package/spec/framework-storefront.json +178 -4
  29. package/spec/storefront/booking-requirements.json +367 -0
  30. package/spec/storefront/bookings.json +6137 -0
  31. package/spec/storefront/catalog.json +690 -0
  32. package/spec/storefront/customer-portal.json +6038 -0
  33. package/spec/storefront/finance.json +4824 -0
  34. package/spec/storefront/legal.json +2082 -0
  35. package/spec/storefront/markets.json +256 -0
  36. package/spec/storefront/operator-settings.json +309 -0
  37. package/spec/storefront/pricing.json +585 -0
  38. package/spec/storefront/products.json +2910 -0
  39. package/spec/storefront/storefront-verification.json +909 -0
  40. package/spec/storefront/storefront.json +4067 -0
  41. package/spec/storefront/trips.json +9357 -0
@@ -0,0 +1,1395 @@
1
+ {
2
+ "openapi": "3.1.0",
3
+ "info": {
4
+ "title": "Voyant Framework API",
5
+ "version": "0.0.0",
6
+ "description": "Generated from the Voyant framework's standard module composition. Do not edit by hand."
7
+ },
8
+ "components": {
9
+ "schemas": {
10
+ "CatalogSearchFilter": {
11
+ "anyOf": [
12
+ {
13
+ "type": "object",
14
+ "properties": {
15
+ "kind": {
16
+ "type": "string",
17
+ "enum": [
18
+ "eq"
19
+ ]
20
+ },
21
+ "field": {
22
+ "type": "string",
23
+ "minLength": 1
24
+ },
25
+ "value": {
26
+ "anyOf": [
27
+ {
28
+ "type": "string"
29
+ },
30
+ {
31
+ "type": "number"
32
+ },
33
+ {
34
+ "type": "boolean"
35
+ }
36
+ ]
37
+ }
38
+ },
39
+ "required": [
40
+ "kind",
41
+ "field",
42
+ "value"
43
+ ]
44
+ },
45
+ {
46
+ "type": "object",
47
+ "properties": {
48
+ "kind": {
49
+ "type": "string",
50
+ "enum": [
51
+ "in"
52
+ ]
53
+ },
54
+ "field": {
55
+ "type": "string",
56
+ "minLength": 1
57
+ },
58
+ "values": {
59
+ "type": "array",
60
+ "items": {
61
+ "anyOf": [
62
+ {
63
+ "type": "string"
64
+ },
65
+ {
66
+ "type": "number"
67
+ }
68
+ ]
69
+ }
70
+ }
71
+ },
72
+ "required": [
73
+ "kind",
74
+ "field",
75
+ "values"
76
+ ]
77
+ },
78
+ {
79
+ "type": "object",
80
+ "properties": {
81
+ "kind": {
82
+ "type": "string",
83
+ "enum": [
84
+ "range"
85
+ ]
86
+ },
87
+ "field": {
88
+ "type": "string",
89
+ "minLength": 1
90
+ },
91
+ "gte": {
92
+ "type": "number"
93
+ },
94
+ "lte": {
95
+ "type": "number"
96
+ }
97
+ },
98
+ "required": [
99
+ "kind",
100
+ "field"
101
+ ]
102
+ },
103
+ {
104
+ "type": "object",
105
+ "properties": {
106
+ "kind": {
107
+ "type": "string",
108
+ "enum": [
109
+ "and"
110
+ ]
111
+ },
112
+ "clauses": {
113
+ "type": "array",
114
+ "items": {
115
+ "$ref": "#/components/schemas/CatalogSearchFilter"
116
+ }
117
+ }
118
+ },
119
+ "required": [
120
+ "kind",
121
+ "clauses"
122
+ ]
123
+ },
124
+ {
125
+ "type": "object",
126
+ "properties": {
127
+ "kind": {
128
+ "type": "string",
129
+ "enum": [
130
+ "or"
131
+ ]
132
+ },
133
+ "clauses": {
134
+ "type": "array",
135
+ "items": {
136
+ "$ref": "#/components/schemas/CatalogSearchFilter"
137
+ }
138
+ }
139
+ },
140
+ "required": [
141
+ "kind",
142
+ "clauses"
143
+ ]
144
+ }
145
+ ]
146
+ }
147
+ },
148
+ "parameters": {}
149
+ },
150
+ "paths": {
151
+ "/v1/admin/accommodations/room-blocks": {
152
+ "post": {
153
+ "requestBody": {
154
+ "required": true,
155
+ "content": {
156
+ "application/json": {
157
+ "schema": {
158
+ "type": "object",
159
+ "properties": {
160
+ "roomTypeId": {
161
+ "type": "string",
162
+ "minLength": 1
163
+ },
164
+ "name": {
165
+ "type": "string",
166
+ "minLength": 1
167
+ },
168
+ "currency": {
169
+ "type": "string",
170
+ "minLength": 1
171
+ },
172
+ "programId": {
173
+ "type": "string",
174
+ "minLength": 1
175
+ },
176
+ "supplierId": {
177
+ "type": "string",
178
+ "minLength": 1
179
+ },
180
+ "propertyId": {
181
+ "type": "string",
182
+ "minLength": 1
183
+ },
184
+ "netRateCents": {
185
+ "type": "integer",
186
+ "minimum": 0
187
+ },
188
+ "sellRateCents": {
189
+ "type": "integer",
190
+ "minimum": 0
191
+ },
192
+ "optionDate": {
193
+ "type": "string",
194
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
195
+ },
196
+ "cutoffDate": {
197
+ "type": "string",
198
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
199
+ },
200
+ "notes": {
201
+ "type": "string"
202
+ }
203
+ },
204
+ "required": [
205
+ "roomTypeId",
206
+ "name",
207
+ "currency"
208
+ ]
209
+ }
210
+ }
211
+ }
212
+ },
213
+ "responses": {
214
+ "201": {
215
+ "description": "The created room block (starts in `inquiry`; nights are set separately)",
216
+ "content": {
217
+ "application/json": {
218
+ "schema": {
219
+ "type": "object",
220
+ "properties": {
221
+ "data": {
222
+ "type": "object",
223
+ "properties": {
224
+ "id": {
225
+ "type": "string"
226
+ },
227
+ "programId": {
228
+ "type": [
229
+ "string",
230
+ "null"
231
+ ]
232
+ },
233
+ "supplierId": {
234
+ "type": [
235
+ "string",
236
+ "null"
237
+ ]
238
+ },
239
+ "propertyId": {
240
+ "type": [
241
+ "string",
242
+ "null"
243
+ ]
244
+ },
245
+ "roomTypeId": {
246
+ "type": "string"
247
+ },
248
+ "name": {
249
+ "type": "string"
250
+ },
251
+ "status": {
252
+ "type": "string",
253
+ "enum": [
254
+ "inquiry",
255
+ "held",
256
+ "confirmed",
257
+ "released",
258
+ "cancelled",
259
+ "expired"
260
+ ]
261
+ },
262
+ "currency": {
263
+ "type": "string"
264
+ },
265
+ "netRateCents": {
266
+ "type": [
267
+ "integer",
268
+ "null"
269
+ ]
270
+ },
271
+ "sellRateCents": {
272
+ "type": [
273
+ "integer",
274
+ "null"
275
+ ]
276
+ },
277
+ "optionDate": {
278
+ "type": [
279
+ "string",
280
+ "null"
281
+ ]
282
+ },
283
+ "cutoffDate": {
284
+ "type": [
285
+ "string",
286
+ "null"
287
+ ]
288
+ },
289
+ "attritionTerms": {
290
+ "type": [
291
+ "object",
292
+ "null"
293
+ ],
294
+ "additionalProperties": {}
295
+ },
296
+ "depositTerms": {
297
+ "type": [
298
+ "object",
299
+ "null"
300
+ ],
301
+ "additionalProperties": {}
302
+ },
303
+ "notes": {
304
+ "type": [
305
+ "string",
306
+ "null"
307
+ ]
308
+ },
309
+ "metadata": {
310
+ "type": [
311
+ "object",
312
+ "null"
313
+ ],
314
+ "additionalProperties": {}
315
+ },
316
+ "createdAt": {
317
+ "type": "string"
318
+ },
319
+ "updatedAt": {
320
+ "type": "string"
321
+ }
322
+ },
323
+ "required": [
324
+ "id",
325
+ "programId",
326
+ "supplierId",
327
+ "propertyId",
328
+ "roomTypeId",
329
+ "name",
330
+ "status",
331
+ "currency",
332
+ "netRateCents",
333
+ "sellRateCents",
334
+ "optionDate",
335
+ "cutoffDate",
336
+ "attritionTerms",
337
+ "depositTerms",
338
+ "notes",
339
+ "metadata",
340
+ "createdAt",
341
+ "updatedAt"
342
+ ]
343
+ }
344
+ },
345
+ "required": [
346
+ "data"
347
+ ]
348
+ }
349
+ }
350
+ }
351
+ },
352
+ "400": {
353
+ "description": "Invalid request body",
354
+ "content": {
355
+ "application/json": {
356
+ "schema": {
357
+ "type": "object",
358
+ "properties": {
359
+ "error": {
360
+ "type": "string"
361
+ }
362
+ },
363
+ "required": [
364
+ "error"
365
+ ]
366
+ }
367
+ }
368
+ }
369
+ }
370
+ }
371
+ }
372
+ },
373
+ "/v1/admin/accommodations/room-blocks/{id}": {
374
+ "get": {
375
+ "parameters": [
376
+ {
377
+ "schema": {
378
+ "type": "string"
379
+ },
380
+ "required": true,
381
+ "name": "id",
382
+ "in": "path"
383
+ }
384
+ ],
385
+ "responses": {
386
+ "200": {
387
+ "description": "The room block header plus its derived pickup summary",
388
+ "content": {
389
+ "application/json": {
390
+ "schema": {
391
+ "type": "object",
392
+ "properties": {
393
+ "data": {
394
+ "type": "object",
395
+ "properties": {
396
+ "block": {
397
+ "type": "object",
398
+ "properties": {
399
+ "id": {
400
+ "type": "string"
401
+ },
402
+ "programId": {
403
+ "type": [
404
+ "string",
405
+ "null"
406
+ ]
407
+ },
408
+ "supplierId": {
409
+ "type": [
410
+ "string",
411
+ "null"
412
+ ]
413
+ },
414
+ "propertyId": {
415
+ "type": [
416
+ "string",
417
+ "null"
418
+ ]
419
+ },
420
+ "roomTypeId": {
421
+ "type": "string"
422
+ },
423
+ "name": {
424
+ "type": "string"
425
+ },
426
+ "status": {
427
+ "type": "string",
428
+ "enum": [
429
+ "inquiry",
430
+ "held",
431
+ "confirmed",
432
+ "released",
433
+ "cancelled",
434
+ "expired"
435
+ ]
436
+ },
437
+ "currency": {
438
+ "type": "string"
439
+ },
440
+ "netRateCents": {
441
+ "type": [
442
+ "integer",
443
+ "null"
444
+ ]
445
+ },
446
+ "sellRateCents": {
447
+ "type": [
448
+ "integer",
449
+ "null"
450
+ ]
451
+ },
452
+ "optionDate": {
453
+ "type": [
454
+ "string",
455
+ "null"
456
+ ]
457
+ },
458
+ "cutoffDate": {
459
+ "type": [
460
+ "string",
461
+ "null"
462
+ ]
463
+ },
464
+ "attritionTerms": {
465
+ "type": [
466
+ "object",
467
+ "null"
468
+ ],
469
+ "additionalProperties": {}
470
+ },
471
+ "depositTerms": {
472
+ "type": [
473
+ "object",
474
+ "null"
475
+ ],
476
+ "additionalProperties": {}
477
+ },
478
+ "notes": {
479
+ "type": [
480
+ "string",
481
+ "null"
482
+ ]
483
+ },
484
+ "metadata": {
485
+ "type": [
486
+ "object",
487
+ "null"
488
+ ],
489
+ "additionalProperties": {}
490
+ },
491
+ "createdAt": {
492
+ "type": "string"
493
+ },
494
+ "updatedAt": {
495
+ "type": "string"
496
+ }
497
+ },
498
+ "required": [
499
+ "id",
500
+ "programId",
501
+ "supplierId",
502
+ "propertyId",
503
+ "roomTypeId",
504
+ "name",
505
+ "status",
506
+ "currency",
507
+ "netRateCents",
508
+ "sellRateCents",
509
+ "optionDate",
510
+ "cutoffDate",
511
+ "attritionTerms",
512
+ "depositTerms",
513
+ "notes",
514
+ "metadata",
515
+ "createdAt",
516
+ "updatedAt"
517
+ ]
518
+ },
519
+ "summary": {
520
+ "type": [
521
+ "object",
522
+ "null"
523
+ ],
524
+ "properties": {
525
+ "blockId": {
526
+ "type": "string"
527
+ },
528
+ "status": {
529
+ "type": "string",
530
+ "enum": [
531
+ "inquiry",
532
+ "held",
533
+ "confirmed",
534
+ "released",
535
+ "cancelled",
536
+ "expired"
537
+ ]
538
+ },
539
+ "totalHeld": {
540
+ "type": "integer"
541
+ },
542
+ "totalPickedUp": {
543
+ "type": "integer"
544
+ },
545
+ "totalReleased": {
546
+ "type": "integer"
547
+ },
548
+ "totalRemaining": {
549
+ "type": "integer"
550
+ },
551
+ "pickupProgress": {
552
+ "type": "string",
553
+ "enum": [
554
+ "none",
555
+ "partial",
556
+ "full"
557
+ ]
558
+ }
559
+ },
560
+ "required": [
561
+ "blockId",
562
+ "status",
563
+ "totalHeld",
564
+ "totalPickedUp",
565
+ "totalReleased",
566
+ "totalRemaining",
567
+ "pickupProgress"
568
+ ]
569
+ }
570
+ },
571
+ "required": [
572
+ "block",
573
+ "summary"
574
+ ]
575
+ }
576
+ },
577
+ "required": [
578
+ "data"
579
+ ]
580
+ }
581
+ }
582
+ }
583
+ },
584
+ "404": {
585
+ "description": "Room block not found",
586
+ "content": {
587
+ "application/json": {
588
+ "schema": {
589
+ "type": "object",
590
+ "properties": {
591
+ "error": {
592
+ "type": "string"
593
+ }
594
+ },
595
+ "required": [
596
+ "error"
597
+ ]
598
+ }
599
+ }
600
+ }
601
+ }
602
+ }
603
+ }
604
+ },
605
+ "/v1/admin/accommodations/room-blocks/{id}/nights": {
606
+ "put": {
607
+ "parameters": [
608
+ {
609
+ "schema": {
610
+ "type": "string"
611
+ },
612
+ "required": true,
613
+ "name": "id",
614
+ "in": "path"
615
+ }
616
+ ],
617
+ "requestBody": {
618
+ "required": true,
619
+ "description": "Upsert the held inventory (and optional rate overrides) per night. Only `roomsHeld` and the rate overrides are caller-controlled; the pickup / release counters are owned by the lifecycle actions and never set here.",
620
+ "content": {
621
+ "application/json": {
622
+ "schema": {
623
+ "type": "object",
624
+ "properties": {
625
+ "nights": {
626
+ "type": "array",
627
+ "items": {
628
+ "type": "object",
629
+ "properties": {
630
+ "date": {
631
+ "type": "string",
632
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
633
+ },
634
+ "roomsHeld": {
635
+ "type": "integer",
636
+ "minimum": 0
637
+ },
638
+ "netRateCentsOverride": {
639
+ "type": "integer",
640
+ "minimum": 0
641
+ },
642
+ "sellRateCentsOverride": {
643
+ "type": "integer",
644
+ "minimum": 0
645
+ }
646
+ },
647
+ "required": [
648
+ "date",
649
+ "roomsHeld"
650
+ ]
651
+ },
652
+ "minItems": 1
653
+ }
654
+ },
655
+ "required": [
656
+ "nights"
657
+ ]
658
+ }
659
+ }
660
+ }
661
+ },
662
+ "responses": {
663
+ "200": {
664
+ "description": "The recomputed block summary after the nights upsert",
665
+ "content": {
666
+ "application/json": {
667
+ "schema": {
668
+ "type": "object",
669
+ "properties": {
670
+ "data": {
671
+ "type": [
672
+ "object",
673
+ "null"
674
+ ],
675
+ "properties": {
676
+ "blockId": {
677
+ "type": "string"
678
+ },
679
+ "status": {
680
+ "type": "string",
681
+ "enum": [
682
+ "inquiry",
683
+ "held",
684
+ "confirmed",
685
+ "released",
686
+ "cancelled",
687
+ "expired"
688
+ ]
689
+ },
690
+ "totalHeld": {
691
+ "type": "integer"
692
+ },
693
+ "totalPickedUp": {
694
+ "type": "integer"
695
+ },
696
+ "totalReleased": {
697
+ "type": "integer"
698
+ },
699
+ "totalRemaining": {
700
+ "type": "integer"
701
+ },
702
+ "pickupProgress": {
703
+ "type": "string",
704
+ "enum": [
705
+ "none",
706
+ "partial",
707
+ "full"
708
+ ]
709
+ }
710
+ },
711
+ "required": [
712
+ "blockId",
713
+ "status",
714
+ "totalHeld",
715
+ "totalPickedUp",
716
+ "totalReleased",
717
+ "totalRemaining",
718
+ "pickupProgress"
719
+ ]
720
+ }
721
+ },
722
+ "required": [
723
+ "data"
724
+ ]
725
+ }
726
+ }
727
+ }
728
+ },
729
+ "400": {
730
+ "description": "Invalid request body",
731
+ "content": {
732
+ "application/json": {
733
+ "schema": {
734
+ "type": "object",
735
+ "properties": {
736
+ "error": {
737
+ "type": "string"
738
+ }
739
+ },
740
+ "required": [
741
+ "error"
742
+ ]
743
+ }
744
+ }
745
+ }
746
+ },
747
+ "404": {
748
+ "description": "Room block not found",
749
+ "content": {
750
+ "application/json": {
751
+ "schema": {
752
+ "type": "object",
753
+ "properties": {
754
+ "error": {
755
+ "type": "string"
756
+ }
757
+ },
758
+ "required": [
759
+ "error"
760
+ ]
761
+ }
762
+ }
763
+ }
764
+ }
765
+ }
766
+ }
767
+ },
768
+ "/v1/admin/accommodations/room-blocks/{id}/pickups": {
769
+ "post": {
770
+ "parameters": [
771
+ {
772
+ "schema": {
773
+ "type": "string"
774
+ },
775
+ "required": true,
776
+ "name": "id",
777
+ "in": "path"
778
+ }
779
+ ],
780
+ "requestBody": {
781
+ "required": true,
782
+ "description": "Record a pickup against the block. Idempotent on `stayBookingItemId`: re-processing the same stay item returns the existing active pickup with a 200 instead of a 201.",
783
+ "content": {
784
+ "application/json": {
785
+ "schema": {
786
+ "type": "object",
787
+ "properties": {
788
+ "bookingId": {
789
+ "type": "string",
790
+ "minLength": 1
791
+ },
792
+ "stayBookingItemId": {
793
+ "type": "string",
794
+ "minLength": 1
795
+ },
796
+ "checkIn": {
797
+ "type": "string",
798
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
799
+ },
800
+ "checkOut": {
801
+ "type": "string",
802
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
803
+ },
804
+ "rooms": {
805
+ "type": "integer",
806
+ "minimum": 1,
807
+ "default": 1
808
+ }
809
+ },
810
+ "required": [
811
+ "checkIn",
812
+ "checkOut"
813
+ ]
814
+ }
815
+ }
816
+ }
817
+ },
818
+ "responses": {
819
+ "200": {
820
+ "description": "An existing active pickup (idempotent replay on `stayBookingItemId`)",
821
+ "content": {
822
+ "application/json": {
823
+ "schema": {
824
+ "type": "object",
825
+ "properties": {
826
+ "data": {
827
+ "type": "object",
828
+ "properties": {
829
+ "id": {
830
+ "type": "string"
831
+ },
832
+ "blockId": {
833
+ "type": "string"
834
+ },
835
+ "bookingId": {
836
+ "type": [
837
+ "string",
838
+ "null"
839
+ ]
840
+ },
841
+ "stayBookingItemId": {
842
+ "type": [
843
+ "string",
844
+ "null"
845
+ ]
846
+ },
847
+ "checkIn": {
848
+ "type": "string"
849
+ },
850
+ "checkOut": {
851
+ "type": "string"
852
+ },
853
+ "rooms": {
854
+ "type": "integer"
855
+ },
856
+ "status": {
857
+ "type": "string",
858
+ "enum": [
859
+ "active",
860
+ "reversed"
861
+ ]
862
+ },
863
+ "pickedUpAt": {
864
+ "type": "string"
865
+ },
866
+ "reversedAt": {
867
+ "type": [
868
+ "string",
869
+ "null"
870
+ ]
871
+ }
872
+ },
873
+ "required": [
874
+ "id",
875
+ "blockId",
876
+ "bookingId",
877
+ "stayBookingItemId",
878
+ "checkIn",
879
+ "checkOut",
880
+ "rooms",
881
+ "status",
882
+ "pickedUpAt",
883
+ "reversedAt"
884
+ ]
885
+ }
886
+ },
887
+ "required": [
888
+ "data"
889
+ ]
890
+ }
891
+ }
892
+ }
893
+ },
894
+ "201": {
895
+ "description": "The newly recorded pickup",
896
+ "content": {
897
+ "application/json": {
898
+ "schema": {
899
+ "type": "object",
900
+ "properties": {
901
+ "data": {
902
+ "type": "object",
903
+ "properties": {
904
+ "id": {
905
+ "type": "string"
906
+ },
907
+ "blockId": {
908
+ "type": "string"
909
+ },
910
+ "bookingId": {
911
+ "type": [
912
+ "string",
913
+ "null"
914
+ ]
915
+ },
916
+ "stayBookingItemId": {
917
+ "type": [
918
+ "string",
919
+ "null"
920
+ ]
921
+ },
922
+ "checkIn": {
923
+ "type": "string"
924
+ },
925
+ "checkOut": {
926
+ "type": "string"
927
+ },
928
+ "rooms": {
929
+ "type": "integer"
930
+ },
931
+ "status": {
932
+ "type": "string",
933
+ "enum": [
934
+ "active",
935
+ "reversed"
936
+ ]
937
+ },
938
+ "pickedUpAt": {
939
+ "type": "string"
940
+ },
941
+ "reversedAt": {
942
+ "type": [
943
+ "string",
944
+ "null"
945
+ ]
946
+ }
947
+ },
948
+ "required": [
949
+ "id",
950
+ "blockId",
951
+ "bookingId",
952
+ "stayBookingItemId",
953
+ "checkIn",
954
+ "checkOut",
955
+ "rooms",
956
+ "status",
957
+ "pickedUpAt",
958
+ "reversedAt"
959
+ ]
960
+ }
961
+ },
962
+ "required": [
963
+ "data"
964
+ ]
965
+ }
966
+ }
967
+ }
968
+ },
969
+ "400": {
970
+ "description": "Invalid check-in/check-out range",
971
+ "content": {
972
+ "application/json": {
973
+ "schema": {
974
+ "type": "object",
975
+ "properties": {
976
+ "error": {
977
+ "type": "string"
978
+ }
979
+ },
980
+ "required": [
981
+ "error"
982
+ ]
983
+ }
984
+ }
985
+ }
986
+ },
987
+ "404": {
988
+ "description": "Room block not found",
989
+ "content": {
990
+ "application/json": {
991
+ "schema": {
992
+ "type": "object",
993
+ "properties": {
994
+ "error": {
995
+ "type": "string"
996
+ }
997
+ },
998
+ "required": [
999
+ "error"
1000
+ ]
1001
+ }
1002
+ }
1003
+ }
1004
+ },
1005
+ "409": {
1006
+ "description": "The block is no longer accepting pickups, or a night has insufficient inventory (the latter carries a `detail` with the short night)",
1007
+ "content": {
1008
+ "application/json": {
1009
+ "schema": {
1010
+ "anyOf": [
1011
+ {
1012
+ "type": "object",
1013
+ "properties": {
1014
+ "error": {
1015
+ "type": "string"
1016
+ }
1017
+ },
1018
+ "required": [
1019
+ "error"
1020
+ ]
1021
+ },
1022
+ {
1023
+ "type": "object",
1024
+ "properties": {
1025
+ "error": {
1026
+ "type": "string"
1027
+ },
1028
+ "detail": {
1029
+ "type": "object",
1030
+ "properties": {
1031
+ "date": {
1032
+ "type": "string"
1033
+ },
1034
+ "remaining": {
1035
+ "type": "integer"
1036
+ },
1037
+ "needed": {
1038
+ "type": "integer"
1039
+ }
1040
+ },
1041
+ "required": [
1042
+ "date",
1043
+ "remaining",
1044
+ "needed"
1045
+ ]
1046
+ }
1047
+ },
1048
+ "required": [
1049
+ "error",
1050
+ "detail"
1051
+ ]
1052
+ }
1053
+ ]
1054
+ }
1055
+ }
1056
+ }
1057
+ }
1058
+ }
1059
+ }
1060
+ },
1061
+ "/v1/admin/accommodations/room-blocks/{id}/pickups/reverse": {
1062
+ "post": {
1063
+ "parameters": [
1064
+ {
1065
+ "schema": {
1066
+ "type": "string"
1067
+ },
1068
+ "required": true,
1069
+ "name": "id",
1070
+ "in": "path"
1071
+ }
1072
+ ],
1073
+ "requestBody": {
1074
+ "required": true,
1075
+ "description": "Reverse a pickup (booking cancelled / rooms reduced). Exactly one of `pickupId` or `stayBookingItemId` is required; the body schema enforces this, so a request with neither (or both) fails request validation with a 400 `invalid_request`. A well-formed request whose pickup isn't found (or belongs to a different block) returns 404.",
1076
+ "content": {
1077
+ "application/json": {
1078
+ "schema": {
1079
+ "type": "object",
1080
+ "properties": {
1081
+ "pickupId": {
1082
+ "type": "string",
1083
+ "minLength": 1
1084
+ },
1085
+ "stayBookingItemId": {
1086
+ "type": "string",
1087
+ "minLength": 1
1088
+ }
1089
+ }
1090
+ }
1091
+ }
1092
+ }
1093
+ },
1094
+ "responses": {
1095
+ "200": {
1096
+ "description": "The reversed pickup ledger row",
1097
+ "content": {
1098
+ "application/json": {
1099
+ "schema": {
1100
+ "type": "object",
1101
+ "properties": {
1102
+ "data": {
1103
+ "type": "object",
1104
+ "properties": {
1105
+ "id": {
1106
+ "type": "string"
1107
+ },
1108
+ "blockId": {
1109
+ "type": "string"
1110
+ },
1111
+ "bookingId": {
1112
+ "type": [
1113
+ "string",
1114
+ "null"
1115
+ ]
1116
+ },
1117
+ "stayBookingItemId": {
1118
+ "type": [
1119
+ "string",
1120
+ "null"
1121
+ ]
1122
+ },
1123
+ "checkIn": {
1124
+ "type": "string"
1125
+ },
1126
+ "checkOut": {
1127
+ "type": "string"
1128
+ },
1129
+ "rooms": {
1130
+ "type": "integer"
1131
+ },
1132
+ "status": {
1133
+ "type": "string",
1134
+ "enum": [
1135
+ "active",
1136
+ "reversed"
1137
+ ]
1138
+ },
1139
+ "pickedUpAt": {
1140
+ "type": "string"
1141
+ },
1142
+ "reversedAt": {
1143
+ "type": [
1144
+ "string",
1145
+ "null"
1146
+ ]
1147
+ }
1148
+ },
1149
+ "required": [
1150
+ "id",
1151
+ "blockId",
1152
+ "bookingId",
1153
+ "stayBookingItemId",
1154
+ "checkIn",
1155
+ "checkOut",
1156
+ "rooms",
1157
+ "status",
1158
+ "pickedUpAt",
1159
+ "reversedAt"
1160
+ ]
1161
+ }
1162
+ },
1163
+ "required": [
1164
+ "data"
1165
+ ]
1166
+ }
1167
+ }
1168
+ }
1169
+ },
1170
+ "400": {
1171
+ "description": "Invalid body — neither (or both) of `pickupId`/`stayBookingItemId` supplied",
1172
+ "content": {
1173
+ "application/json": {
1174
+ "schema": {
1175
+ "type": "object",
1176
+ "properties": {
1177
+ "error": {
1178
+ "type": "string"
1179
+ }
1180
+ },
1181
+ "required": [
1182
+ "error"
1183
+ ]
1184
+ }
1185
+ }
1186
+ }
1187
+ },
1188
+ "404": {
1189
+ "description": "Active pickup not found (or it belongs to a different block)",
1190
+ "content": {
1191
+ "application/json": {
1192
+ "schema": {
1193
+ "type": "object",
1194
+ "properties": {
1195
+ "error": {
1196
+ "type": "string"
1197
+ }
1198
+ },
1199
+ "required": [
1200
+ "error"
1201
+ ]
1202
+ }
1203
+ }
1204
+ }
1205
+ }
1206
+ }
1207
+ }
1208
+ },
1209
+ "/v1/admin/accommodations/room-blocks/{id}/release": {
1210
+ "post": {
1211
+ "parameters": [
1212
+ {
1213
+ "schema": {
1214
+ "type": "string"
1215
+ },
1216
+ "required": true,
1217
+ "name": "id",
1218
+ "in": "path"
1219
+ }
1220
+ ],
1221
+ "responses": {
1222
+ "200": {
1223
+ "description": "Unpicked rooms released back to the property; the block moves to `released`",
1224
+ "content": {
1225
+ "application/json": {
1226
+ "schema": {
1227
+ "type": "object",
1228
+ "properties": {
1229
+ "data": {
1230
+ "type": "object",
1231
+ "properties": {
1232
+ "releasedRooms": {
1233
+ "type": "integer"
1234
+ },
1235
+ "block": {
1236
+ "type": "object",
1237
+ "properties": {
1238
+ "id": {
1239
+ "type": "string"
1240
+ },
1241
+ "programId": {
1242
+ "type": [
1243
+ "string",
1244
+ "null"
1245
+ ]
1246
+ },
1247
+ "supplierId": {
1248
+ "type": [
1249
+ "string",
1250
+ "null"
1251
+ ]
1252
+ },
1253
+ "propertyId": {
1254
+ "type": [
1255
+ "string",
1256
+ "null"
1257
+ ]
1258
+ },
1259
+ "roomTypeId": {
1260
+ "type": "string"
1261
+ },
1262
+ "name": {
1263
+ "type": "string"
1264
+ },
1265
+ "status": {
1266
+ "type": "string",
1267
+ "enum": [
1268
+ "inquiry",
1269
+ "held",
1270
+ "confirmed",
1271
+ "released",
1272
+ "cancelled",
1273
+ "expired"
1274
+ ]
1275
+ },
1276
+ "currency": {
1277
+ "type": "string"
1278
+ },
1279
+ "netRateCents": {
1280
+ "type": [
1281
+ "integer",
1282
+ "null"
1283
+ ]
1284
+ },
1285
+ "sellRateCents": {
1286
+ "type": [
1287
+ "integer",
1288
+ "null"
1289
+ ]
1290
+ },
1291
+ "optionDate": {
1292
+ "type": [
1293
+ "string",
1294
+ "null"
1295
+ ]
1296
+ },
1297
+ "cutoffDate": {
1298
+ "type": [
1299
+ "string",
1300
+ "null"
1301
+ ]
1302
+ },
1303
+ "attritionTerms": {
1304
+ "type": [
1305
+ "object",
1306
+ "null"
1307
+ ],
1308
+ "additionalProperties": {}
1309
+ },
1310
+ "depositTerms": {
1311
+ "type": [
1312
+ "object",
1313
+ "null"
1314
+ ],
1315
+ "additionalProperties": {}
1316
+ },
1317
+ "notes": {
1318
+ "type": [
1319
+ "string",
1320
+ "null"
1321
+ ]
1322
+ },
1323
+ "metadata": {
1324
+ "type": [
1325
+ "object",
1326
+ "null"
1327
+ ],
1328
+ "additionalProperties": {}
1329
+ },
1330
+ "createdAt": {
1331
+ "type": "string"
1332
+ },
1333
+ "updatedAt": {
1334
+ "type": "string"
1335
+ }
1336
+ },
1337
+ "required": [
1338
+ "id",
1339
+ "programId",
1340
+ "supplierId",
1341
+ "propertyId",
1342
+ "roomTypeId",
1343
+ "name",
1344
+ "status",
1345
+ "currency",
1346
+ "netRateCents",
1347
+ "sellRateCents",
1348
+ "optionDate",
1349
+ "cutoffDate",
1350
+ "attritionTerms",
1351
+ "depositTerms",
1352
+ "notes",
1353
+ "metadata",
1354
+ "createdAt",
1355
+ "updatedAt"
1356
+ ]
1357
+ }
1358
+ },
1359
+ "required": [
1360
+ "releasedRooms",
1361
+ "block"
1362
+ ]
1363
+ }
1364
+ },
1365
+ "required": [
1366
+ "data"
1367
+ ]
1368
+ }
1369
+ }
1370
+ }
1371
+ },
1372
+ "404": {
1373
+ "description": "Room block not found",
1374
+ "content": {
1375
+ "application/json": {
1376
+ "schema": {
1377
+ "type": "object",
1378
+ "properties": {
1379
+ "error": {
1380
+ "type": "string"
1381
+ }
1382
+ },
1383
+ "required": [
1384
+ "error"
1385
+ ]
1386
+ }
1387
+ }
1388
+ }
1389
+ }
1390
+ }
1391
+ }
1392
+ }
1393
+ },
1394
+ "webhooks": {}
1395
+ }