fix: housekeeping tasks not appearing + add history tab + fix task type
- Fix root cause: CalendarPage created tasks with type='regular' which violated DB CHECK constraint (allowed: cleaning/turnover/inspection/maintenance/amenities) → INSERT silently failed. Fixed to type='cleaning'.
- Fix: HousekeepingPage now loads ALL active tasks (status=active = pending+in_progress) without date filter — tasks appear regardless of when they were created
- Backend: support ?status=active filter (translates to IN ('pending','in_progress'))
- Add "История" tab in HousekeepingPage: shows completed tasks for a selected date with prev/next navigation, assignee and completion time displayed
- WS handler: when task becomes done, move it from active list instead of keeping in place
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,11 @@ const housekeeping: FastifyPluginAsync = async (fastify) => {
|
||||
let idx = 2
|
||||
|
||||
const { status, date, category } = request.query
|
||||
if (status) { conditions.push(`t.status = $${idx}`); values.push(status); idx++ }
|
||||
if (status === 'active') {
|
||||
conditions.push(`t.status IN ('pending', 'in_progress')`)
|
||||
} else if (status) {
|
||||
conditions.push(`t.status = $${idx}`); values.push(status); idx++
|
||||
}
|
||||
if (date) { conditions.push(`t.due_date = $${idx}`); values.push(date); idx++ }
|
||||
if (category) { conditions.push(`t.category = $${idx}`); values.push(category); idx++ }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user