<?php

namespace NoahVet\Reef\Infrastructure\Business\BSM;

use NoahVet\Reef\Bsm\Endpoint\GetAllManufacturerUser;
use NoahVet\Reef\Bsm\Model\ManufacturerUserResponse;
use NoahVet\Reef\Infrastructure\Business\AbstractTeamMembersEnumerator;
use NoahVet\Reef\Iterator\Factory\ReefApiIteratorFactoryInterface;

/**
 * @extends AbstractTeamMembersEnumerator<ManufacturerUserResponse>
 */
class ManufacturerTeamMembersEnumerator extends AbstractTeamMembersEnumerator
{
    public function __construct(object $client, ReefApiIteratorFactoryInterface $iteratorFactory)
    {
        /* @phpstan-ignore method.notFound */
        $entityIdResolver = static fn (object $e): string => $e->getId();

        parent::__construct(
            $client,
            $iteratorFactory,
            GetAllManufacturerUser::class,
            ManufacturerUserResponse::class,
            'manufacturerId',
            $entityIdResolver,
            static fn (ManufacturerUserResponse $u): string => $u->getManufacturer()->getId(),
        );
    }
}
