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:
167
src/types/index.ts
Normal file
167
src/types/index.ts
Normal file
@@ -0,0 +1,167 @@
|
||||
// ─── Auth ────────────────────────────────────────────────────────────────────
|
||||
|
||||
export type Role = 'super_admin' | 'hotel_manager' | 'housekeeper'
|
||||
|
||||
export interface User {
|
||||
id: string
|
||||
email: string
|
||||
name: string
|
||||
role: Role
|
||||
hotelId: string | null
|
||||
avatarUrl?: string
|
||||
}
|
||||
|
||||
export interface AuthSession {
|
||||
user: User
|
||||
token: string
|
||||
}
|
||||
|
||||
// ─── Hotel ───────────────────────────────────────────────────────────────────
|
||||
|
||||
export type HotelPlan = 'starter' | 'pro' | 'enterprise'
|
||||
|
||||
export interface Hotel {
|
||||
id: string
|
||||
name: string
|
||||
slug: string
|
||||
address: string
|
||||
timezone: string
|
||||
currency: string
|
||||
logoUrl?: string
|
||||
plan: HotelPlan
|
||||
isActive: boolean
|
||||
roomCount: number
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
// ─── Room ────────────────────────────────────────────────────────────────────
|
||||
|
||||
export type RoomStatus = 'available' | 'occupied' | 'maintenance' | 'blocked'
|
||||
export type HousekeepingStatus = 'clean' | 'dirty' | 'cleaning' | 'inspect'
|
||||
export type BedType = 'single' | 'double' | 'queen' | 'king' | 'twin'
|
||||
|
||||
export interface Room {
|
||||
id: string
|
||||
hotelId: string
|
||||
number: string
|
||||
name?: string
|
||||
floor: number
|
||||
type: string
|
||||
bedType: BedType
|
||||
maxGuests: number
|
||||
baseRate: number
|
||||
status: RoomStatus
|
||||
housekeepingStatus: HousekeepingStatus
|
||||
amenities: string[]
|
||||
sortOrder: number
|
||||
}
|
||||
|
||||
// ─── Guest ───────────────────────────────────────────────────────────────────
|
||||
|
||||
export interface Guest {
|
||||
id: string
|
||||
hotelId: string
|
||||
firstName: string
|
||||
lastName: string
|
||||
email: string
|
||||
phone?: string
|
||||
nationality?: string
|
||||
}
|
||||
|
||||
// ─── Booking ─────────────────────────────────────────────────────────────────
|
||||
|
||||
export type BookingStatus =
|
||||
| 'inquiry'
|
||||
| 'confirmed'
|
||||
| 'checked_in'
|
||||
| 'checked_out'
|
||||
| 'cancelled'
|
||||
| 'no_show'
|
||||
|
||||
export type BookingSource =
|
||||
| 'direct'
|
||||
| 'booking_com'
|
||||
| 'airbnb'
|
||||
| 'expedia'
|
||||
| 'other'
|
||||
|
||||
export interface Booking {
|
||||
id: string
|
||||
hotelId: string
|
||||
roomId: string
|
||||
guestId: string
|
||||
guestName: string
|
||||
guestEmail: string
|
||||
checkIn: string // ISO date YYYY-MM-DD
|
||||
checkOut: string // ISO date YYYY-MM-DD
|
||||
status: BookingStatus
|
||||
source: BookingSource
|
||||
channelBookingId?: string
|
||||
totalAmount: number
|
||||
paidAmount: number
|
||||
adults: number
|
||||
children: number
|
||||
notes?: string
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface DraftBooking {
|
||||
roomId: string
|
||||
checkIn: string
|
||||
checkOut: string
|
||||
}
|
||||
|
||||
// ─── Channel ─────────────────────────────────────────────────────────────────
|
||||
|
||||
export type ChannelName = 'booking_com' | 'airbnb' | 'expedia' | 'vrbo'
|
||||
export type SyncStatus = 'idle' | 'syncing' | 'success' | 'error'
|
||||
|
||||
export interface ChannelMapping {
|
||||
localRoomId: string
|
||||
channelRoomId: string
|
||||
channelRoomName: string
|
||||
}
|
||||
|
||||
export interface Channel {
|
||||
id: string
|
||||
hotelId: string
|
||||
name: ChannelName
|
||||
displayName: string
|
||||
isEnabled: boolean
|
||||
lastSyncAt: string | null
|
||||
lastSyncStatus: SyncStatus
|
||||
lastSyncError?: string
|
||||
bookingsImported: number
|
||||
mappings: ChannelMapping[]
|
||||
}
|
||||
|
||||
// ─── Housekeeping ─────────────────────────────────────────────────────────────
|
||||
|
||||
export interface HousekeepingTask {
|
||||
id: string
|
||||
hotelId: string
|
||||
roomId: string
|
||||
roomNumber: string
|
||||
assignedToId?: string
|
||||
assignedToName?: string
|
||||
priority: 'low' | 'normal' | 'high'
|
||||
status: 'pending' | 'in_progress' | 'done'
|
||||
notes?: string
|
||||
dueDate: string
|
||||
completedAt?: string
|
||||
type: 'cleaning' | 'inspection' | 'maintenance'
|
||||
}
|
||||
|
||||
// ─── API Docs ─────────────────────────────────────────────────────────────────
|
||||
|
||||
export interface ApiEndpoint {
|
||||
method: 'GET' | 'POST' | 'PATCH' | 'DELETE' | 'PUT'
|
||||
path: string
|
||||
summary: string
|
||||
description?: string
|
||||
tags: string[]
|
||||
auth: boolean
|
||||
roles?: Role[]
|
||||
requestBody?: string
|
||||
response?: string
|
||||
}
|
||||
Reference in New Issue
Block a user