fix: Role type — add hotel_admin/manager/all roles, fix hotel_manager typo

This commit is contained in:
2026-03-26 00:46:03 +03:00
parent d5267335a0
commit a59f9189ed
4 changed files with 16 additions and 11 deletions

View File

@@ -61,7 +61,7 @@ export const MOCK_USERS: User[] = [
id: 'user-manager-1', id: 'user-manager-1',
email: 'manager@grand-palace.ru', email: 'manager@grand-palace.ru',
name: 'Елена Смирнова', name: 'Елена Смирнова',
role: 'hotel_manager', role: 'hotel_admin',
hotelId: 'hotel-1', hotelId: 'hotel-1',
hotelName: 'Grand Palace Hotel', hotelName: 'Grand Palace Hotel',
hotelSlug: 'grand-palace', hotelSlug: 'grand-palace',

View File

@@ -101,8 +101,13 @@ export const ROOM_STATUS_COLORS: Record<RoomStatus, string> = {
export const ROLE_LABELS: Record<Role, string> = { export const ROLE_LABELS: Record<Role, string> = {
super_admin: 'Супер-администратор', super_admin: 'Супер-администратор',
hotel_manager: 'Менеджер отеля', hotel_admin: 'Системный администратор',
manager: 'Менеджер',
housekeeper: 'Горничная', housekeeper: 'Горничная',
receptionist: 'Ресепшн',
accountant: 'Бухгалтер',
security: 'Охрана',
technician: 'Тех. специалист',
} }
// ─── Plan ───────────────────────────────────────────────────────────────────── // ─── Plan ─────────────────────────────────────────────────────────────────────

View File

@@ -21,14 +21,14 @@ const API_ENDPOINTS: ApiEndpoint[] = [
{ method: 'GET', path: '/hotels', summary: 'Список отелей', tags: ['Hotels'], auth: true, roles: ['super_admin'], response: '{ "data": Hotel[], "total": number }' }, { method: 'GET', path: '/hotels', summary: 'Список отелей', tags: ['Hotels'], auth: true, roles: ['super_admin'], response: '{ "data": Hotel[], "total": number }' },
{ method: 'POST', path: '/hotels', summary: 'Создать отель', tags: ['Hotels'], auth: true, roles: ['super_admin'] }, { method: 'POST', path: '/hotels', summary: 'Создать отель', tags: ['Hotels'], auth: true, roles: ['super_admin'] },
{ method: 'GET', path: '/hotels/:hotelId', summary: 'Получить отель', tags: ['Hotels'], auth: true }, { method: 'GET', path: '/hotels/:hotelId', summary: 'Получить отель', tags: ['Hotels'], auth: true },
{ method: 'PATCH', path: '/hotels/:hotelId', summary: 'Обновить отель', tags: ['Hotels'], auth: true, roles: ['super_admin', 'hotel_manager'] }, { method: 'PATCH', path: '/hotels/:hotelId', summary: 'Обновить отель', tags: ['Hotels'], auth: true, roles: ['super_admin', 'hotel_admin'] },
{ method: 'DELETE', path: '/hotels/:hotelId', summary: 'Удалить отель', tags: ['Hotels'], auth: true, roles: ['super_admin'] }, { method: 'DELETE', path: '/hotels/:hotelId', summary: 'Удалить отель', tags: ['Hotels'], auth: true, roles: ['super_admin'] },
// Rooms // Rooms
{ method: 'GET', path: '/hotels/:hotelId/rooms', summary: 'Список номеров', tags: ['Rooms'], auth: true }, { method: 'GET', path: '/hotels/:hotelId/rooms', summary: 'Список номеров', tags: ['Rooms'], auth: true },
{ method: 'POST', path: '/hotels/:hotelId/rooms', summary: 'Создать номер', tags: ['Rooms'], auth: true, roles: ['hotel_manager'] }, { method: 'POST', path: '/hotels/:hotelId/rooms', summary: 'Создать номер', tags: ['Rooms'], auth: true, roles: ['hotel_admin'] },
{ method: 'PATCH', path: '/hotels/:hotelId/rooms/:roomId', summary: 'Обновить номер', tags: ['Rooms'], auth: true, roles: ['hotel_manager'] }, { method: 'PATCH', path: '/hotels/:hotelId/rooms/:roomId', summary: 'Обновить номер', tags: ['Rooms'], auth: true, roles: ['hotel_admin'] },
{ method: 'DELETE', path: '/hotels/:hotelId/rooms/:roomId', summary: 'Удалить номер', tags: ['Rooms'], auth: true, roles: ['hotel_manager'] }, { method: 'DELETE', path: '/hotels/:hotelId/rooms/:roomId', summary: 'Удалить номер', tags: ['Rooms'], auth: true, roles: ['hotel_admin'] },
// Bookings // Bookings
{ method: 'GET', path: '/hotels/:hotelId/bookings', summary: 'Список бронирований (с фильтрацией по датам)', tags: ['Bookings'], auth: true, response: '{ "data": Booking[], "total": number }' }, { method: 'GET', path: '/hotels/:hotelId/bookings', summary: 'Список бронирований (с фильтрацией по датам)', tags: ['Bookings'], auth: true, response: '{ "data": Booking[], "total": number }' },
@@ -39,8 +39,8 @@ const API_ENDPOINTS: ApiEndpoint[] = [
// Channels // Channels
{ method: 'GET', path: '/hotels/:hotelId/channels', summary: 'Список каналов', tags: ['Channels'], auth: true }, { method: 'GET', path: '/hotels/:hotelId/channels', summary: 'Список каналов', tags: ['Channels'], auth: true },
{ method: 'PATCH', path: '/hotels/:hotelId/channels/:channelId', summary: 'Настроить канал', tags: ['Channels'], auth: true, roles: ['hotel_manager'] }, { method: 'PATCH', path: '/hotels/:hotelId/channels/:channelId', summary: 'Настроить канал', tags: ['Channels'], auth: true, roles: ['hotel_admin'] },
{ method: 'POST', path: '/hotels/:hotelId/channels/:channelId/sync', summary: 'Запустить синхронизацию', tags: ['Channels'], auth: true, roles: ['hotel_manager'] }, { method: 'POST', path: '/hotels/:hotelId/channels/:channelId/sync', summary: 'Запустить синхронизацию', tags: ['Channels'], auth: true, roles: ['hotel_admin'] },
// Housekeeping // Housekeeping
{ method: 'GET', path: '/hotels/:hotelId/housekeeping/tasks', summary: 'Список задач', tags: ['Housekeeping'], auth: true }, { method: 'GET', path: '/hotels/:hotelId/housekeeping/tasks', summary: 'Список задач', tags: ['Housekeeping'], auth: true },

View File

@@ -1,6 +1,6 @@
// ─── Auth ──────────────────────────────────────────────────────────────────── // ─── Auth ────────────────────────────────────────────────────────────────────
export type Role = 'super_admin' | 'hotel_manager' | 'housekeeper' export type Role = 'super_admin' | 'hotel_admin' | 'manager' | 'housekeeper' | 'receptionist' | 'accountant' | 'security' | 'technician'
export interface User { export interface User {
id: string id: string