Skip to content

Commit ba9c2d9

Browse files
committed
Remove Availability resources, consolidate field names, and introduce MeetingPoint schema to enhance consistency and clarity
1 parent 7818a5b commit ba9c2d9

22 files changed

Lines changed: 192 additions & 183 deletions

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ curl -s -H 'Authorization: Bearer demo-token' \
7979
-H 'Content-Type: application/json' \
8080
-d '{
8181
"productId": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed",
82-
"localDate": "2026-07-15",
83-
"localTime": "10:00",
82+
"date": "2026-07-15",
83+
"time": "10:00",
8484
"numberOfAdults": 2,
8585
"mainGuest": {
8686
"firstName": "Anna",
@@ -131,7 +131,7 @@ No Prism mock is deployed; `yarn mock` is for local development only.
131131
- Every 4xx response references the shared `Error` envelope under
132132
`components/responses/`.
133133
- Field semantics that differ from a partner's likely default expectation are
134-
documented inline on the field itself (see `AvailabilitySlot.capacity`,
134+
documented inline on the field itself (see `CalendarDay.vacancies`,
135135
`Money`, `BookingStatus`).
136136

137137
## Status

components/parameters/IdempotencyKey.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ in: header
33
required: false
44
description: |
55
Client-generated key making the request safe to retry. Repeated requests with
6-
the same key return the original response. **Enforcement is phased (Phase 3);
7-
the header is accepted from day one — supply it now to future-proof retries.**
6+
the same key return the original response.
87
schema:
98
type: string
109
maxLength: 255

components/responses/BadRequest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ content:
44
schema: { $ref: "../schemas/Error.yaml" }
55
example:
66
error: BAD_REQUEST
7-
errorMessage: "`localDate` is required."
7+
errorMessage: "`date` is required."
88
requestId: "req_7c2b18d2"

components/schemas/AmendRequest.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ description: |
44
unspecified fields are left unchanged. Subject to
55
`Trip.canBePartnerRescheduled` server-side.
66
properties:
7-
localDate: { type: string, format: date }
8-
localTime:
7+
date: { type: string, format: date }
8+
time:
99
type: string
1010
pattern: "^[0-2][0-9]:[0-5][0-9]$"
1111
numberOfAdults: { type: integer, minimum: 1 }
1212
numberOfChildren: { type: integer, minimum: 0 }
13-
netPrice: { $ref: "./Money.yaml" }
13+
supplierPrice: { $ref: "./Money.yaml" }

components/schemas/Availability.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

components/schemas/AvailabilitySlot.yaml

Lines changed: 0 additions & 22 deletions
This file was deleted.

components/schemas/Booking.yaml

Lines changed: 47 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,64 @@ type: object
22
description: |
33
A partner booking. Returned by create, amend, cancel, and read.
44
5-
Fields present depend on `status`:
6-
7-
- `CONFIRMED` → `mainGuest` and full guest details set.
8-
- `CANCELLED` → `cancellationReason` set; record persists for partner
9-
refund logic.
10-
required: [id, status, productId, localDate, localTime]
5+
When `status=CANCELLED`, `cancellationReason` is set and the record persists
6+
for partner refund handling.
7+
required: [id, status, productId, title, date, time, timeZone, createdAt]
118
properties:
129
id:
1310
type: string
1411
format: uuid
1512
description: Withlocals booking id.
16-
status: { $ref: "./BookingStatus.yaml" }
17-
cancellationReason:
18-
type: string
19-
enum: [guest, host, no_show, admin, other]
20-
description: Present when `status=CANCELLED`. Kept separate from the status enum.
21-
resellerReference:
13+
partnerReference:
2214
type: string
2315
description: Partner's own booking id (internally `external_id`).
2416
example: "GYG-2026-XYZ-001"
17+
2518
productId: { type: string, format: uuid }
26-
localDate: { type: string, format: date, example: "2026-07-15" }
27-
localTime:
19+
title:
20+
type: string
21+
description: Denormalized product title at the time of booking.
22+
example: "A Relaxed Morning at Hyakumanben Craft Market"
23+
24+
date: { type: string, format: date, example: "2027-10-15" }
25+
time:
2826
type: string
2927
pattern: "^[0-2][0-9]:[0-5][0-9]$"
30-
example: "10:00"
31-
guests:
32-
type: object
33-
properties:
34-
numberOfAdults: { type: integer, minimum: 1, example: 2 }
35-
numberOfChildren: { type: integer, minimum: 0, example: 0 }
36-
mainGuest: { $ref: "./Guest.yaml" }
37-
otherGuests:
38-
type: array
39-
items: { $ref: "./Guest.yaml" }
40-
netPrice: { $ref: "./Money.yaml" }
41-
meetingPoint: { type: string }
42-
specialRequest: { type: string }
28+
description: Local clock time at the experience location.
29+
example: "09:00"
30+
timeZone:
31+
type: string
32+
description: IANA time zone for `date` / `time`.
33+
example: "Asia/Tokyo"
34+
35+
status: { $ref: "./BookingStatus.yaml" }
36+
cancellationReason:
37+
type: string
38+
enum: [guest, host, no_show, admin, other]
39+
description: Present when `status=CANCELLED`.
40+
cancellationDeadline:
41+
type: string
42+
format: date-time
43+
description: Latest moment the booking can be cancelled for a full refund.
44+
example: "2027-10-08T09:00:00Z"
45+
createdAt:
46+
type: string
47+
format: date-time
48+
description: When the booking was created.
49+
example: "2026-05-24T17:11:17Z"
50+
51+
meetingPoint: { $ref: "./MeetingPoint.yaml" }
4352
tourLanguage:
4453
type: string
45-
description: ISO-639-1 language code (e.g. `en`).
54+
description: ISO-639-1 language code.
4655
example: "en"
56+
specialRequest:
57+
type: string
58+
description: Free-text note from the guest, forwarded to the host.
59+
60+
host:
61+
type: object
62+
required: [firstName]
63+
description: Minimal host details for day-of identification.
64+
properties:
65+
firstName: { type: string, example: "Ren" }
Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
type: object
22
description: One day in the availability calendar.
3-
required: [localDate, status]
3+
required: [date, status, vacancies, startingTimes]
44
properties:
5-
localDate: { type: string, format: date, example: "2026-07-15" }
5+
date: { type: string, format: date, example: "2026-07-15" }
66
status:
77
type: string
88
enum: [AVAILABLE, SOLD_OUT, CLOSED]
99
description: |
1010
- `AVAILABLE` — at least one start time has capacity.
1111
- `SOLD_OUT` — start times exist but none has capacity.
1212
- `CLOSED` — no start times configured for this day.
13+
vacancies:
14+
type: integer
15+
minimum: 0
16+
description: |
17+
Total remaining bookable spots across all start times on this day.
18+
`0` when `status` is `SOLD_OUT` or `CLOSED`.
19+
example: 20
20+
startingTimes:
21+
type: array
22+
items:
23+
type: string
24+
pattern: "^[0-2][0-9]:[0-5][0-9]$"
25+
description: |
26+
Local-time start times configured for this day (`HH:MM`, 24h).
27+
Empty when `status` is `CLOSED`. Populated for `AVAILABLE` and
28+
`SOLD_OUT` — distinguishing "no times at all" from "times exist but full".
29+
example: ["10:00", "14:00"]

components/schemas/CreateBookingRequest.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
type: object
22
description: |
3-
Body of `POST /bookings` — creates a `CONFIRMED` booking in a single call.
4-
Guest details are supplied upfront; there is no separate confirmation step
5-
in v1.
6-
required: [productId, localDate, localTime, numberOfAdults, mainGuest]
3+
Body of `POST /bookings` — creates a `CONFIRMED` booking.
4+
required: [productId, date, time, numberOfAdults, mainGuest]
75
properties:
86
productId: { type: string, format: uuid }
9-
localDate: { type: string, format: date, example: "2026-07-15" }
10-
localTime:
7+
date: { type: string, format: date, example: "2026-07-15" }
8+
time:
119
type: string
1210
pattern: "^[0-2][0-9]:[0-5][0-9]$"
1311
example: "10:00"
@@ -23,7 +21,7 @@ properties:
2321
otherGuests:
2422
type: array
2523
items: { $ref: "./Guest.yaml" }
26-
resellerReference:
24+
partnerReference:
2725
type: string
2826
description: Partner's own booking id; stored as `external_id`. Recommended for traceability.
2927
example: "GYG-2026-XYZ-001"
@@ -34,4 +32,4 @@ properties:
3432
type: string
3533
description: ISO-639-1 language code.
3634
example: "en"
37-
netPrice: { $ref: "./Money.yaml" }
35+
supplierPrice: { $ref: "./Money.yaml" }
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
type: object
2+
description: Where the experience starts.
3+
required: [name]
4+
properties:
5+
name:
6+
type: string
7+
description: Short human-readable name.
8+
example: "Hyakumanben Chion-ji Temple"
9+
address:
10+
type: string
11+
description: Formatted address line.
12+
example: "Japan, 〒600-8012 Kyoto, Shimogyo Ward, 四条大橋西詰"
13+
lat:
14+
type: number
15+
format: double
16+
description: Latitude in decimal degrees (WGS84).
17+
example: 35.0298797
18+
lon:
19+
type: number
20+
format: double
21+
description: Longitude in decimal degrees (WGS84).
22+
example: 135.7807599
23+
instructions:
24+
type: string
25+
description: Free-text guidance for finding the meeting spot.

0 commit comments

Comments
 (0)