Merged in feat/SW-454-select-room-api (pull request #648)
Feat/SW-454 Create select rate page foundation * Extract select-rate page to its own, fixed route * Rename availability to hotelsAvailability * Update availability hotels response * Number to string Approved-by: Pontus Dreij
This commit is contained in:
@@ -525,26 +525,18 @@ const occupancySchema = z.object({
|
||||
|
||||
const bestPricePerStaySchema = z.object({
|
||||
currency: z.string(),
|
||||
amount: z.number(),
|
||||
regularAmount: z.number(),
|
||||
memberAmount: z.number(),
|
||||
discountRate: z.number(),
|
||||
discountAmount: z.number(),
|
||||
points: z.number(),
|
||||
numberOfVouchers: z.number(),
|
||||
numberOfBonusCheques: z.number(),
|
||||
// TODO: remove optional when API is ready
|
||||
regularAmount: z.string().optional(),
|
||||
// TODO: remove optional when API is ready
|
||||
memberAmount: z.string().optional(),
|
||||
})
|
||||
|
||||
const bestPricePerNightSchema = z.object({
|
||||
currency: z.string(),
|
||||
amount: z.number(),
|
||||
regularAmount: z.number(),
|
||||
memberAmount: z.number(),
|
||||
discountRate: z.number(),
|
||||
discountAmount: z.number(),
|
||||
points: z.number(),
|
||||
numberOfVouchers: z.number(),
|
||||
numberOfBonusCheques: z.number(),
|
||||
// TODO: remove optional when API is ready
|
||||
regularAmount: z.string().optional(),
|
||||
// TODO: remove optional when API is ready
|
||||
memberAmount: z.string().optional(),
|
||||
})
|
||||
|
||||
const linksSchema = z.object({
|
||||
@@ -556,7 +548,7 @@ const linksSchema = z.object({
|
||||
),
|
||||
})
|
||||
|
||||
const availabilitySchema = z.object({
|
||||
const hotelsAvailabilitySchema = z.object({
|
||||
data: z.array(
|
||||
z.object({
|
||||
attributes: z.object({
|
||||
@@ -575,10 +567,10 @@ const availabilitySchema = z.object({
|
||||
),
|
||||
})
|
||||
|
||||
export const getAvailabilitySchema = availabilitySchema
|
||||
export type Availability = z.infer<typeof availabilitySchema>
|
||||
export type AvailabilityPrices =
|
||||
Availability["data"][number]["attributes"]["bestPricePerNight"]
|
||||
export const getHotelsAvailabilitySchema = hotelsAvailabilitySchema
|
||||
export type HotelsAvailability = z.infer<typeof hotelsAvailabilitySchema>
|
||||
export type HotelsAvailabilityPrices =
|
||||
HotelsAvailability["data"][number]["attributes"]["bestPricePerNight"]
|
||||
|
||||
const flexibilityPrice = z.object({
|
||||
standard: z.number(),
|
||||
|
||||
Reference in New Issue
Block a user