Add centralized amenities directory and hourly booking example

- AmenitiesContext: shared amenities list with add/edit/delete, available app-wide
- RoomsPage: collapsible Справочник удобств section (add/rename/delete)
- RoomModal + RoomCategoriesPage: use amenities from context, no hardcoded lists
- RoomCategoriesPage: removed custom amenity input (use справочник instead)
- mockData: room 103 now has allowHourly=true, added sample hourly booking (today, 10-13ч)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-16 15:40:01 +03:00
parent c347c99228
commit 87455c2710
6 changed files with 156 additions and 59 deletions

View File

@@ -82,7 +82,7 @@ export const MOCK_USERS: User[] = [
export const MOCK_ROOMS: Room[] = [
{ id: 'r1', hotelId: 'hotel-1', number: '101', floor: 1, type: 'Стандарт', bedType: 'double', maxGuests: 2, baseRate: 4500, status: 'occupied', housekeepingStatus: 'dirty', amenities: ['Wi-Fi', 'TV', 'AC'], sortOrder: 1 },
{ id: 'r2', hotelId: 'hotel-1', number: '102', floor: 1, type: 'Стандарт', bedType: 'twin', maxGuests: 2, baseRate: 4500, status: 'available', housekeepingStatus: 'clean', amenities: ['Wi-Fi', 'TV', 'AC'], sortOrder: 2 },
{ id: 'r3', hotelId: 'hotel-1', number: '103', floor: 1, type: 'Стандарт', bedType: 'single', maxGuests: 1, baseRate: 3200, status: 'available', housekeepingStatus: 'clean', amenities: ['Wi-Fi', 'TV'], sortOrder: 3 },
{ id: 'r3', hotelId: 'hotel-1', number: '103', floor: 1, type: 'Стандарт', bedType: 'single', maxGuests: 1, baseRate: 3200, status: 'available', housekeepingStatus: 'clean', amenities: ['Wi-Fi', 'TV'], sortOrder: 3, allowHourly: true, hourlyRate: 800 },
{ id: 'r4', hotelId: 'hotel-1', number: '201', floor: 2, type: 'Делюкс', bedType: 'king', maxGuests: 2, baseRate: 7800, status: 'occupied', housekeepingStatus: 'cleaning', amenities: ['Wi-Fi', 'TV', 'AC', 'Mini-bar', 'Bathrobe'], sortOrder: 4 },
{ id: 'r5', hotelId: 'hotel-1', number: '202', floor: 2, type: 'Делюкс', bedType: 'queen', maxGuests: 2, baseRate: 7200, status: 'available', housekeepingStatus: 'inspect', amenities: ['Wi-Fi', 'TV', 'AC', 'Mini-bar'], sortOrder: 5 },
{ id: 'r6', hotelId: 'hotel-1', number: '203', floor: 2, type: 'Делюкс', bedType: 'twin', maxGuests: 3, baseRate: 7500, status: 'maintenance', housekeepingStatus: 'clean', amenities: ['Wi-Fi', 'TV', 'AC', 'Mini-bar'], sortOrder: 6 },
@@ -120,6 +120,8 @@ export const MOCK_BOOKINGS: Booking[] = [
{ id: 'b12', hotelId: 'hotel-1', roomId: 'r8', guestId: 'g12', guestName: 'Людмила Захарова', guestEmail: 'zahar@corp.ru', checkIn: d(6), checkOut: d(11), status: 'confirmed', source: 'booking_com', totalAmount: 55000, paidAmount: 27500, adults: 2, children: 1, createdAt: TODAY },
{ id: 'b13', hotelId: 'hotel-1', roomId: 'r3', guestId: 'g13', guestName: 'Роман Степанов', guestEmail: 'stepanov@biz.ru', checkIn: d(6), checkOut: d(9), status: 'inquiry', source: 'direct', totalAmount: 9600, paidAmount: 0, adults: 1, children: 0, createdAt: TODAY },
{ id: 'b14', hotelId: 'hotel-1', roomId: 'r11', guestId: 'g14', guestName: 'Виктор Громов', guestEmail: 'gromov@vip.ru', checkIn: d(7), checkOut: d(14), status: 'confirmed', source: 'direct', totalAmount: 315000, paidAmount: 157500, adults: 4, children: 2, createdAt: p(3) },
// r3 — hourly booking (today)
{ id: 'b15', hotelId: 'hotel-1', roomId: 'r3', guestId: 'g15', guestName: 'Алексей Смирнов', guestEmail: 'smirnov@corp.ru', checkIn: TODAY, checkOut: TODAY, status: 'confirmed', source: 'direct', totalAmount: 2400, paidAmount: 2400, adults: 1, children: 0, notes: '[Почасово: 10:0013:00] Деловая встреча', createdAt: TODAY },
]
// ─── Channels ─────────────────────────────────────────────────────────────────