Connect ChannelsPage, FloorMapPage, SettingsPage, UsersPage to real API
- ChannelsPage: load from API, toggle/sync call real endpoints; normalize enabled→isEnabled, lastSyncedAt→lastSyncAt, add displayName/mappings defaults - FloorMapPage: load rooms+bookings from API; create booking via API - SettingsPage: load hotel via GET /api/hotels/:slug; save general section via PATCH (name, address, timezone, currency, check_in/out times) - UsersPage: load users from API; create/update/delete via API; map backend User (name/role) → StaffUser (firstName/lastName/StaffRole) - api.ts: add hotels.get/update, users.delete, channel normalization, HotelPayload/toHotelPayload - types/index.ts: extend Hotel with phone/checkInTime/checkOutTime/optional fields; add User.createdAt/updatedAt - backend/routes/hotels.ts: extend PATCH to allow address/phone/check_in_time/check_out_time - backend/migrations/004_hotels_contacts.sql: add address/phone/check_in/out_time to hotels Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,8 @@ export interface User {
|
||||
hotelName?: string
|
||||
hotelSlug?: string
|
||||
avatarUrl?: string
|
||||
createdAt?: string
|
||||
updatedAt?: string
|
||||
}
|
||||
|
||||
export interface AuthSession {
|
||||
@@ -26,13 +28,17 @@ export interface Hotel {
|
||||
id: string
|
||||
name: string
|
||||
slug: string
|
||||
address: string
|
||||
address?: string
|
||||
phone?: string
|
||||
timezone: string
|
||||
currency: string
|
||||
checkInTime?: string
|
||||
checkOutTime?: string
|
||||
logoUrl?: string
|
||||
plan: HotelPlan
|
||||
isActive: boolean
|
||||
roomCount: number
|
||||
isActive?: boolean
|
||||
roomCount?: number
|
||||
activeBookings?: number
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user