feat: tariff selector in BookingModal
- Migration 050: add tariff_id FK to bookings table - Backend: accept tariff_id in POST/PATCH bookings - Frontend: load active tariffs in BookingModal, show tariff dropdown - Price calculation applies tariff modifier (percent or fixed) before discount - tariffId forwarded through CalendarPage → api.bookings.create/update Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -691,6 +691,7 @@ export interface BookingPayload {
|
||||
roomId?: string; guestName?: string; guestEmail?: string; guestPhone?: string
|
||||
checkIn?: string; checkOut?: string; adults?: number; children?: number
|
||||
status?: string; source?: string; totalAmount?: number; paidAmount?: number; notes?: string
|
||||
tariffId?: string | null
|
||||
}
|
||||
|
||||
function toBookingPayload(b: Partial<BookingPayload>): Record<string, unknown> {
|
||||
@@ -708,6 +709,7 @@ function toBookingPayload(b: Partial<BookingPayload>): Record<string, unknown> {
|
||||
if (b.totalAmount !== undefined) out.total_amount = b.totalAmount
|
||||
if (b.paidAmount !== undefined) out.paid_amount = b.paidAmount
|
||||
if (b.notes !== undefined) out.notes = b.notes
|
||||
if (b.tariffId !== undefined) out.tariff_id = b.tariffId
|
||||
return out
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user