feat: early check-in / late checkout fees with room-level configuration

- DB migration 016: add early_checkin_fee, late_checkout_fee to rooms table
- Backend rooms: support new fee columns in POST/PATCH
- Backend hotel-settings GET: also returns check_in_time, check_out_time
- Room type + RoomPayload: add earlyCheckinFee, lateCheckoutFee fields
- RoomModal: add fee amount inputs in pricing section
- SettingsPage: add toggles for early_checkin_enabled / late_checkout_enabled
- BookingDetailPanel: on check-in shows fee warning + adds payment record if
  current time is before checkInTime and fee is set on the room; same logic
  for check-out after checkOutTime

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-21 19:24:36 +03:00
parent 9f1dd0c8c9
commit edd493e24e
8 changed files with 195 additions and 25 deletions

View File

@@ -381,6 +381,7 @@ export interface RoomPayload {
sortOrder?: number; allowHourly?: boolean; hourlyRate?: number
extraPlace?: unknown; childPolicy?: unknown
description?: string; photos?: string[]
earlyCheckinFee?: number | null; lateCheckoutFee?: number | null
}
function toRoomPayload(r: Partial<RoomPayload>): Record<string, unknown> {
@@ -402,8 +403,10 @@ function toRoomPayload(r: Partial<RoomPayload>): Record<string, unknown> {
if (r.hourlyRate !== undefined) out.hourly_rate = r.hourlyRate
if (r.extraPlace !== undefined) out.extra_place = r.extraPlace
if (r.childPolicy !== undefined) out.child_policy = r.childPolicy
if (r.description !== undefined) out.description = r.description
if (r.photos !== undefined) out.photos = r.photos
if (r.description !== undefined) out.description = r.description
if (r.photos !== undefined) out.photos = r.photos
if (r.earlyCheckinFee !== undefined) out.early_checkin_fee = r.earlyCheckinFee
if (r.lateCheckoutFee !== undefined) out.late_checkout_fee = r.lateCheckoutFee
return out
}