import type { Code, StayInformation } from '@entities' import { endpointMaker } from '@services' import type { HttpClient } from '@services' import type { ApiError, Response } from '@types' type IncludesAvailable = 'codes' export type GetStayInformationIncluded = { codes: Code | Code[] } export type GetStayInformationInput = { houseId: string included?: { include?: IncludesAvailable[] fields?: Record } } const getStayInformation = (http: HttpClient) => ({ query: ( input: GetStayInformationInput, ): Promise< Response > => { const query = endpointMaker({ includes: input.included }) return http.get(`v3/admin/houses/${input.houseId}/stay_information${query}`) }, }) export default getStayInformation