feat: cleaning tooltip, report photos, fix tech task creation, completion photos
- Calendar: hover tooltip on '🧹 убирается' shows who is cleaning (assignee name) fetched from active HK tasks on mount, updated via WS housekeeping_updated events - HousekeepingPage: 'Сообщить о неисправности' now creates a real maintenance task in the DB (category=maintenance) + sends WS so TechnicalPage receives it instantly; photo upload added to the report form - RoomContextMenu: photo upload added to tech task creation form (camera button, preview thumbnails); photos passed through to API on task creation - TechnicalPage: selecting 'Выполнено' now opens CompletionModal with photo upload; technician can attach completion photos before confirming; if require_completion_photo setting is on — at least one photo is required - Settings (HousekeepingPage plans tab): new toggle 'Обязательное фото при завершении тех. задачи' saved to housekeeping_settings.require_completion_photo (migration 027) - Backend: housekeeping-settings updated with require_completion_photo field Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -29,7 +29,9 @@ interface BookingCalendarProps {
|
||||
onBookingUpdate: (id: string, b: Partial<Booking>) => void
|
||||
onBookingBulkUpdate?: (updates: Array<{ id: string; data: Partial<Booking> }>) => void
|
||||
onRoomUpdate?: (roomId: string, patch: Partial<Room>, priority?: HkPriority) => void
|
||||
onMaintenanceTaskCreate?: (roomId: string, description: string, priority: HkPriority) => void
|
||||
onMaintenanceTaskCreate?: (roomId: string, description: string, priority: HkPriority, photos: string[]) => void
|
||||
/** roomId → assignee name, for tooltip on "убирается" */
|
||||
cleaningAssignees?: Record<string, string>
|
||||
fadingBookingIds?: Set<string>
|
||||
rentalObjects?: RentalObject[]
|
||||
rentalBookings?: RentalBooking[]
|
||||
@@ -63,7 +65,7 @@ function getRoomTypeColor(type: string): string {
|
||||
return map[type] ?? 'bg-slate-100 text-slate-600 dark:bg-slate-700 dark:text-slate-300'
|
||||
}
|
||||
|
||||
export function BookingCalendar({ rooms, bookings, slug, onBookingCreate, onBookingUpdate, onBookingBulkUpdate, onRoomUpdate, onMaintenanceTaskCreate, fadingBookingIds, rentalObjects, rentalBookings, onRentalBookingCreate, locks = new Map(), onDraftStart, onDraftCancel, wsConnected, priceOverrides }: BookingCalendarProps) {
|
||||
export function BookingCalendar({ rooms, bookings, slug, onBookingCreate, onBookingUpdate, onBookingBulkUpdate, onRoomUpdate, onMaintenanceTaskCreate, cleaningAssignees = {}, fadingBookingIds, rentalObjects, rentalBookings, onRentalBookingCreate, locks = new Map(), onDraftStart, onDraftCancel, wsConnected, priceOverrides }: BookingCalendarProps) {
|
||||
const [startDate, setStartDate] = useState(() => startOfDay(new Date()))
|
||||
const [visibleDays, setVisibleDays] = useState(DAYS_VISIBLE)
|
||||
|
||||
@@ -88,8 +90,8 @@ export function BookingCalendar({ rooms, bookings, slug, onBookingCreate, onBook
|
||||
onRoomUpdate?.(roomId, { housekeepingStatus: status }, priority)
|
||||
}
|
||||
|
||||
const handleCtxMaintenanceTask = (roomId: string, description: string, priority: HkPriority) => {
|
||||
onMaintenanceTaskCreate?.(roomId, description, priority)
|
||||
const handleCtxMaintenanceTask = (roomId: string, description: string, priority: HkPriority, photos: string[]) => {
|
||||
onMaintenanceTaskCreate?.(roomId, description, priority, photos)
|
||||
}
|
||||
|
||||
// Cell hover price tooltip
|
||||
@@ -521,7 +523,12 @@ export function BookingCalendar({ rooms, bookings, slug, onBookingCreate, onBook
|
||||
)}
|
||||
{room.status !== 'maintenance' && room.status !== 'blocked' &&
|
||||
(room.housekeepingStatus === 'dirty' || room.housekeepingStatus === 'cleaning') && (
|
||||
<span className="text-[10px] text-red-500 dark:text-red-400 font-medium leading-none">
|
||||
<span
|
||||
className="text-[10px] text-red-500 dark:text-red-400 font-medium leading-none cursor-default"
|
||||
title={room.housekeepingStatus === 'cleaning' && cleaningAssignees[room.id]
|
||||
? `Убирает: ${cleaningAssignees[room.id]}`
|
||||
: undefined}
|
||||
>
|
||||
{room.housekeepingStatus === 'dirty' ? '🧹 грязный' : '🧹 убирается'}
|
||||
</span>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user