Initial commit: HotelSync PMS v0.1.0
- React 18 + TypeScript + Vite + Tailwind CSS - Шахматка бронирований (drag-to-book) - Страницы: Calendar, Bookings, Rooms, Housekeeping, Channels, API Docs, Settings - Роли: super_admin, hotel_manager, housekeeper - Светлая/тёмная тема - Docker + Nginx конфигурация - Лендинг hotelsync.ru
This commit is contained in:
190
src/data/mockData.ts
Normal file
190
src/data/mockData.ts
Normal file
@@ -0,0 +1,190 @@
|
||||
import { addDays, format, subDays } from 'date-fns'
|
||||
import type { Hotel, Room, Booking, Channel, HousekeepingTask, User } from '../types'
|
||||
|
||||
|
||||
const TODAY = format(new Date(), 'yyyy-MM-dd')
|
||||
const d = (offset: number) => format(addDays(new Date(), offset), 'yyyy-MM-dd')
|
||||
const p = (offset: number) => format(subDays(new Date(), offset), 'yyyy-MM-dd')
|
||||
|
||||
// ─── Hotels ──────────────────────────────────────────────────────────────────
|
||||
|
||||
export const MOCK_HOTELS: Hotel[] = [
|
||||
{
|
||||
id: 'hotel-1',
|
||||
name: 'Grand Palace Hotel',
|
||||
slug: 'grand-palace',
|
||||
address: 'ул. Тверская 1, Москва',
|
||||
timezone: 'Europe/Moscow',
|
||||
currency: 'RUB',
|
||||
plan: 'pro',
|
||||
isActive: true,
|
||||
roomCount: 12,
|
||||
createdAt: '2024-01-15',
|
||||
},
|
||||
{
|
||||
id: 'hotel-2',
|
||||
name: 'Sea Breeze Resort',
|
||||
slug: 'sea-breeze',
|
||||
address: 'ул. Набережная 12, Сочи',
|
||||
timezone: 'Europe/Moscow',
|
||||
currency: 'RUB',
|
||||
plan: 'enterprise',
|
||||
isActive: true,
|
||||
roomCount: 48,
|
||||
createdAt: '2024-03-22',
|
||||
},
|
||||
{
|
||||
id: 'hotel-3',
|
||||
name: 'City Inn Express',
|
||||
slug: 'city-inn',
|
||||
address: 'пр. Невский 88, Санкт-Петербург',
|
||||
timezone: 'Europe/Moscow',
|
||||
currency: 'RUB',
|
||||
plan: 'starter',
|
||||
isActive: false,
|
||||
roomCount: 20,
|
||||
createdAt: '2024-06-01',
|
||||
},
|
||||
]
|
||||
|
||||
// ─── Users ───────────────────────────────────────────────────────────────────
|
||||
|
||||
export const MOCK_USERS: User[] = [
|
||||
{
|
||||
id: 'user-admin',
|
||||
email: 'admin@hotelsync.io',
|
||||
name: 'Александр Петров',
|
||||
role: 'super_admin',
|
||||
hotelId: null,
|
||||
},
|
||||
{
|
||||
id: 'user-manager-1',
|
||||
email: 'manager@grand-palace.ru',
|
||||
name: 'Елена Смирнова',
|
||||
role: 'hotel_manager',
|
||||
hotelId: 'hotel-1',
|
||||
},
|
||||
{
|
||||
id: 'user-housekeeper-1',
|
||||
email: 'cleaner@grand-palace.ru',
|
||||
name: 'Мария Иванова',
|
||||
role: 'housekeeper',
|
||||
hotelId: 'hotel-1',
|
||||
},
|
||||
]
|
||||
|
||||
// ─── Rooms ───────────────────────────────────────────────────────────────────
|
||||
|
||||
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: '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 },
|
||||
{ id: 'r7', hotelId: 'hotel-1', number: '301', floor: 3, type: 'Полулюкс', bedType: 'king', maxGuests: 2, baseRate: 11000, status: 'occupied', housekeepingStatus: 'dirty', amenities: ['Wi-Fi', 'TV', 'AC', 'Mini-bar', 'Bathrobe', 'Jacuzzi'], sortOrder: 7 },
|
||||
{ id: 'r8', hotelId: 'hotel-1', number: '302', floor: 3, type: 'Полулюкс', bedType: 'king', maxGuests: 2, baseRate: 11000, status: 'available', housekeepingStatus: 'clean', amenities: ['Wi-Fi', 'TV', 'AC', 'Mini-bar', 'Bathrobe', 'Jacuzzi'], sortOrder: 8 },
|
||||
{ id: 'r9', hotelId: 'hotel-1', number: '401', floor: 4, type: 'Люкс', bedType: 'king', maxGuests: 3, baseRate: 18500, status: 'available', housekeepingStatus: 'clean', amenities: ['Wi-Fi', 'TV', 'AC', 'Mini-bar', 'Bathrobe', 'Jacuzzi', 'Panoramic view'], sortOrder: 9 },
|
||||
{ id: 'r10', hotelId: 'hotel-1', number: '402', floor: 4, type: 'Люкс', bedType: 'king', maxGuests: 4, baseRate: 22000, status: 'blocked', housekeepingStatus: 'clean', amenities: ['Wi-Fi', 'TV', 'AC', 'Mini-bar', 'Bathrobe', 'Jacuzzi', 'Panoramic view', 'Butler'], sortOrder: 10 },
|
||||
{ id: 'r11', hotelId: 'hotel-1', number: '501', name: 'Пентхаус', floor: 5, type: 'Пентхаус', bedType: 'king', maxGuests: 6, baseRate: 45000, status: 'available', housekeepingStatus: 'clean', amenities: ['Wi-Fi', 'TV', 'AC', 'Mini-bar', 'Bathrobe', 'Jacuzzi', 'Terrace', 'Butler', 'Panoramic view'], sortOrder: 11 },
|
||||
{ id: 'r12', hotelId: 'hotel-1', number: '102A', floor: 1, type: 'Апартаменты', bedType: 'double', maxGuests: 4, baseRate: 9500, status: 'occupied', housekeepingStatus: 'dirty', amenities: ['Wi-Fi', 'TV', 'AC', 'Kitchen', 'Washing machine'], sortOrder: 12 },
|
||||
]
|
||||
|
||||
// ─── Bookings ─────────────────────────────────────────────────────────────────
|
||||
|
||||
export const MOCK_BOOKINGS: Booking[] = [
|
||||
// r1 — ongoing
|
||||
{ id: 'b1', hotelId: 'hotel-1', roomId: 'r1', guestId: 'g1', guestName: 'Дмитрий Волков', guestEmail: 'volkov@mail.ru', checkIn: p(2), checkOut: d(3), status: 'checked_in', source: 'direct', totalAmount: 22500, paidAmount: 22500, adults: 2, children: 0, createdAt: p(10) },
|
||||
// r2
|
||||
{ id: 'b2', hotelId: 'hotel-1', roomId: 'r2', guestId: 'g2', guestName: 'Анна Козлова', guestEmail: 'kozlova@gmail.com', checkIn: d(2), checkOut: d(5), status: 'confirmed', source: 'booking_com', totalAmount: 13500, paidAmount: 0, adults: 2, children: 1, createdAt: p(5) },
|
||||
{ id: 'b3', hotelId: 'hotel-1', roomId: 'r2', guestId: 'g3', guestName: 'Сергей Новиков', guestEmail: 'novikov@yandex.ru', checkIn: d(8), checkOut: d(12), status: 'confirmed', source: 'airbnb', totalAmount: 18000, paidAmount: 9000, adults: 2, children: 0, createdAt: p(3) },
|
||||
// r3
|
||||
{ id: 'b4', hotelId: 'hotel-1', roomId: 'r3', guestId: 'g4', guestName: 'Ольга Морозова', guestEmail: 'morozova@mail.ru', checkIn: d(1), checkOut: d(4), status: 'confirmed', source: 'direct', totalAmount: 9600, paidAmount: 9600, adults: 1, children: 0, createdAt: p(7) },
|
||||
// r4 — ongoing
|
||||
{ id: 'b5', hotelId: 'hotel-1', roomId: 'r4', guestId: 'g5', guestName: 'Игорь Соколов', guestEmail: 'sokolov@corp.ru', checkIn: p(1), checkOut: d(2), status: 'checked_in', source: 'direct', totalAmount: 23400, paidAmount: 23400, adults: 2, children: 0, createdAt: p(14) },
|
||||
{ id: 'b6', hotelId: 'hotel-1', roomId: 'r4', guestId: 'g6', guestName: 'Татьяна Белова', guestEmail: 'belova@gmail.com', checkIn: d(4), checkOut: d(9), status: 'confirmed', source: 'expedia', totalAmount: 39000, paidAmount: 0, adults: 2, children: 2, createdAt: p(2) },
|
||||
// r5
|
||||
{ id: 'b7', hotelId: 'hotel-1', roomId: 'r5', guestId: 'g7', guestName: 'Владимир Федоров', guestEmail: 'fedorov@biz.ru', checkIn: d(3), checkOut: d(7), status: 'confirmed', source: 'booking_com', totalAmount: 28800, paidAmount: 14400, adults: 2, children: 0, createdAt: p(6) },
|
||||
// r7 — ongoing
|
||||
{ id: 'b8', hotelId: 'hotel-1', roomId: 'r7', guestId: 'g8', guestName: 'Наталья Александрова', guestEmail: 'alex@premium.ru', checkIn: p(3), checkOut: d(4), status: 'checked_in', source: 'direct', totalAmount: 77000, paidAmount: 77000, adults: 2, children: 0, createdAt: p(20) },
|
||||
// r9
|
||||
{ id: 'b9', hotelId: 'hotel-1', roomId: 'r9', guestId: 'g9', guestName: 'Михаил Орлов', guestEmail: 'orlov@vip.ru', checkIn: d(5), checkOut: d(10), status: 'confirmed', source: 'direct', totalAmount: 92500, paidAmount: 46250, adults: 3, children: 0, createdAt: p(1) },
|
||||
// r12 — ongoing
|
||||
{ id: 'b10', hotelId: 'hotel-1', roomId: 'r12', guestId: 'g10', guestName: 'Екатерина Лебедева', guestEmail: 'lebed@family.ru', checkIn: p(1), checkOut: d(6), status: 'checked_in', source: 'airbnb', totalAmount: 66500, paidAmount: 66500, adults: 2, children: 2, createdAt: p(15) },
|
||||
// past bookings
|
||||
{ id: 'b11', hotelId: 'hotel-1', roomId: 'r1', guestId: 'g11', guestName: 'Павел Тихонов', guestEmail: 'tihonov@mail.ru', checkIn: p(10), checkOut: p(7), status: 'checked_out', source: 'direct', totalAmount: 13500, paidAmount: 13500, adults: 1, children: 0, createdAt: p(20) },
|
||||
{ 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) },
|
||||
]
|
||||
|
||||
// ─── Channels ─────────────────────────────────────────────────────────────────
|
||||
|
||||
export const MOCK_CHANNELS: Channel[] = [
|
||||
{
|
||||
id: 'ch1',
|
||||
hotelId: 'hotel-1',
|
||||
name: 'booking_com',
|
||||
displayName: 'Booking.com',
|
||||
isEnabled: true,
|
||||
lastSyncAt: format(subDays(new Date(), 0), "yyyy-MM-dd'T'HH:mm:ss"),
|
||||
lastSyncStatus: 'success',
|
||||
bookingsImported: 47,
|
||||
mappings: [
|
||||
{ localRoomId: 'r1', channelRoomId: 'bcom-101', channelRoomName: 'Standard Double Room' },
|
||||
{ localRoomId: 'r4', channelRoomId: 'bcom-201', channelRoomName: 'Deluxe King Room' },
|
||||
{ localRoomId: 'r7', channelRoomId: 'bcom-301', channelRoomName: 'Junior Suite' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'ch2',
|
||||
hotelId: 'hotel-1',
|
||||
name: 'airbnb',
|
||||
displayName: 'Airbnb',
|
||||
isEnabled: true,
|
||||
lastSyncAt: format(subDays(new Date(), 1), "yyyy-MM-dd'T'HH:mm:ss"),
|
||||
lastSyncStatus: 'success',
|
||||
bookingsImported: 23,
|
||||
mappings: [
|
||||
{ localRoomId: 'r11', channelRoomId: 'airbnb-penthouse', channelRoomName: 'Penthouse with Terrace' },
|
||||
{ localRoomId: 'r12', channelRoomId: 'airbnb-apt', channelRoomName: 'Cozy Apartment' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'ch3',
|
||||
hotelId: 'hotel-1',
|
||||
name: 'expedia',
|
||||
displayName: 'Expedia',
|
||||
isEnabled: false,
|
||||
lastSyncAt: null,
|
||||
lastSyncStatus: 'idle',
|
||||
bookingsImported: 0,
|
||||
mappings: [],
|
||||
},
|
||||
{
|
||||
id: 'ch4',
|
||||
hotelId: 'hotel-1',
|
||||
name: 'vrbo',
|
||||
displayName: 'VRBO',
|
||||
isEnabled: false,
|
||||
lastSyncAt: null,
|
||||
lastSyncStatus: 'idle',
|
||||
bookingsImported: 0,
|
||||
mappings: [],
|
||||
},
|
||||
]
|
||||
|
||||
// ─── Housekeeping ──────────────────────────────────────────────────────────────
|
||||
|
||||
export const MOCK_HK_TASKS: HousekeepingTask[] = [
|
||||
{ id: 'hk1', hotelId: 'hotel-1', roomId: 'r1', roomNumber: '101', assignedToId: 'user-housekeeper-1', assignedToName: 'Мария Иванова', priority: 'high', status: 'in_progress', type: 'cleaning', dueDate: TODAY, notes: 'Выезд гостя в 12:00, срочная уборка' },
|
||||
{ id: 'hk2', hotelId: 'hotel-1', roomId: 'r4', roomNumber: '201', assignedToId: 'user-housekeeper-1', assignedToName: 'Мария Иванова', priority: 'high', status: 'pending', type: 'cleaning', dueDate: TODAY },
|
||||
{ id: 'hk3', hotelId: 'hotel-1', roomId: 'r7', roomNumber: '301', assignedToId: 'user-housekeeper-1', assignedToName: 'Мария Иванова', priority: 'normal', status: 'pending', type: 'cleaning', dueDate: TODAY },
|
||||
{ id: 'hk4', hotelId: 'hotel-1', roomId: 'r12', roomNumber: '102A', assignedToId: 'user-housekeeper-1', assignedToName: 'Мария Иванова', priority: 'normal', status: 'pending', type: 'cleaning', dueDate: TODAY },
|
||||
{ id: 'hk5', hotelId: 'hotel-1', roomId: 'r5', roomNumber: '202', priority: 'normal', status: 'pending', type: 'inspection', dueDate: TODAY, notes: 'Проверка после ремонта кондиционера' },
|
||||
{ id: 'hk6', hotelId: 'hotel-1', roomId: 'r6', roomNumber: '203', priority: 'high', status: 'pending', type: 'maintenance', dueDate: TODAY, notes: 'Замена сантехники, номер закрыт' },
|
||||
{ id: 'hk7', hotelId: 'hotel-1', roomId: 'r2', roomNumber: '102', priority: 'low', status: 'done', type: 'cleaning', dueDate: TODAY, completedAt: `${TODAY}T09:30:00` },
|
||||
{ id: 'hk8', hotelId: 'hotel-1', roomId: 'r3', roomNumber: '103', priority: 'low', status: 'done', type: 'cleaning', dueDate: TODAY, completedAt: `${TODAY}T10:15:00` },
|
||||
{ id: 'hk9', hotelId: 'hotel-1', roomId: 'r8', roomNumber: '302', priority: 'normal', status: 'done', type: 'cleaning', dueDate: TODAY, completedAt: `${TODAY}T08:45:00` },
|
||||
{ id: 'hk10', hotelId: 'hotel-1', roomId: 'r9', roomNumber: '401', priority: 'normal', status: 'done', type: 'inspection', dueDate: TODAY, completedAt: `${TODAY}T11:00:00`, notes: 'Готов к заселению' },
|
||||
]
|
||||
Reference in New Issue
Block a user