Add expected checkout preview API using property billing policy defaults
All checks were successful
build-and-deploy / build-deploy (push) Successful in 36s

This commit is contained in:
androidlover5842
2026-02-04 14:27:15 +05:30
parent 002f11240a
commit 59a50d4313
3 changed files with 158 additions and 0 deletions

View File

@@ -1655,6 +1655,53 @@ BOOKING APIS
- 404 Not Found
- Preview expected checkout API is this one:
POST /properties/{propertyId}/bookings/expected-checkout-preview
What it does:
- Computes expected check-out timestamp from check-in + billing policy.
- `checkInAt` is required.
- `billableNights` is optional (defaults to 1).
- `billingMode` is optional (defaults to property policy mode behavior).
- `billingCheckinTime` and `billingCheckoutTime` are optional; defaults come from property billing policy.
- `propertyId` is required in path.
Request body (BookingExpectedCheckoutPreviewRequest):
{
"checkInAt": "2026-02-05T10:30:00+05:30",
"billableNights": 2,
"billingMode": "PROPERTY_POLICY",
"billingCheckinTime": "12:00",
"billingCheckoutTime": "11:00"
}
Response body (BookingExpectedCheckoutPreviewResponse):
{
"expectedCheckOutAt": "2026-02-07T11:00+05:30",
"billableNights": 2,
"billingMode": "PROPERTY_POLICY",
"billingCheckinTime": "12:00",
"billingCheckoutTime": "11:00"
}
- Allowed roles: ADMIN, MANAGER, STAFF, HOUSEKEEPING, FINANCE
Error Codes
- 400 Bad Request
- checkInAt required or invalid timestamp
- billableNights must be > 0
- Unknown billing mode
- billingCheckinTime/billingCheckoutTime invalid format
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found (property)
- Booking stream API is this one:
GET /properties/{propertyId}/bookings/{bookingId}/stream