14 lines
388 B
TypeScript
14 lines
388 B
TypeScript
import type { Product } from "@scandic-hotels/trpc/types/roomAvailability"
|
|
|
|
export function getMemberPrice(roomRate: Product) {
|
|
if ("member" in roomRate && roomRate.member) {
|
|
return {
|
|
amount: roomRate.member.localPrice.pricePerStay,
|
|
currency: roomRate.member.localPrice.currency,
|
|
pricePerNight: roomRate.member.localPrice.pricePerNight,
|
|
}
|
|
}
|
|
|
|
return null
|
|
}
|