fix: make sure ancillaries also listen to invalidate requests

This commit is contained in:
Simon Emanuelsson
2025-05-14 17:45:05 +02:00
committed by Simon.Emanuelsson
parent 623495a176
commit 0b960200b9
12 changed files with 165 additions and 225 deletions

View File

@@ -1,6 +1,6 @@
import type { z } from "zod"
import type { BookingConfirmation } from "@/types/trpc/routers/booking/confirmation"
import type { Room } from "@/types/stores/my-stay"
import type { CreditCard, User } from "@/types/user"
import type {
ancillaryPackagesSchema,
@@ -12,33 +12,29 @@ export type Ancillary = Ancillaries[number]
export type SelectedAncillary = Ancillary["ancillaryContent"][number]
export type Packages = z.output<typeof packagesSchema>
export interface AncillariesProps extends Pick<BookingConfirmation, "booking"> {
export interface AncillariesProps {
ancillariesPromise: Promise<Ancillaries | null>
packages: Packages | null
user: User | null
savedCreditCards: CreditCard[] | null
user: User | null
}
export interface AddedAncillariesProps {
ancillaries: Ancillary["ancillaryContent"][number][] | null
booking: BookingConfirmation["booking"]
booking: Room
}
export interface AncillaryProps {
ancillary: Ancillary["ancillaryContent"][number]
}
export interface MyStayProps extends BookingConfirmation {
ancillaries: Ancillaries | null
}
export interface AncillaryGridModalProps {
ancillaries: Ancillaries
user: User | null
}
export interface AddAncillaryFlowModalProps
extends Pick<BookingConfirmation, "booking"> {
export interface AddAncillaryFlowModalProps {
booking: Room
packages: Packages | null
user: User | null
savedCreditCards: CreditCard[] | null

View File

@@ -10,36 +10,9 @@ import type { Hotel, Room as HotelRoom, RoomCategories } from "@/types/hotel"
import type { BookingConfirmation } from "@/types/trpc/routers/booking/confirmation"
import type { CreditCard } from "@/types/user"
export type Room = Pick<
export type Room = Omit<
BookingConfirmation["booking"],
| "adults"
| "bookingCode"
| "canChangeDate"
| "cancellationNumber"
| "checkInDate"
| "checkOutDate"
| "cheques"
| "childrenAges"
| "confirmationNumber"
| "createDateTime"
| "currencyCode"
| "guaranteeInfo"
| "guest"
| "hotelId"
| "isCancelable"
| "linkedReservations"
| "multiRoom"
| "rateDefinition"
| "refId"
| "reservationStatus"
| "roomPoints"
| "roomTypeCode"
| "totalPoints"
| "totalPrice"
| "totalPriceExVat"
| "vatAmount"
| "vatPercentage"
| "vouchers"
"packages" | "roomPrice"
> & {
bedType: BedTypeSchema
breakfast: Omit<BreakfastPackage, "requestedPrice"> | undefined | false
@@ -48,6 +21,7 @@ export type Room = Pick<
childrenInRoom: Child[]
isCancelled: boolean
mainRoom: boolean
originalPackages: BookingConfirmation["booking"]["packages"]
packages: Packages | null
priceType: PriceTypeEnum
rate: string