<?php

namespace Planaday\Api\V1;

use Planaday\Api\ApiConnector;
use Planaday\Api\LoggingApi;
use Planaday\Api\RegistrationApi;
use Planaday\Entities\Booking\BookingApi;
use Planaday\Entities\Course\CourseApi;
use Planaday\Entities\DayPart\DayPartApi;
use Planaday\Entities\Location\LocationApi;
use Planaday\Entities\Voucher\VoucherApi;
use Planaday\Utility\DependencyInjection\Container;

class V1Connector implements ApiConnector {
	function __construct(
		protected Container $registry
	) {}

	public function getApiName(): string {
		return "Planaday Api v1";
	}

	public function connect(): void {
		$this->registry->setImplementation(BookingApi::class, BookingApiV1Controller::class)
		               ->setImplementation(CourseApi::class, CourseApiV1Controller::class)
		               ->setImplementation(DayPartApi::class, DayPartApiV1Controller::class)
		               ->setImplementation(LocationApi::class, LocationApiV1Controller::class)
		               ->setImplementation(VoucherApi::class, VoucherApiV1::class)
		               ->setImplementation(LoggingApi::class, LoggingApiV1::class)
		               ->setImplementation(RegistrationApi::class, RegistrationApiV1::class);
	}
}