import type { SupportedCurrencies } from '@entities' import type { HttpClient } from '@services' import type { Response } from '@types' import type { PrebookingErrors } from './createPrebooking' export type FavoriteContact = ('phone' | 'email' | 'whatsapp' | 'sms')[] export type TimeZone = | 'london' | 'los_angeles' | 'moscow' | 'new_york' | 'paris' export type UpdatePrebookingInput = { request: { currency: SupportedCurrencies favorite_contact?: FavoriteContact time_zone?: TimeZone } } export type UpdatePrebookingResponse = { id: string type: string userId: number createdAt: string clientComment: null | string favoriteContact: FavoriteContact endDate: string houseId: number numberOfAdults: number | null numberOfBabies: number | null numberOfChildren: number | null people: number startDate: string stripeClientSecret: string stripeCustomerId: string timeZone: TimeZone | null timeSlot: Array updatedAt: string uuid: string } const updatePrebooking = (http: HttpClient) => ({ query: ( prebookingId: string, input: UpdatePrebookingInput, ): Promise< Response > => { return http.put(`v1/requests/${prebookingId}`, input) }, }) export default updatePrebooking