import type { SupportedCurrencies } from '@entities' import type { HttpClient } from '@services' import type { Response } from '@types' export type CreatePrebookingInput = { request: { start_date: string end_date: string phone: string house_id: number budget: number deposit_in_cents: number email: string first_name: string last_name: string } newsletter?: boolean currency: SupportedCurrencies } export type CreatePrebookingResponse = { id: string type: string userId: number createdAt: string clientComment: null | string favoriteContact: Array endDate: string houseId: number numberOfAdults: number | null numberOfBabies: number | null numberOfChildren: number | null people: number startDate: string stripeClientSecret: string stripeCustomerId: string timeZone: null timeSlot: Array updatedAt: string uuid: string } export type PrebookingErrors = { response: { data: { errors: [ { request: Record[]> }, ] } } } const createPrebooking = (http: HttpClient) => ({ query: ( input: CreatePrebookingInput, ): Promise< Response > => { return http.post('v1/requests', input) }, }) export default createPrebooking