feat: photos for tech tasks, 3 priorities, remove cleaning status from context menu
- Remove 'Убирается' (cleaning) from manually selectable HK statuses in calendar context menu — it now only shows automatically when a task is in_progress - Reduce priorities from 4 to 3: remove 'high', keep urgent/medium/low across context menu, tech tasks modal, and HousekeepingTask type - Add photo upload to technical tasks: upload via camera button per task, display thumbnails with hover-to-remove, stored as TEXT[] in DB (migration 026) - Fix HousekeepingPage WS handler to filter by category — no longer adds maintenance tasks to housekeeping board - Add 'tasks' folder support to upload route Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
3
backend/migrations/026_task_photos.sql
Normal file
3
backend/migrations/026_task_photos.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
-- Add photos array to housekeeping_tasks
|
||||
ALTER TABLE housekeeping_tasks
|
||||
ADD COLUMN IF NOT EXISTS photos TEXT[] NOT NULL DEFAULT '{}';
|
||||
@@ -92,7 +92,7 @@ const housekeeping: FastifyPluginAsync = async (fastify) => {
|
||||
const hotelId = await getHotelId(slug)
|
||||
if (!hotelId) return reply.code(404).send({ error: 'Hotel not found' })
|
||||
|
||||
const allowed = ['room_id','type','status','priority','assignee_id','notes','due_date','category']
|
||||
const allowed = ['room_id','type','status','priority','assignee_id','notes','due_date','category','photos']
|
||||
const updates: string[] = []
|
||||
const values: unknown[] = []
|
||||
let idx = 1
|
||||
|
||||
@@ -7,7 +7,7 @@ import { pipeline } from 'stream/promises'
|
||||
const UPLOADS_DIR = process.env.UPLOADS_DIR ?? join(process.cwd(), 'uploads')
|
||||
const CDN_HOST = process.env.CDN_HOST ?? 'cdn.hotelsync.ru'
|
||||
|
||||
const ALLOWED_FOLDERS = ['categories', 'rooms', 'hotels', 'guests'] as const
|
||||
const ALLOWED_FOLDERS = ['categories', 'rooms', 'hotels', 'guests', 'tasks'] as const
|
||||
type UploadFolder = typeof ALLOWED_FOLDERS[number]
|
||||
|
||||
const ALLOWED_TYPES = ['image/jpeg', 'image/png', 'image/webp', 'image/gif']
|
||||
|
||||
Reference in New Issue
Block a user