<?php

namespace NoahVet\Reef\Business\Enumerator\Factory;

use NoahVet\Reef\Business\Enumerator\EstablishmentWithTeamEnumerator;
use NoahVet\Reef\Business\Model\Factory\EstablishmentWithTeamFactory;
use NoahVet\Reef\Business\Model\Factory\TeamMemberFactory;
use NoahVet\Reef\Jane\Client;

class EstablishmentWithTeamEnumeratorFactory
{
    public function __construct(
        protected VeterinaryEstablishmentEnumeratorFactory $establishmentEnumeratorFactory,
        protected VeterinaryEstablishmentTeamMembersEnumeratorFactory $establishmentTeamMembersEnumeratorFactory,
        protected TeamMemberFactory $teamMemberFactory,
    ) {
    }

    public function create(Client $client): EstablishmentWithTeamEnumerator
    {
        return new EstablishmentWithTeamEnumerator(
            $this->establishmentEnumeratorFactory->create($client),
            new EstablishmentWithTeamFactory(
                $this->establishmentTeamMembersEnumeratorFactory->create($client),
                $this->teamMemberFactory,
            ),
        );
    }
}
