chore: Cleanup booking-flow after migration * Remove unused types * Clean up exports, types, unused files etc in booking-flow Approved-by: Joakim Jäderberg
24 lines
596 B
TypeScript
24 lines
596 B
TypeScript
import { RateTypeEnum } from "@scandic-hotels/common/constants/rateType"
|
|
|
|
import type { Product } from "@scandic-hotels/trpc/types/roomAvailability"
|
|
|
|
export function isBookingCodeRate(product: Product | undefined | null) {
|
|
if (!product) return false
|
|
|
|
if (
|
|
"corporateCheque" in product ||
|
|
"redemption" in product ||
|
|
"voucher" in product
|
|
) {
|
|
return true
|
|
} else {
|
|
if (product.public) {
|
|
return product.public.rateType !== RateTypeEnum.Regular
|
|
}
|
|
if (product.member) {
|
|
return product.member.rateType !== RateTypeEnum.Regular
|
|
}
|
|
return false
|
|
}
|
|
}
|