<?php

namespace Planaday\Api\Mock;

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\Debug\Log\Logging;
use Planaday\Utility\DependencyInjection\Container;

class MockConnector implements ApiConnector {
	use Logging;

	public function __construct(
		protected Container $registry
	) {}

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

	public function connect(): void {
		$this->registry->setImplementation(BookingApi::class, MockBookingApi::class)
		               ->setImplementation(CourseApi::class, MockCourseApi::class)
		               ->setImplementation(DayPartApi::class, MockDayPartApi::class)
		               ->setImplementation(LocationApi::class, MockLocationApi::class)
		               ->setImplementation(VoucherApi::class, MockVoucherApi::class)
		               ->setImplementation(LoggingApi::class, MockLoggingApi::class)
		               ->setImplementation(RegistrationApi::class, MockRegistrationApi::class);
	}
}