<?php

declare(strict_types=1);

namespace App\Entity\Product;

use ApiPlatform\Metadata\ApiResource;
use App\Entity\Billing\FamilyQuotient;
use App\Entity\Billing\FamilyQuotientBand;
use App\Entity\Billing\FamilyQuotientBandDetail;
use App\Entity\Billing\ResidenceArea;
// use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
use Doctrine\ORM\Mapping as ORM;

/**
 * Réduction appliquée à un élément de facturation Intangible,
 * résultant du quotient familial et/ou de la zone de résidence.
 */
#[ApiResource(operations: [])]
// #[Auditable]
#[ORM\Entity]
class IntangibleDiscountDetail
{
    #[ORM\Id]
    #[ORM\Column]
    #[ORM\GeneratedValue]
    private ?int $id = null;

    #[ORM\ManyToOne(inversedBy: 'intangibleDiscountDetails')]
    #[ORM\JoinColumn(nullable: false)]
    private IntangiblePriceAndDiscount $intangiblePriceAndDiscount;

    #[ORM\ManyToOne(inversedBy: 'intangibleDiscountDetails')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    private ?ResidenceArea $residenceArea = null;

    #[ORM\ManyToOne(inversedBy: 'intangibleDiscountDetails')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    private ?FamilyQuotient $familyQuotient = null;

    #[ORM\ManyToOne(targetEntity: FamilyQuotientBandDetail::class, cascade: [], inversedBy: 'intangibleDiscountDetails')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    protected ?FamilyQuotientBandDetail $familyQuotientBandDetail;

    #[ORM\ManyToOne(targetEntity: FamilyQuotientBand::class, cascade: [], inversedBy: 'intangibleDiscountDetails')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    protected ?FamilyQuotientBand $familyQuotientBand;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getIntangiblePriceAndDiscount(): ?IntangiblePriceAndDiscount
    {
        return $this->intangiblePriceAndDiscount;
    }

    public function setIntangiblePriceAndDiscount(?IntangiblePriceAndDiscount $intangiblePriceAndDiscount): self
    {
        $this->intangiblePriceAndDiscount = $intangiblePriceAndDiscount;

        return $this;
    }

    public function getResidenceArea(): ?ResidenceArea
    {
        return $this->residenceArea;
    }

    public function setResidenceArea(?ResidenceArea $residenceArea): self
    {
        $this->residenceArea = $residenceArea;

        return $this;
    }

    public function getFamilyQuotient(): ?FamilyQuotient
    {
        return $this->familyQuotient;
    }

    public function setFamilyQuotient(?FamilyQuotient $familyQuotient): self
    {
        $this->familyQuotient = $familyQuotient;

        return $this;
    }

    public function getFamilyQuotientBandDetail(): ?FamilyQuotientBandDetail
    {
        return $this->familyQuotientBandDetail;
    }

    public function setFamilyQuotientBandDetail(?FamilyQuotientBandDetail $familyQuotientBandDetail): self
    {
        $this->familyQuotientBandDetail = $familyQuotientBandDetail;

        return $this;
    }

    public function getFamilyQuotientBand(): ?FamilyQuotientBand
    {
        return $this->familyQuotientBand;
    }

    public function setFamilyQuotientBand(?FamilyQuotientBand $familyQuotientBand): self
    {
        $this->familyQuotientBand = $familyQuotientBand;

        return $this;
    }
}
