<?php

namespace Planaday\Entities\Booking;

use ArrayAccess;
use Countable;
use Planaday\Api\ApiException\InvalidResponseException;
use Planaday\Entities\Booking\DTO\BookingForm;
use Planaday\Entities\Booking\DTO\BookingResponse;
use Planaday\Entities\Booking\DTO\ExtraField;
use Traversable;

interface BookingApi {
	/**
	 * @param BookingForm $bookingForm
	 *
	 * @return BookingResponse
	 * @throws InvalidResponseException
	 */
	public function doBooking(BookingForm $bookingForm):BookingResponse;

	/**
	 * @param string $bookingId
	 * @param string $transactionId
	 *
	 * @return bool if the payment data was received
	 */
	public function postPaymentDataBooking(string $bookingId, string $transactionId): bool;

	/**
	 * @param string $bookingId
	 * @param string $transactionId
	 */
	public function deleteBookingAfterNoPayment(string $bookingId, string $transactionId): void;

	/**
	 * @return ArrayAccess<ExtraField<mixed>>&Traversable<ExtraField<mixed>>&Countable
	 * @throws InvalidResponseException
	 */
	public function getExtraFieldsList(): ArrayAccess&Traversable&Countable;

}