Merged in feat/SW-1308-booking-codes-track-b (pull request #1607)
Feat/SW-1308 booking codes track b * feat: SW-1308 Booking codes track b * feat: SW-1308 Booking codes Track B implementation * feat: SW-1308 Optimized after rebase Approved-by: Arvid Norlin
This commit is contained in:
@@ -29,7 +29,9 @@ export type JoinScandicFriendsCardProps = {
|
||||
}
|
||||
|
||||
export type RoomRate = {
|
||||
memberRate?: Product["member"]
|
||||
publicRate?: Product["public"]
|
||||
memberRate?: NonNullable<Product["member"]>
|
||||
publicRate?: NonNullable<Product["public"]>
|
||||
voucherRate?: NonNullable<Product["voucher"]>
|
||||
chequeRate?: NonNullable<Product["bonusCheque"]>
|
||||
redemptionRate?: ProductTypePointsSchema
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import type { ProductTypePrices } from "@/types/trpc/routers/hotel/availability"
|
||||
import type {
|
||||
ProductTypeCheque,
|
||||
ProductTypePrices,
|
||||
ProductTypeVoucher,
|
||||
} from "@/types/trpc/routers/hotel/availability"
|
||||
|
||||
export type PriceCardProps = {
|
||||
productTypePrices: ProductTypePrices
|
||||
@@ -10,3 +14,11 @@ export type PointsRowProps = {
|
||||
additionalPricePerStay?: number
|
||||
additionalPriceCurrency?: string
|
||||
}
|
||||
|
||||
export type VoucherCardProps = {
|
||||
productTypeVoucher: ProductTypeVoucher
|
||||
}
|
||||
|
||||
export type BonusChequeCardProps = {
|
||||
productTypeVoucher: ProductTypeCheque
|
||||
}
|
||||
|
||||
@@ -25,6 +25,12 @@ export type FlexibilityOptionProps = {
|
||||
rateName?: string // Obtained in case of booking code and redemption rates
|
||||
}
|
||||
|
||||
export interface FlexibilityOptionVoucherProps
|
||||
extends Omit<FlexibilityOptionProps, "| product"> {
|
||||
product: Product
|
||||
}
|
||||
export type FlexibilityOptionChequeProps = FlexibilityOptionVoucherProps
|
||||
|
||||
export interface PriceListProps {
|
||||
publicPrice?: ProductPrice | Record<string, never>
|
||||
memberPrice?: ProductPrice | Record<string, never>
|
||||
|
||||
@@ -44,14 +44,32 @@ export type Rate = {
|
||||
roomTypeCode: RoomConfiguration["roomTypeCode"]
|
||||
} & (
|
||||
| {
|
||||
bonusCheque?: never
|
||||
member?: NonNullable<Product["member"]>
|
||||
public?: NonNullable<Product["public"]>
|
||||
redemption?: never
|
||||
voucher?: never
|
||||
}
|
||||
| {
|
||||
bonusCheque?: never
|
||||
member?: never
|
||||
public?: never
|
||||
redemption: NonNullable<ProductTypePointsSchema>
|
||||
redemption?: never
|
||||
voucher?: NonNullable<Product["voucher"]>
|
||||
}
|
||||
| {
|
||||
bonusCheque?: NonNullable<Product["bonusCheque"]>
|
||||
member?: never
|
||||
public?: never
|
||||
redemption?: never
|
||||
voucher?: never
|
||||
}
|
||||
| {
|
||||
bonusCheque?: never
|
||||
member?: never
|
||||
public?: never
|
||||
redemption?: NonNullable<ProductTypePointsSchema>
|
||||
voucher?: never
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ export interface RoomContextValue extends SelectedRoom {
|
||||
rate: SelectedRate,
|
||||
selectedRateCode?: string
|
||||
) => void
|
||||
selectRateCheque: (rate: SelectedRate) => void
|
||||
selectRateVoucher: (rate: SelectedRate) => void
|
||||
}
|
||||
isActiveRoom: boolean
|
||||
isMainRoom: boolean
|
||||
|
||||
@@ -5,5 +5,7 @@ export enum CurrencyEnum {
|
||||
PLN = "PLN",
|
||||
SEK = "SEK",
|
||||
POINTS = "POINTS",
|
||||
Voucher = "Voucher",
|
||||
CC = "CC",
|
||||
Unknown = "Unknown",
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ export enum RateTypeEnum {
|
||||
BonusCheque = "BonusCheque",
|
||||
Company = "Company",
|
||||
Promotion = "Promotion",
|
||||
PublicPromotion = "PublicPromotion",
|
||||
Redemption = "Redemption",
|
||||
Regular = "Regular",
|
||||
TravelAgent = "TravelAgent",
|
||||
|
||||
@@ -30,6 +30,8 @@ interface Actions {
|
||||
selectRateRedemption: (
|
||||
idx: number
|
||||
) => (rate: SelectedRate, selectedRateCode?: string) => void
|
||||
selectRateVoucher: (idx: number) => (rate: SelectedRate) => void
|
||||
selectRateCheque: (idx: number) => (rate: SelectedRate) => void
|
||||
}
|
||||
|
||||
export interface SelectedRate {
|
||||
|
||||
@@ -10,8 +10,10 @@ import type { z } from "zod"
|
||||
import type { hotelsAvailabilitySchema } from "@/server/routers/hotels/output"
|
||||
import type { productTypeSchema } from "@/server/routers/hotels/schemas/availability/productType"
|
||||
import type {
|
||||
productTypeChequeSchema,
|
||||
productTypePointsSchema,
|
||||
productTypePriceSchema,
|
||||
productTypeVoucherSchema,
|
||||
} from "@/server/routers/hotels/schemas/productTypePrice"
|
||||
|
||||
export type HotelsAvailability = z.output<typeof hotelsAvailabilitySchema>
|
||||
@@ -30,6 +32,8 @@ export type SelectedRoomAvailabilitySchema = z.output<
|
||||
export type ProductType = z.output<typeof productTypeSchema>
|
||||
export type ProductTypePrices = z.output<typeof productTypePriceSchema>
|
||||
export type ProductTypePoints = z.output<typeof productTypePointsSchema>
|
||||
export type ProductTypeVoucher = z.output<typeof productTypeVoucherSchema>
|
||||
export type ProductTypeCheque = z.output<typeof productTypeChequeSchema>
|
||||
|
||||
export type HotelsAvailabilityItem =
|
||||
HotelsAvailability["data"][number]["attributes"]
|
||||
|
||||
Reference in New Issue
Block a user