<?php

declare(strict_types=1);

/*
 * Chill is a software for social workers
 *
 * For the full copyright and license information, please view
 * the LICENSE file that was distributed with this source code.
 */

namespace Chill\PersonBundle\PersonIdentifier;

use Chill\PersonBundle\Entity\Identifier\PersonIdentifierDefinition;

interface PersonIdentifierManagerInterface
{
    /**
     * Build PersonIdentifierWorker's for all active definition.
     *
     * Only active definition are returned.
     *
     * @return list<PersonIdentifierWorker>
     */
    public function getWorkers(): array;

    /**
     * @param int|PersonIdentifierDefinition $personIdentifierDefinition an instance of PersonIdentifierDefinition, or his id
     *
     * @throw PersonIdentifierNotFoundException
     */
    public function buildWorkerByPersonIdentifierDefinition(int|PersonIdentifierDefinition $personIdentifierDefinition): PersonIdentifierWorker;
}
