feat: настройки оплаты — способы оплаты + контроль при заселении
- Миграция 064: таблица hotel_payment_methods, поле require_payment_checkin - Бэкенд: CRUD /api/hotels/:slug/payment-methods, /api/hotels/:slug/payment-settings - PaymentSettingsPage (/settings/payments): управление способами оплаты (название, валюта, тип, активность, сортировка), контроль при заселении (нет/мягкий/жёсткий) - BookingDetailPanel: динамические методы оплаты вместо захардкоженных - Кнопка «Заселить»: hard — заблокирована при балансе > 0; soft — предупреждение с выбором Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -828,6 +828,21 @@ export const api = {
|
||||
remove: (slug: string, bookingId: string, paymentId: string) =>
|
||||
req<void>('DELETE', `/api/hotels/${slug}/bookings/${bookingId}/payments/${paymentId}`),
|
||||
},
|
||||
|
||||
paymentMethods: {
|
||||
list: (slug: string) =>
|
||||
req<HotelPaymentMethod[]>('GET', `/api/hotels/${slug}/payment-methods`),
|
||||
create: (slug: string, data: { name: string; currency?: string; type?: string; sortOrder?: number }) =>
|
||||
req<HotelPaymentMethod>('POST', `/api/hotels/${slug}/payment-methods`, data),
|
||||
update: (slug: string, id: string, data: Partial<{ name: string; currency: string; type: string; sortOrder: number; isActive: boolean }>) =>
|
||||
req<HotelPaymentMethod>('PATCH', `/api/hotels/${slug}/payment-methods/${id}`, data),
|
||||
remove: (slug: string, id: string) =>
|
||||
req<void>('DELETE', `/api/hotels/${slug}/payment-methods/${id}`),
|
||||
getSettings: (slug: string) =>
|
||||
req<{ requirePaymentCheckin: 'none' | 'soft' | 'hard' }>('GET', `/api/hotels/${slug}/payment-settings`),
|
||||
updateSettings: (slug: string, requirePaymentCheckin: 'none' | 'soft' | 'hard') =>
|
||||
req<{ requirePaymentCheckin: string }>('PATCH', `/api/hotels/${slug}/payment-settings`, { require_payment_checkin: requirePaymentCheckin }),
|
||||
},
|
||||
}
|
||||
|
||||
// ── Schedule ─────────────────────────────────────────────────────────────────
|
||||
@@ -1466,6 +1481,16 @@ export interface MinibarInventoryCheck {
|
||||
items?: MinibarInventoryItem[]
|
||||
}
|
||||
|
||||
export interface HotelPaymentMethod {
|
||||
id: string
|
||||
hotelId: string
|
||||
name: string
|
||||
currency: string
|
||||
type: 'cash' | 'card' | 'transfer' | 'other'
|
||||
isActive: boolean
|
||||
sortOrder: number
|
||||
}
|
||||
|
||||
export interface MinibarReportRow {
|
||||
name: string
|
||||
category: string | null
|
||||
|
||||
Reference in New Issue
Block a user