feat: add category field to housekeeping tasks + TechnicalPage for maintenance tasks
- 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>
This commit is contained in:
@@ -215,10 +215,11 @@ export const api = {
|
||||
|
||||
// ── Housekeeping ──────────────────────────────────────────────────────────
|
||||
housekeeping: {
|
||||
list: (slug: string, params?: { date?: string; status?: string }) => {
|
||||
list: (slug: string, params?: { date?: string; status?: string; category?: string }) => {
|
||||
const qs = new URLSearchParams()
|
||||
if (params?.date) qs.set('date', params.date)
|
||||
if (params?.status) qs.set('status', params.status)
|
||||
if (params?.category) qs.set('category', params.category)
|
||||
const q = qs.toString()
|
||||
return req<HousekeepingTask[]>('GET', `/api/hotels/${slug}/housekeeping${q ? `?${q}` : ''}`)
|
||||
},
|
||||
@@ -554,6 +555,7 @@ function toBookingPayload(b: Partial<BookingPayload>): Record<string, unknown> {
|
||||
export interface HkPayload {
|
||||
room_id?: string; type?: string; priority?: string
|
||||
status?: string; assignee_id?: string; notes?: string; due_date?: string
|
||||
category?: string
|
||||
}
|
||||
|
||||
export interface HkSettings {
|
||||
|
||||
Reference in New Issue
Block a user