379 Commits

Author SHA1 Message Date
fa5b3c7fc9 Add passport scan button to new booking Documents tab
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 14:52:28 +03:00
2e7abc2b7a Apply 7 calendar/booking UI improvements
1. Remove redundant "Шахматка бронирований" header from CalendarPage
2. Fix Saturday abbreviation: "су" → "сб" (use EEEEEE format)
3. Compact toggle: add "Вид" text label to button
4. Booking bars: check-in starts at 1/3 cell, check-out ends at 1/3 cell
5. BookingModal: move "Статус гостя" tags to left column
6. BookingDetailPanel: add scan button + print package in Docs tab
7. RentalBookingModal: add payment method + amount section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 14:48:06 +03:00
afe7445d7e Redesign booking detail panel with 4 tabs
- Бронь: room/dates/guests/contact (existing info)
- Гость: passport data form + scan button
- Оплата: discount selector, accept payment form, payment history
- Документы: print buttons for reg card/contract/invoice/act
- Footer: debt warning banner before check-in

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 21:00:11 +03:00
abf5f83675 Remove Tetris animation from login page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 20:44:07 +03:00
fb067816b0 Rewrite Tetris overlay with real tetrominoes (I/O/T/S/Z/J/L shapes)
White cells with colored borders, proper grid-based stacking collision.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 20:39:17 +03:00
6e5b042f57 Add calendar compact mode, Tetris login animation, maintenance rental support
- BookingCalendar: sort rooms by category, compact row height toggle
- LoginPage: Tetris tile animation after delay (module names fall & stack)
- MaintenancePage: rental objects support with filter tab and icons

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 20:31:36 +03:00
78788f68b0 Add pricing, tariffs, loyalty, maintenance, discounts features
- TariffsPage (/tariffs): rate plan builder — meal plans (RO/BB/HB/FB/AI),
  inclusions picker, price modifier (% or ₽), min nights, cancellation policy
- DynamicPricingPage (/dynamic-pricing): rule engine for weekends, holidays,
  seasons, custom date ranges, weather; interactive price calendar preview
  with colour-coded effective rates per day
- LoyaltyPage (/loyalty): program settings (points/₽, point value, expiry),
  4-level structure (Bronze/Silver/Gold/Platinum) with editable perks,
  guest portal preview mockup, top-guests leaderboard
- MaintenancePage (/maintenance): scheduled room & service downtime records;
  status flow (scheduled → in_progress → done); time range support for services
- DiscountsPage (/discounts): discount catalogue — % or ₽, category (all /
  loyalty / corporate / promo), min nights, validity dates, active toggle
- BookingModal: discount now selected from dropdown of active discounts only
  (replaces free-form input); summary shows discount name + saved amount
- Sidebar: new "Цены и тарифы" section (Тарифы, Динамические цены, Скидки);
  Управление extended with Лояльность and Тех. перерывы

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 19:56:17 +03:00
acc17387a7 Add Guests page with history/ratings and booking discounts
- New /guests page: searchable guest list with stay history, payment
  summary, rating (1-5 stars), loyalty status (Базовый/Серебряный/Золотой),
  tags (VIP, Постоянный, Корпоративный, Медовый месяц, Проблемный),
  per-guest notes, inline payments tab with debt tracking
- Guest detail modal: 3 tabs — Обзор / История проживания / Платежи
- Sidebar: added "Гости" link (UsersRound icon) in Основное section
- BookingModal: discount block — % or fixed ₽ amount, free-stay checkbox
  that zeroes room cost; summary shows strikethrough original + discount line;
  total reflects discount applied before services

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 16:42:39 +03:00
6010531114 Add migration 002: missing updated_at columns + auto-update triggers + indexes
Tables fixed:
- rooms              → added updated_at
- housekeeping_tasks → added updated_at
- channels           → added created_at + updated_at

Trigger function set_updated_at() attached to all 6 tables (hotels, users,
rooms, bookings, housekeeping_tasks, channels) — updated_at now auto-sets
on every UPDATE via BEFORE UPDATE trigger.

