- RoomContextMenu: separate TECH_PRIORITY_ITEMS with 'Экстренно!' label for urgent
- Tech task form uses 3-column grid (all priorities visible at once)
- Red highlight when Экстренно! is selected
- Show "🔒 Номер будет закрыт для бронирования" warning under priority selector
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- TechnicalPage: redesign task cards with separate "Задача" and "Решение" sections
- "Задача": problem description + problem photos (editable before done)
- "Решение": technician resolution comment + resolution photos (green section)
- Resolution comment in CompletionModal now saves to resolution_notes field
- Resolution photos save to resolution_photos (no longer mixed with problem photos)
- RoomModal history tab: maintenance entries show separate problem/resolution sections
- Backend: add resolution_notes, resolution_photos to PATCH allowed fields
- Migration 029: resolution_notes TEXT + resolution_photos TEXT[] columns
- RoomsPage: load active maintenance tasks, show 🔧 неисправность badge on room cards
- CalendarPage: load active maintenance tasks, show 🔧 неиспр. label in calendar row
- BookingCalendar: activeMaintenance prop, WS handler updates maintenance set on task changes
- CalendarPage WS: handle housekeeping_task_created to update activeMaintenance set
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- RoomModal: new "История" tab showing all housekeeping and maintenance tasks for the room
- Groups tasks by date (newest first), expandable cards
- Shows: assignee, start time, end time, duration (started_at → completed_at)
- For maintenance: description, problem/solution photos with lightbox viewer
- Timing grid: start / completion timestamps
- Backend GET /housekeeping: add room_id filter param
- TechnicalPage CompletionModal: add resolution comment field saved to task notes
- api.ts: housekeeping.list() accepts roomId param
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Calendar: hover tooltip on '🧹 убирается' shows who is cleaning (assignee name)
fetched from active HK tasks on mount, updated via WS housekeeping_updated events
- HousekeepingPage: 'Сообщить о неисправности' now creates a real maintenance task
in the DB (category=maintenance) + sends WS so TechnicalPage receives it instantly;
photo upload added to the report form
- RoomContextMenu: photo upload added to tech task creation form (camera button,
preview thumbnails); photos passed through to API on task creation
- TechnicalPage: selecting 'Выполнено' now opens CompletionModal with photo upload;
technician can attach completion photos before confirming; if require_completion_photo
setting is on — at least one photo is required
- Settings (HousekeepingPage plans tab): new toggle 'Обязательное фото при завершении
тех. задачи' saved to housekeeping_settings.require_completion_photo (migration 027)
- Backend: housekeeping-settings updated with require_completion_photo field
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove 'Убирается' (cleaning) from manually selectable HK statuses in calendar context menu — it now only shows automatically when a task is in_progress
- Reduce priorities from 4 to 3: remove 'high', keep urgent/medium/low across context menu, tech tasks modal, and HousekeepingTask type
- Add photo upload to technical tasks: upload via camera button per task, display thumbnails with hover-to-remove, stored as TEXT[] in DB (migration 026)
- Fix HousekeepingPage WS handler to filter by category — no longer adds maintenance tasks to housekeeping board
- Add 'tasks' folder support to upload route
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add migration 025 to add `category` column (housekeeping/maintenance) to housekeeping_tasks
- Backend: filter by ?category= in GET, store category in POST, allow patching category
- API client: HkPayload + housekeeping.list() now support category param
- HousekeepingPage: filters by category=housekeeping so maintenance tasks don't appear
- RoomContextMenu: priority sub-form for dirty/cleaning status, tech task creation inline form
- BookingCalendar: accepts onMaintenanceTaskCreate prop, passes priority to onRoomUpdate
- CalendarPage: handleRoomUpdate creates task for dirty+cleaning (with priority), new handleMaintenanceTaskCreate for category=maintenance tasks
- TechnicalPage: new page for viewing/creating/updating maintenance tasks
- App.tsx: /technical route added
- Sidebar: Тех. задачи nav item added under Управление
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PostgreSQL NUMERIC columns are returned as strings by node-postgres.
Added normalizeRoom() that coerces baseRate/hourlyRate/floor to JS numbers
before they reach components, eliminating string concatenation bugs like
"300005000.005000.00" in price calculations.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Backend:
- Migration 023: housekeeping_settings table (checkout_auto, checkout_priority, inspection_after_clean)
- New route: GET/PATCH /api/hotels/:slug/housekeeping-settings
- bookings.ts: on checked_out → auto-create turnover task + mark room dirty + broadcast WS
- housekeeping.ts: on task done → update room status (inspect|clean per setting) + broadcast WS
- ws.ts: export broadcast() for use in other routes
Frontend:
- HousekeepingPage: load/save settings to API, live Loader on save button
- useHotelSocket: add housekeeping WS message types
- HousekeepingPage: subscribe to WS — new tasks appear instantly without refresh
- BookingModal: show total section when room + nights selected (not just when total > 0)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use parseISO instead of new Date() for safer date parsing
- Use Math.floor(nights) to avoid float iteration issues
- Type-check override price before using (typeof p === 'number')
- Label now shows actual sum from overrides instead of baseRate × nights
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Load rate_overrides in CalendarPage, pass as priceOverrides to BookingCalendar
- Tooltip shows override price for the hovered date (falls back to baseRate)
- BookingModal sums per-night prices from overrides for the stay period
- Room baseRate now only used as initial default for availability grid
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Calendar overlay: normalize date strings (slice 0-10) to handle full ISO timestamps from Postgres; fix off-by-one (to = exclusive); stronger stripe visibility; guard against vFrom >= vTo
- Context menu: dateFrom defaults to today, indefinite defaults to false (both date inputs shown immediately)
- DateRangeForm: extracted DateInput component with CalendarDays icon that triggers native date picker
- HK status order: clean → inspect → cleaning → dirty
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Calendar cells: hold mouse 600ms to show price tooltip for that date/room (baseRate + hourly rate if enabled)
- AvailabilityPage: load real categories from API, derive basePrice from room baseRates, fall back to room types if no categories
- Rate periods: persisted to DB via new /api/hotels/:slug/rate-periods endpoint
- New backend migration 021_rate_periods.sql + rate-periods route
- Added api.ratePeriods.{list,create,update,delete} to frontend API client
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- DB migration 020: add maintenance_from, maintenance_to to rooms
- Room type + RoomPayload: maintenanceFrom, maintenanceTo fields
- Context menu: clicking "На ремонт"/"Закрыт" expands inline date picker
(С / По + "Без срока" checkbox), confirms with "Применить" button
- Calendar: stripe overlay covers only the maintenance date range
(full row if no dates set, partial if date range specified)
- Booking creation: if drag-selected dates overlap with maintenance period,
shows warning dialog with "Отмена" / "Всё равно забронировать"
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Diagonal stripe overlay on date cells: orange tint for maintenance,
grey for blocked
- Room number and name dimmed when maintenance/blocked
- Show 🧹 dirty/cleaning indicator under room number (when not in maintenance)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add BedTypesContext with default types + add/remove/update operations
- Replace hardcoded BED_ITEM_TYPES array in RoomModal with useBedTypes()
- Add "Справочник спальных мест" section to RoomCategoriesPage
(expandable, same UX as amenities: add icon+label, rename, delete)
- BedItem.type changed from union to string for dynamic support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add BulkRoomModal: set number range (from→to), category, bed type,
max guests, base rate, amenities; auto-derives floor from room number;
preview shows new vs skipped (already existing) rooms
- Add category filter chips on Rooms page (alongside existing floor filter)
- Add "Групповое добавление" button next to "Добавить номер"
- Wire onDelete prop to RoomModal on rooms page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Placeholder shows next free after global max (e.g. 204 if 203 is max)
- Error message suggests next free starting from typed+1:
type 101 (taken) → suggests 102
type 201 (taken) → suggests 202
type 1011 (taken) → suggests 1012
- Suggestion is a clickable link that auto-fills the field
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- BookingCalendar: remove type badge below room number (already shown in group header)
- RoomModal: validate number against existingNumbers before save
- Red border + error message if number taken
- Placeholder shows next free number (e.g. if 101,102 exist → placeholder 103)
- Save button disabled while number is taken
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- BookingModal (room tab): replace Фамилия/Имя/Отчество grid with single 'ФИО *' input; parseFullName() splits by spaces into last/first/middle; DB search via api.guests.list (debounced 300ms); dropdown shows current bookings + DB guests with phone/email autofill
- BookingDetailPanel: merge Фамилия (with autocomplete) + Имя + Отчество into single ФИО * input; existing acQuery/acResults infrastructure reused; parseFio() updates all 3 bgForm fields on every keystroke; openEditForm initializes ФИО from full name
- RentalBookingModal + BookingModal rental tab: include middleName when displaying DB guest results and when setting guestName on selection; update type to include middleName field
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rental bookings now use minutes since midnight (start_hour/end_hour
store e.g. 495 for 8:15, 570 for 9:30) — DB migration 017
- Buffer applied in exact minutes (no hour ceiling): 15min buffer after
9:00 booking → next slot available at 9:15
- Calendar cell: removed working-hours line (8:00–22:00), now shows
colored dot + compact time per booking (8–10, 8:15–9:15)
- Time selects show HH:MM format for 15-min intervals
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When existing bookings block the initial startHour, effectiveStartHour
snaps to the first available slot. Added useLayoutEffect to update
endHour state immediately so start and end times are never equal.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- getMaxEndHour now subtracts breakHours from next booking's start,
so you can't book right up to a slot that needs buffer time before it
- effectiveStartHour moved before availableEndHours so equal start/end
times are no longer possible
- maskPhone (+7 (XXX) XXX-XX-XX) applied to phone field in RentalBookingModal
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
BookingModal:
- Add 'Номер' / 'Аренда объекта' tabs when rental objects exist
- Rental tab: object picker, date, full-day toggle, conflict-aware time dropdowns, guest/phone fields, total amount
RentalBookingModal:
- Filter start times: exclude hours inside booked slots + bufferMinutes gap
- Filter end times: cap at next booking's start hour
- Disable 'Весь день' if any timed bookings exist for the day
- Show 'Все слоты заняты' when no start hours are available
- Show buffer duration in time section label
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously earlyOutDate defaulted to today, which caused bookings checked
out on their first day (checkIn == today) to become 0-night invisible blocks
in the calendar. Now defaults to the planned checkOut date so the bar stays
visible; manager explicitly sets an earlier date for early departure.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PostgreSQL DATE columns serialize as ISO strings with time component
(2026-03-21T00:00:00.000Z), causing string comparison with yyyy-MM-dd
to incorrectly show the early check-in banner for same-day bookings.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 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>
Replaces simple 'Выселить' button with a checkout form:
- Date picker (min=checkIn, max=original checkOut)
- If leaving early: shows refund nights, refund amount, and payment method selector
- Adds negative payment record to local payment history
- On confirm: sets status=checked_out and updates checkOut date
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Show amber banner on confirmed bookings where check-in is in the future.
Opens an inline form to check in today: checks if current room is free,
otherwise shows available rooms with price difference. Allows overriding
checkout date. On confirm, sets status=checked_in and check-in=today.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Track guestIsKnown: true when selected from dropdown, false when typed manually
- If guest is new (typed manually): phone field is required (red border + hint)
- On save: if new guest + slug available, call api.guests.create before saving rental
- Button shows 'Сохранение...' while saving, disabled during async flow
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- BookingCalendar: normalize date comparison with .slice(0,10) to fix PostgreSQL DATE ISO format mismatch
- CalendarPage: show alert on rental booking save failure
- RentalBookingModal: add debounced DB guest search (api.guests.list) with 300ms delay
- RentalBookingModal: combine booking suggestions + DB results in unified dropdown
- Pass slug prop to RentalBookingModal for API access
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Guest name field shows dropdown with matching guests from all bookings
- Checked-in guests (🏠) shown first, then confirmed (📅)
- Selecting a guest auto-fills name and phone
- New 'Привязать к номеру' dropdown to link rental to a room booking
- Selecting a linked room auto-fills guest name if empty
- Pass bookings + rooms props from BookingCalendar to modal
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Left column: 80px on mobile (was 160px), hide room name/price/type badge
- Category headers: truncate text, reduce padding on mobile
- Toolbar: hide "Вид" button on mobile (sm:hidden)
- Toolbar: add compact "+" button next to month label on mobile only
- Original "+" button hidden on mobile (hidden sm:inline-flex)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>