feat: persist rate overrides to DB when applying prices in AvailabilityPage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -395,6 +395,15 @@ export const api = {
|
||||
req<void>('DELETE', `/api/hotels/${slug}/tariffs/${id}`),
|
||||
},
|
||||
|
||||
// ── Rate Overrides (per-cell prices) ─────────────────────────────────────
|
||||
rateOverrides: {
|
||||
list: (slug: string) =>
|
||||
req<RateOverrideApi[]>('GET', `/api/hotels/${slug}/rate-overrides`),
|
||||
|
||||
bulkUpsert: (slug: string, overrides: RateOverridePayload[]) =>
|
||||
req<{ count: number }>('POST', `/api/hotels/${slug}/rate-overrides/bulk`, { overrides }),
|
||||
},
|
||||
|
||||
// ── Rate Periods ─────────────────────────────────────────────────────────
|
||||
ratePeriods: {
|
||||
list: (slug: string) =>
|
||||
@@ -733,6 +742,26 @@ export interface TariffPayload {
|
||||
is_active?: boolean
|
||||
}
|
||||
|
||||
export interface RateOverrideApi {
|
||||
category_id: string
|
||||
date: string
|
||||
price: number
|
||||
extra_person: number
|
||||
min_nights: number
|
||||
channel_prices: Record<string, number>
|
||||
closed: boolean
|
||||
}
|
||||
|
||||
export interface RateOverridePayload {
|
||||
category_id: string
|
||||
date: string
|
||||
price: number
|
||||
extra_person?: number
|
||||
min_nights?: number
|
||||
channel_prices?: Record<string, number>
|
||||
closed?: boolean
|
||||
}
|
||||
|
||||
export interface RatePeriodApi {
|
||||
id: string
|
||||
name: string
|
||||
|
||||
Reference in New Issue
Block a user