Indexes added for archiving / range queries:
- bookings(hotel_id, created_at), bookings(hotel_id, updated_at)
- housekeeping_tasks(hotel_id, created_at)
- rooms(hotel_id, updated_at)
- channels(hotel_id, updated_at)

Also patched 001_schema.sql so fresh installs start correct.
Migration runner is idempotent — skips already applied files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 12:09:53 +03:00
39aeafe276 Add notifications panel to topbar bell icon
- Click bell → dropdown panel (396px wide, scrollable, max-height ~100vh)
- Unread count badge on bell (shows 9+ when >9)
- Two tabs: «Все» and «Непрочитанные» with counts
- Notification types with distinct icons+colors: booking_new, booking_cancelled, booking_checkin, booking_checkout, housekeeping, channel_error, payment, review, system
- Unread items: highlighted background + left blue dot + bold title
- «Прочитать все» button when there are unread items
- Per-item: click marks as read and navigates to linked page; hover shows × to dismiss; «Перейти» hint on hover
- relativeTime helper: только что / N мин. назад / N ч. назад / вчера / дата
- Empty state for both tabs
- Closes when clicking backdrop or opening user menu

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 22:55:25 +03:00
c3723dec90 Add hotel registration flow on login page and staff users management page
LoginPage:
- Toggle between login and registration mode
- 2-step registration: step 1 (hotel name + legal entity: type ООО/ИП/АО/ПАО/Другое, company name, INN, KPP hidden for ИП, legal address), step 2 (first/last name, email, phone, password with strength indicator, confirm)
- Step indicator dots, validation with inline errors, success screen after submit
- Left panel shows benefits list when in registration mode
- «Зарегистрировать отель» / «Войти» toggle links

UsersPage (/users):
- Staff list table: avatar with custom color, name, role badge, position, contacts, last login, active status
- Roles: hotel_manager, receptionist, housekeeper, accountant, security — each with label+color
- Stats cards by role (clickable to filter)
- Search by name/email/position + role filter buttons
- UserModal: avatar color picker, name/email/phone, role selector (6 roles), position field with quick-pick suggestions per role, password field, active toggle
- Delete confirmation dialog
- Sidebar: «Сотрудники» link added to Управление section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 22:45:11 +03:00
401825c01e Activate documents module, reorganize sidebar, add cleaning plans to housekeeping
Sidebar restructure:
- Основное: Шахматка, Бронирования, Номера, Категории номеров, Доступность
- Модули: Уборка + all active addon modules (including Documents)
- Управление: План этажей, Каналы, Модули, Настройки
- Разработчикам: API

ModulesContext: documents module now active by default (version bump to 3)

HousekeepingPage: added «Планы уборки» tab with:
- Уборка при выезде: auto task creation, priority (high/normal), inspection toggle
- Ежедневная уборка: interval (every 1/2/3/7 days), start from day N of stay
- Уборка по запросу: guest-initiated via QR, priority selection
- Генеральная уборка: deep clean every N days toggle
- Проверка после уборки: inspection task after any cleaning
- Автоназначение горничной: assign based on shift schedule

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 22:38:00 +03:00
de5b56c577 Add Telegram bot notifications for managers in settings
In Settings → Notifications, new «Telegram-уведомления» section:
- Bot token input (from @BotFather)
- Step-by-step instructions: manager sends /start to bot, gets Chat ID, admin adds it
- Copyable bot invite link
- Event checkboxes: new booking, cancellation, check-in, check-out, channel error, payment
- Manager list with avatar initials, name, Chat ID, delete button
- Add manager form: name + Chat ID input
- Test message button (shown when at least one manager is added)
- Full section only visible after token is entered

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 22:32:36 +03:00
42f15b6c5b Add passport data tab to booking modal
Two tabs in the booking modal: «Бронирование» (existing) and «Документы гостя» (new).

