<?php

declare(strict_types=1);

namespace App\Entity\Billing;

use ApiPlatform\Metadata\ApiResource;
use App\Entity\Access\Access;
use App\Entity\Booking\EducationalProject;
// 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 EducationalProjectPayer, et supprimer l'attribut discr.
 *
 * Fais le lien entre l'Access qui règle la facture et l'EducationalProject concerné
 */
#[ApiResource(operations: [])]
// #[Auditable]
#[ORM\Entity]
class EducationalProjectPayer extends AbstractBillingPayer
{
    #[ORM\ManyToOne(cascade: ['persist'], inversedBy: 'billingEducationalProjectPayers')]
    private ?Access $educationalProjectPayer = null;

    #[ORM\ManyToOne(cascade: ['persist'], inversedBy: 'billingReceivers')]
    private ?EducationalProject $educationalProjectReceiver = null;

    public function getEducationalProjectPayer(): ?Access
    {
        return $this->educationalProjectPayer;
    }

    public function setEducationalProjectPayer(?Access $educationalProjectPayer): self
    {
        $this->educationalProjectPayer = $educationalProjectPayer;

        return $this;
    }

    public function getEducationalProjectReceiver(): ?EducationalProject
    {
        return $this->educationalProjectReceiver;
    }

    public function setEducationalProjectReceiver(?EducationalProject $educationalProjectReceiver): self
    {
        $this->educationalProjectReceiver = $educationalProjectReceiver;

        return $this;
    }
}
