<?php

namespace NoahVet\Reef\Business\Enumerator\Factory;

use NoahVet\Reef\Business\Enumerator\ManufacturerWithTeamEnumerator;
use NoahVet\Reef\Business\Enumerator\ManufacturerWithTeamEnumeratorInterface;
use NoahVet\Reef\Business\Model\Factory\ManufacturerWithTeamFactory;
use NoahVet\Reef\Business\Model\Factory\TeamMemberFactory;
use NoahVet\Reef\Jane\Client;

class ManufacturerWithTeamEnumeratorFactory
{
    public function __construct(
        protected ManufacturerEnumeratorFactory $manufacturerEnumeratorFactory,
        protected ManufacturerTeamMembersEnumeratorFactory $manufacturerTeamMembersEnumeratorFactory,
        protected TeamMemberFactory $teamMemberFactory,
    ) {
    }

    public function create(Client $client): ManufacturerWithTeamEnumeratorInterface
    {
        return new ManufacturerWithTeamEnumerator(
            $this->manufacturerEnumeratorFactory->create($client),
            new ManufacturerWithTeamFactory(
                $this->manufacturerTeamMembersEnumeratorFactory->create($client),
                $this->teamMemberFactory,
            ),
        );
    }
}