Passport tab includes:
- Document type selector: Паспорт РФ / Загранпаспорт / Иной документ
- Full name: Фамилия / Имя / Отчество
- Date of birth, place of birth, nationality
- Document details: series + number (RF passport), or just number (other); issued by, issue date, division code (RF passport)
- Registration address
- Green dot indicator on tab when data is entered

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 22:28:43 +03:00
96dfd755ed Add room categories, documents module, guest settings, and booking improvements
- New pages: RoomCategoriesPage (category CRUD with photos, color, amenities) and DocumentsPage (template constructor with variable substitution, print packages)
- Sidebar: added "Категории номеров" link under rooms, Documents module via modulesData
- App.tsx: routes for /room-categories and /documents
- RoomModal: now accepts categories prop for categoryId select
- BookingModal: added additional services dropdown (breakfast, transfer, parking etc.) accumulating into booking total; summary shows services breakdown
- SettingsPage: new "Гости" section with guest tag CRUD (add/edit/remove, color picker, live preview); booking section toggle "Показывать поле Источник бронирования"
- modulesData: added Documents module entry (free tier, sidebar item)
- RoomsPage: passes MOCK_CATEGORIES to RoomModal
- ReviewsPage: rewritten with auto-redirect logic, threshold slider, platform settings tab

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 22:17:54 +03:00
56df6711e4 Refactor POS/Reviews/RoomService/BookingWidget/BookingModal
- 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 <noreply@anthropic.com>
2026-03-11 20:48:54 +03:00
fe76fc2f50 New module pages: POS (shift/receipt), Reviews (moderation+QR link), Room Service (live orders+menu), Rental (object CRUD+bookings)
- PosPage: shift timer, product catalog with categories, cart/receipt, cash/terminal payment, shift revenue summary
- ReviewsPage: review moderation (approve/reject/reply), public review link + redirect config, NPS/avg rating stats
- RoomServicePage: live orders with status pipeline (new→preparing→ready→delivered), menu tab with stop-list support
- RentalPage: rental object management (create/edit/delete with icon+color picker), bookings table per object
- BookingsPage: "Новая аренда" button in rental tab → 2-step flow (pick object+date → booking form)
- App.tsx: routes for /pos, /reviews, /room-service, /rental

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 20:17:40 +03:00
0e0c11785f Wide BookingModal (2-col), RoomModal, RU channels, migration module, all modules active
- BookingModal: 2-column layout (size=2xl/max-w-3xl), no scroll needed; hourly mode toggle for rooms with allowHourly=true
- RoomModal: full add/edit form with hourly rate toggle and amenities checkboxes; RoomsPage wired up
- Channel manager: Яндекс Путешествия, Островок, Суточно.ру, OneTwoTrip added; split into RU/International sections
- Migration module: 3-step wizard (source select → file upload → progress/results)
- All modules set to active by default (version bump to reset localStorage)
- BookingCalendar booking blocks: guest count badge (Xг), unpaid red dot indicator

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 19:16:55 +03:00
fbf4b269e3 Floor map: drag & drop room editor with background image support
- Edit mode toggle on FloorMapPage (кнопка Редактировать / Готово)
- Rooms are draggable within the canvas in edit mode; positions persist to localStorage per floor
- Upload a floor plan image as background (per floor), stored as base64 in localStorage
- Reset button to clear custom layout back to auto-grid
- Grid-dot pattern background when no image is uploaded
- Hint bar in edit mode; drag cursor, hover ring on draggable cards
- View mode: click free room → create booking (unchanged)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 19:00:15 +03:00
57c22be60d Add floor map, rental module wiring, VIP tags and payment tracking in BookingModal
- New: Поэтажный план (/floor-map) — room status visualization per floor with color coding
  (occupied/arriving/departing/available/dirty/maintenance), click free room to create booking
- New: FloorMapModal — embeddable in BookingModal via "Поэтажный план" button near room selector
- New: RentalBookingModal — full-day toggle, hour start/end selects, conflict detection, price summary
- CalendarPage: rental objects/bookings shown in шахматка when rental module is active
- BookingsPage: "Аренда" tab with rental bookings table when rental module is active
- BookingModal: guest tags (VIP, Постоянный гость, etc.), payment method (cash/terminal),
  paidAmount input, debt/задолженность display, floor map quick-access button
