<?php

namespace AppBundle\Entity\Product;

use AppBundle\Entity\Billing\FamilyQuotient;
use AppBundle\Filter\Billing\ResidenceArea;
use Doctrine\ORM\Mapping as ORM;
use Dunglas\ApiBundle\Annotation\Iri;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use AppBundle\Entity\Traits\TimestampableEntity;
use AppBundle\Entity\Traits\CreatorUpdaterEntity;

/**
 * Réduction appliquée à un élément de facturation Intangible,
 * résultant du quotient familial et/ou de la zone de résidence
 *
 * @Iri("http://schema.org/IntangibleDiscountDetail")
 */
#[ORM\Entity]
class IntangibleDiscountDetail
{
    use TimestampableEntity;
    use CreatorUpdaterEntity;
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer')]
    #[ORM\Id]
    #[ORM\GeneratedValue(strategy: 'AUTO')]
    #[Groups(['intangiblediscountdetail'])]
    private $id;
    /**
     * @var IntangiblePriceAndDiscount
     */
    #[ORM\ManyToOne(targetEntity: 'IntangiblePriceAndDiscount', inversedBy: 'intangibleDiscountDetails')]
    #[ORM\JoinColumn(nullable: false)]
    #[Assert\NotNull]
    #[Groups(['intangiblediscountdetail'])]
    private $intangiblePriceAndDiscount;
    /**
     * @var ResidenceArea
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Billing\ResidenceArea', inversedBy: 'intangibleDiscountDetails')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    #[Groups(['intangiblediscountdetail'])]
    private $residenceArea;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Assert\Choice(callback: ['AppBundle\Enum\Billing\PricingLineInvoiceLineEnum', 'toArray'])]
    #[Groups(['intangiblepriceanddiscount'])]
    private $pricingLine;
    /**
     * @var FamilyQuotient
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Billing\FamilyQuotient', inversedBy: 'intangibleDiscountDetails')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    #[Groups(['intangiblediscountdetail'])]
    private $familyQuotient;
    /**
     * @var float
     */
    #[ORM\Column(type: 'float', nullable: true)]
    #[Assert\Type(type: 'float')]
    #[Groups(['intangiblediscountdetail'])]
    private $price;
    /**
     * Sets id.
     *
     * @param int $id
     *
     * @return $this
     */
    public function setId($id)
    {
        $this->id = $id;

        return $this;
    }
    /**
     * Gets id.
     *
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }
    /**
     * Set pricingLine
     *
     * @param string $pricingLine
     *
     * @return IntangibleDiscountDetail
     */
    public function setPricingLine($pricingLine = null)
    {
        $this->pricingLine = $pricingLine;

        return $this;
    }
    /**
     * Get pricingLine
     *
     * @return string
     */
    public function getPricingLine()
    {
        return $this->pricingLine;
    }
    /**
     * Set price
     *
     * @param float $price
     *
     * @return IntangibleDiscountDetail
     */
    public function setPrice($price)
    {
        $this->price = floatval($price);

        return $this;
    }
    /**
     * Get price
     *
     * @return float
     */
    public function getPrice()
    {
        return $this->price;
    }
    /**
     * Set intangiblePriceAndDiscount
     *
     * @param \AppBundle\Entity\Product\IntangiblePriceAndDiscount $intangiblePriceAndDiscount
     *
     * @return IntangibleDiscountDetail
     */
    public function setIntangiblePriceAndDiscount(\AppBundle\Entity\Product\IntangiblePriceAndDiscount $intangiblePriceAndDiscount)
    {
        $this->intangiblePriceAndDiscount = $intangiblePriceAndDiscount;

        return $this;
    }
    /**
     * Get intangiblePriceAndDiscount
     *
     * @return \AppBundle\Entity\Product\IntangiblePriceAndDiscount
     */
    public function getIntangiblePriceAndDiscount()
    {
        return $this->intangiblePriceAndDiscount;
    }
    /**
     * Set residenceArea
     *
     * @param \AppBundle\Entity\Billing\ResidenceArea $residenceArea
     *
     * @return IntangibleDiscountDetail
     */
    public function setResidenceArea(\AppBundle\Entity\Billing\ResidenceArea $residenceArea = null)
    {
        $this->residenceArea = $residenceArea;

        return $this;
    }
    /**
     * Get residenceArea
     *
     * @return \AppBundle\Entity\Billing\ResidenceArea
     */
    public function getResidenceArea()
    {
        return $this->residenceArea;
    }
    /**
     * Set familyQuotient
     *
     * @param \AppBundle\Entity\Billing\FamilyQuotient $familyQuotient
     *
     * @return IntangibleDiscountDetail
     */
    public function setFamilyQuotient(\AppBundle\Entity\Billing\FamilyQuotient $familyQuotient = null)
    {
        $this->familyQuotient = $familyQuotient;

        return $this;
    }
    /**
     * Get familyQuotient
     *
     * @return \AppBundle\Entity\Billing\FamilyQuotient
     */
    public function getFamilyQuotient()
    {
        return $this->familyQuotient;
    }
}
