Files
hotelsync/backend/src/types.ts
HotelSync c233590c4b Major UX improvements across multiple pages
Шахматка:
- Date/period picker dropdown on navigation button (choose start date + days window)
- Cancelled bookings fade out with animation after 1 second

Бронирования:
- Clickable column headers with sort asc/desc (Гость, Заезд, Выезд, Статус, Источник, Сумма)

Страница входа:
- Removed role-based account selector — just email + password
- System auto-detects role/hotel from credentials

Настройки:
- New "Бронирование" section with room assignment strategy (spread/together/sequential/manual)
- Notifications: SMTP email config + SMS provider config (SMSC, SMS.ru, МТС, etc.)

Модули:
- Added Housekeeping and Channel Manager as proper modules
- Channel Manager lists: Booking.com, Airbnb, Яндекс Путешествия, Островок, Суточно.ру, OneTwoTrip
- Housekeeping visible to all roles (including housekeeper) via module status
- Sidebar now uses module status to show/hide Уборка and Каналы

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 15:20:05 +03:00

72 lines
1.5 KiB
TypeScript

export interface JwtPayload {
sub: string // user.id (UUID)
email: string
name: string
role: 'manager' | 'housekeeper' | 'super_admin'
hotelId: string | null
hotelSlug: string | null
}
export interface Hotel {
id: string
name: string
slug: string
plan: 'starter' | 'pro' | 'enterprise'
timezone: string
currency: string
created_at: string
updated_at: string
}
export interface Room {
id: string
hotel_id: string
number: string
type: string
floor: number
capacity: number
price_per_night: number
status: 'clean' | 'dirty' | 'maintenance' | 'out_of_order'
amenities: string[]
notes: string | null
created_at: string
}
export interface Booking {
id: string
hotel_id: string
room_id: string
guest_name: string
guest_email: string | null
guest_phone: string | null
check_in: string
check_out: string
adults: number
children: number
status: 'confirmed' | 'checked_in' | 'checked_out' | 'cancelled' | 'no_show'
source: 'direct' | 'booking_com' | 'airbnb' | 'expedia' | 'vrbo'
total_amount: number | null
notes: string | null
external_id: string | null
created_at: string
updated_at: string
}
// Fastify JWT augmentation
declare module '@fastify/jwt' {
interface FastifyJWT {
payload: JwtPayload
user: JwtPayload
}
}
// Fastify instance augmentation
declare module 'fastify' {
interface FastifyInstance {
authenticate: (
request: import('fastify').FastifyRequest,
reply: import('fastify').FastifyReply,
) => Promise<void>
}
}