<?php
declare (strict_types=1);

namespace App\Entity\Product;

use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\ApiResource;
use App\Entity\Billing\FamilyQuotient;
use App\Entity\Billing\ResidenceArea;

//use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
use Doctrine\ORM\Mapping as ORM;

/**
 * Classe ... qui ...
 */
#[ApiResource(
    operations: [
        new Get(
            security: 'is_granted(\'ROLE_ADMIN\')'
        )
    ]
)]
//#[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;

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

    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;
    }
}