diff --git a/src/components/bookings/BookingModal.tsx b/src/components/bookings/BookingModal.tsx index 0f18526..5c0658c 100644 --- a/src/components/bookings/BookingModal.tsx +++ b/src/components/bookings/BookingModal.tsx @@ -2,8 +2,8 @@ import { useState } from 'react' import { format } from 'date-fns' import { Star, Banknote, CreditCard, AlertCircle, Map } from 'lucide-react' import { Modal } from '../ui/Modal' -import { cn, BOOKING_STATUS_LABELS, SOURCE_LABELS } from '../../lib/utils' -import type { Booking, DraftBooking, Room, BookingStatus, BookingSource } from '../../types' +import { cn, BOOKING_STATUS_LABELS } from '../../lib/utils' +import type { Booking, DraftBooking, Room, BookingStatus } from '../../types' import { FloorMapModal } from '../floormap/FloorMapModal' const GUEST_TAGS = ['VIP', 'Постоянный гость', 'Корпоративный', 'Медовый месяц', 'День рождения', 'Особые пожелания'] @@ -21,16 +21,15 @@ interface BookingModalProps { export function BookingModal({ open, draft, rooms, onClose, onSave, existing }: BookingModalProps) { const [form, setForm] = useState({ - roomId: existing?.roomId ?? draft.roomId, - guestName: existing?.guestName ?? '', - guestEmail: existing?.guestEmail ?? '', - checkIn: existing?.checkIn ?? draft.checkIn, - checkOut: existing?.checkOut ?? draft.checkOut, - adults: existing?.adults ?? 2, - children: existing?.children ?? 0, - source: (existing?.source ?? 'direct') as BookingSource, - status: (existing?.status ?? 'confirmed') as BookingStatus, - notes: existing?.notes ?? '', + roomId: existing?.roomId ?? draft.roomId, + guestName: existing?.guestName ?? '', + guestEmail:existing?.guestEmail ?? '', + checkIn: existing?.checkIn ?? draft.checkIn, + checkOut: existing?.checkOut ?? draft.checkOut, + adults: existing?.adults ?? 2, + children: existing?.children ?? 0, + status: (existing?.status ?? 'confirmed') as BookingStatus, + notes: existing?.notes ?? '', }) const [guestTags, setGuestTags] = useState([]) const [paymentMethod, setPaymentMethod] = useState<'cash' | 'terminal' | null>(null) @@ -79,6 +78,7 @@ export function BookingModal({ open, draft, rooms, onClose, onSave, existing }: onSave({ ...form, + source: 'direct', checkIn, checkOut, notes: hourlyPrefix + form.notes, @@ -109,9 +109,10 @@ export function BookingModal({ open, draft, rooms, onClose, onSave, existing }: } > +
{/* ── LEFT COLUMN ── */} -
+
{/* Room */}
@@ -271,9 +272,9 @@ export function BookingModal({ open, draft, rooms, onClose, onSave, existing }: )} {/* Adults + Children + Status */} -
+
-