import { z } from "zod"

import {
  packagePriceSchema,
  RateDefinition,
  RoomConfiguration,
} from "@/server/routers/hotels/output"

import { RoomPriceSchema } from "./flexibilityOption"
import { Rate } from "./selectRate"

import type { RoomData } from "@/types/hotel"
import type { RoomPackageCodes, RoomPackageData } from "./roomFilter"

export type RoomCardProps = {
  hotelId: string
  roomConfiguration: RoomConfiguration
  rateDefinitions: RateDefinition[]
  roomCategories: RoomData[]
  selectedPackages: RoomPackageCodes[]
  packages: RoomPackageData | undefined
  handleSelectRate: (rate: Rate) => void
}

type RoomPackagePriceSchema = z.output<typeof packagePriceSchema>

export type CalculatePricesPerNightProps = {
  publicLocalPrice: RoomPriceSchema
  memberLocalPrice: RoomPriceSchema
  publicRequestedPrice?: RoomPriceSchema
  memberRequestedPrice?: RoomPriceSchema
  petRoomLocalPrice?: RoomPackagePriceSchema
  petRoomRequestedPrice?: RoomPackagePriceSchema
  nights: number
}
