feat: checklists, minibar and deposit modules
- DB migrations 057-059: checklist_templates/items/completions, minibar_items/consumptions, hotel_deposit_settings, booking_deposits - Backend routes: checklists (templates CRUD + task completions), minibar (items + consumptions), deposit (settings, cash/yookassa hold, release/capture) - YooKassa service for hold/capture/cancel payments - Frontend: ChecklistSettingsPage, MinibarSettingsPage, DepositSettingsPage - HousekeepingPage: task cards now show checklist + minibar panel with checkboxes and quantity buttons - BookingModal: minibar charges summary + deposit management (cash/YooKassa/release) for existing bookings - Sidebar + App.tsx: new routes /settings/checklists, /settings/minibar, /settings/deposit Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
27
backend/migrations/057_checklists.sql
Normal file
27
backend/migrations/057_checklists.sql
Normal file
@@ -0,0 +1,27 @@
|
||||
-- Шаблоны чек-листов
|
||||
CREATE TABLE checklist_templates (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
hotel_id UUID NOT NULL REFERENCES hotels(id) ON DELETE CASCADE,
|
||||
name TEXT NOT NULL,
|
||||
task_type TEXT, -- 'checkout', 'daily', 'deep', NULL = all types
|
||||
is_active BOOLEAN NOT NULL DEFAULT true,
|
||||
sort_order INTEGER NOT NULL DEFAULT 0,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE TABLE checklist_items (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
template_id UUID NOT NULL REFERENCES checklist_templates(id) ON DELETE CASCADE,
|
||||
text TEXT NOT NULL,
|
||||
sort_order INTEGER NOT NULL DEFAULT 0
|
||||
);
|
||||
|
||||
-- Отметки выполнения пункта (привязаны к задаче уборки)
|
||||
CREATE TABLE checklist_completions (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
task_id UUID NOT NULL REFERENCES housekeeping_tasks(id) ON DELETE CASCADE,
|
||||
item_id UUID NOT NULL REFERENCES checklist_items(id) ON DELETE CASCADE,
|
||||
completed_by UUID REFERENCES users(id),
|
||||
completed_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
UNIQUE(task_id, item_id)
|
||||
);
|
||||
Reference in New Issue
Block a user