feat: staff work schedule — weekly grid for all roles, shift assignment, day off marking

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-26 01:18:02 +03:00
parent 17012ae3ca
commit 5d5efecd9e
7 changed files with 587 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
CREATE TABLE IF NOT EXISTS staff_schedules (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
hotel_id UUID NOT NULL REFERENCES hotels(id) ON DELETE CASCADE,
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
date DATE NOT NULL,
shift_start TIME,
shift_end TIME,
is_day_off BOOLEAN NOT NULL DEFAULT false,
notes TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
UNIQUE(hotel_id, user_id, date)
);