<?php

namespace Planaday\Entities\Voucher;

use Planaday\Api\ApiException\InvalidResponseException;
use Planaday\Entities\Voucher\DTO\Voucher;
use Planaday\Entities\Voucher\Exception\BookingNotFoundException;
use Planaday\Entities\Voucher\Exception\VoucherInvalidException;
use Planaday\Entities\Voucher\Exception\VoucherNotFoundException;

interface VoucherApi {
	/**
	 * @throws InvalidResponseException
	 * @throws VoucherNotFoundException
	 * @throws VoucherInvalidException
	 */
	public function getVoucher(string $code): Voucher;

	/**
	 * @throws InvalidResponseException
	 * @throws VoucherNotFoundException
	 * @throws BookingNotFoundException
	 */
	public function useVoucher(Voucher $voucher, string $bookingId): void;
}