From 56df6711e43738537abaaf3d6f5cbb9e0519dcfe Mon Sep 17 00:00:00 2001 From: HotelSync Date: Wed, 11 Mar 2026 20:48:54 +0300 Subject: [PATCH] Refactor POS/Reviews/RoomService/BookingWidget/BookingModal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - POS: complete rewrite — shift management + room payments (not products); ATOL placeholder; room balance sidebar; receipts log - BookingModal: remove "Источник" field; restructure layout (notes+summary as bottom full-width row, eliminating scroll) - Reviews: negative (<2 stars = <4/10) → moderation with private manager reply; positive → redirect to external platforms (Booking.com, Яндекс, Google); new tabs: "Требуют ответа" / "Перенаправить" - RoomService: add orderType (room delivery / restaurant table); service charge % for room delivery; scheduledTime for restaurant; paymentStatus (online_paid / pending); settings tab - BookingWidget: complete redesign — live widget constructor with color picker, language, rooms+rental tabs, payment provider selector; live preview; install code tab Co-Authored-By: Claude Sonnet 4.6 --- src/components/bookings/BookingModal.tsx | 165 +++--- src/pages/BookingWidgetPage.tsx | 607 +++++++++++++++++++++-- src/pages/PosPage.tsx | 570 +++++++++++---------- src/pages/ReviewsPage.tsx | 363 ++++++++------ src/pages/RoomServicePage.tsx | 381 +++++++++----- 5 files changed, 1417 insertions(+), 669 deletions(-) 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 */} -
+
-