<?php

namespace NoahVet\Reef\Business\Enumerator\Factory;

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

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

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