<?php

declare(strict_types=1);

namespace App\Entity\Billing;

use ApiPlatform\Metadata\ApiResource;
use App\Entity\Access\Access;
use App\Repository\Billing\AccessPayerRepository;
// use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
use Doctrine\ORM\Mapping as ORM;

/**
 * @todo : A la suite de la migration, il faut supprimer le nom de la table pour avoir une table AccessPayer, et supprimer l'attribut discr.
 *
 * Fais le lien entre l'Access qui règle la facture et l'Access concerné
 */
#[ApiResource(operations: [])]
// #[Auditable]
#[ORM\Entity(repositoryClass: AccessPayerRepository::class)]
class AccessPayer extends AbstractBillingPayer
{
    #[ORM\ManyToOne(inversedBy: 'billingPayers')]
    private ?Access $accessPayer = null;

    #[ORM\ManyToOne(inversedBy: 'billingReceivers')]
    private ?Access $accessReceiver = null;

    public function setAccessPayer(?Access $accessPayer): self
    {
        $this->accessPayer = $accessPayer;

        return $this;
    }

    public function getAccessPayer(): ?Access
    {
        return $this->accessPayer;
    }

    public function setAccessReceiver(?Access $accessReceiver): self
    {
        $this->accessReceiver = $accessReceiver;

        return $this;
    }

    public function getAccessReceiver(): ?Access
    {
        return $this->accessReceiver;
    }
}
