import type { z } from "zod"

import type { PackageEnum } from "@/types/requests/packages"
import type { Product } from "@/types/trpc/routers/hotel/roomAvailability"
import type { SafeUser } from "@/types/user"
import type { getMultiroomDetailsSchema } from "@/components/HotelReservation/EnterDetails/Details/Multiroom/schema"
import type {
  guestDetailsSchema,
  signedInDetailsSchema,
} from "@/components/HotelReservation/EnterDetails/Details/RoomOne/schema"
import type { productTypePointsSchema } from "@/server/routers/hotels/schemas/productTypePrice"
import type { BookingSearchType } from "../booking"
import type { Price } from "../price"
import type { Child } from "../selectRate/selectRate"

export type DetailsSchema = z.output<typeof guestDetailsSchema>
export type MultiroomDetailsSchema = z.output<
  ReturnType<typeof getMultiroomDetailsSchema>
>
export type SignedInDetailsSchema = z.output<typeof signedInDetailsSchema>
export type ProductTypePointsSchema = z.output<typeof productTypePointsSchema>

export interface RoomPrice {
  perNight: Price
  perStay: Price
}

export interface DetailsProps {
  user: SafeUser
}

export type JoinScandicFriendsCardProps = {
  name?: string
}

export type RoomRate = Product

export type DetailsBooking = {
  hotelId: string
  fromDate: string
  toDate: string
  city?: string
  bookingCode?: string
  searchType?: BookingSearchType
  rooms: {
    adults: number
    rateCode: string
    roomTypeCode: string
    bookingCode?: string
    childrenInRoom?: Child[]
    counterRateCode?: string
    packages?: PackageEnum[]
  }[]
}
