import { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectRate/roomFilter"
import type { Packages } from "@/types/requests/packages"
import type { BookingConfirmation } from "@/types/trpc/routers/booking/confirmation"

export function getSpecialRoomType(
  packages: BookingConfirmation["booking"]["packages"] | Packages | null
) {
  const packageCodes = packages
    ?.filter((pkg) => pkg.code)
    .map((pkg) => pkg.code)
  if (packageCodes?.includes(RoomPackageCodeEnum.ACCESSIBILITY_ROOM)) {
    return "accesibillity"
  } else if (packageCodes?.includes(RoomPackageCodeEnum.ALLERGY_ROOM)) {
    return "allergy friendly"
  } else if (packageCodes?.includes(RoomPackageCodeEnum.PET_ROOM)) {
    return "pet room"
  } else {
    return ""
  }
}