- Sidebar: "План этажей" nav link added under Управление

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 17:08:10 +03:00
74e0223c3c Fix module descriptions: QR-код for reviews, remove from rental
- Reviews: QR-код в номере добавлен как первый канал сбора отзывов
- Rental: убрано упоминание QR-кода, аренда оформляется менеджером из PMS

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 15:27:51 +03:00
bf8ac76ff0 Add 4 new modules: Касса, Отзывы, Room Service, Аренда
- Касса (POS): продажи на ресепшн, мини-бар, фискальные чеки ОФД, эквайринг
- Сбор отзывов: авто-запрос после выезда, перехват негатива, NPS дашборд
- Room Service: заказ еды через QR-код в номере без приложения
- Аренда объектов: почасовая аренда кортов, бань, залов через PMS и QR

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 15:21:11 +03:00
c233590c4b Major UX improvements across multiple pages
Шахматка:
- Date/period picker dropdown on navigation button (choose start date + days window)
- Cancelled bookings fade out with animation after 1 second

Бронирования:
- Clickable column headers with sort asc/desc (Гость, Заезд, Выезд, Статус, Источник, Сумма)

Страница входа:
- Removed role-based account selector — just email + password
- System auto-detects role/hotel from credentials

Настройки:
- New "Бронирование" section with room assignment strategy (spread/together/sequential/manual)
- Notifications: SMTP email config + SMS provider config (SMSC, SMS.ru, МТС, etc.)

Модули:
- Added Housekeeping and Channel Manager as proper modules
- Channel Manager lists: Booking.com, Airbnb, Яндекс Путешествия, Островок, Суточно.ру, OneTwoTrip
- Housekeeping visible to all roles (including housekeeper) via module status
- Sidebar now uses module status to show/hide Уборка and Каналы

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 15:20:05 +03:00
4e615359eb Move cell/range toggle near arrows, add period picker on date button
- Replaced static "Сегодня" button with a dropdown picker (▾) showing
  current start date and visible days count
- Picker lets user choose any start date + days count (14/30/45/60д)
- "Сегодня" quick-reset inside picker + "Показать" confirms navigation
- Arrows now step by visibleDays instead of fixed 14
- Moved By-cell / By-range toggle into the left nav group (next to arrows)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 14:58:29 +03:00
01449dcdfa Add cell edit mode toggle to Availability Calendar
- New toggle button "По ячейке / По диапазону" in toolbar
- Cell edit mode: clicking a specific category cell locks editing to that
  category only, leaving other categories' prices untouched
- EditPanel header shows category name + "только эта категория" label
- Grid highlights only the locked category row when in cell mode
- Cursor changes to crosshair in cell edit mode
- Legend hint updates to reflect current mode

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 14:52:23 +03:00
b277e3e38d Add Availability Calendar, Modules system, and route refactoring
- Add AvailabilityPage with price grid (categories × dates), drag-select,
  channel prices, EditPanel, PeriodModal, and rate periods tab
- Add ModulesContext with localStorage persistence and dynamic sidebar items
- Add ModulesPage with WiFi Auth, Payments, TV Welcome, Smart Locks,
  OLAP Reports, Website Builder, Booking Widget modules
- Add ReportsPage (OLAP analytics with KPI cards, charts, tables)
- Add WebsitePage and BookingWidgetPage placeholders
- Remove hotel slug from URL routing; hotel context from JWT
- Add Доступность nav item in Sidebar under Управление
- Fix LoginPage redirects and HotelSync branding

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 14:43:18 +03:00
63c9ae574f ci: switch to self-hosted runner, run deploy directly on host 2026-03-10 20:46:04 +03:00
fa335f1763 ci: add Gitea Actions auto-deploy workflow 2026-03-10 20:43:13 +03:00
420d55d57e Initial commit: HotelSync PMS v0.1.0
- React 18 + TypeScript + Vite + Tailwind CSS
- Шахматка бронирований (drag-to-book)
- Страницы: Calendar, Bookings, Rooms, Housekeeping, Channels, API Docs, Settings
- Роли: super_admin, hotel_manager, housekeeper
- Светлая/тёмная тема
- Docker + Nginx конфигурация
- Лендинг hotelsync.ru
2026-03-10 20:38:32 +03:00