<?php

namespace AppBundle\Entity\Billing;

use AppBundle\Entity\Organization\Organization;
use Doctrine\Common\Collections\ArrayCollection;
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;
use AppBundle\Annotation\DefaultField;

/**
 * Paramètres globaux d'une Organization concernant la facturation liée à la location
 *
 * @Iri("http://schema.org/BillingSettingRent")
 */
#[ORM\Entity]
class BillingSettingRent
{
    use TimestampableEntity;
    use CreatorUpdaterEntity;
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer')]
    #[ORM\Id]
    #[ORM\GeneratedValue(strategy: 'AUTO')]
    #[Groups(['billingsettingrent'])]
    private $id;
    /**
     * @var BillingSetting
     */
    #[ORM\OneToOne(targetEntity: 'BillingSetting', inversedBy: 'billingSettingRent', fetch: 'EAGER')]
    #[ORM\JoinColumn(nullable: false)]
    #[Assert\NotNull]
    #[Groups(['billingsettingrent'])]
    private $billingSetting;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Assert\Choice(callback: ['\AppBundle\Enum\Billing\ReductionTypeEnum', 'toArray'])]
    #[Groups(['billingsettingrent'])]
    private $reductionType;
    /**
     * @var float
     */
    #[ORM\Column(type: 'float', nullable: true)]
    #[Assert\Type(type: 'float')]
    #[Groups(['billingsettingrent'])]
    private $thresholdFirstAmount;
    /**
     * @var float
     */
    #[ORM\Column(type: 'float', nullable: true)]
    #[Assert\Type(type: 'float')]
    #[Groups(['billingsettingrent'])]
    private $thresholdSecondAmount;
    /**
     * @var float
     */
    #[ORM\Column(type: 'integer', nullable: true)]
    #[Assert\Type(type: 'integer', message: 'invalid-integer')]
    #[Groups(['billingsettingrent'])]
    private $thresholdNumberYear;
    /**
     * @var array
     */
    #[ORM\Column(type: 'json_array', nullable: true)]
    #[Groups(['billingsettingrent'])]
    private $instrumentFamilyReduction;
    /**
     * @var array
     */
    #[ORM\Column(type: 'json_array', nullable: true)]
    #[Groups(['billingsettingrent'])]
    private $purchaseDateReduction;
    /**
     * @var array
     */
    #[ORM\Column(type: 'json_array', nullable: true)]
    #[Groups(['billingsettingrent'])]
    private $purchaseAmountReduction;
    /**
     * @var array
     */
    #[ORM\Column(type: 'json_array', nullable: true)]
    #[Groups(['billingsettingrent'])]
    private $rentalYearsReduction;
    /**
     * @var array
     */
    #[ORM\Column(type: 'json_array', nullable: true)]
    #[Groups(['billingsettingrent'])]
    private $instrumentFamilyAndRentalYearsReduction;
    /**
     * @var float
     */
    #[ORM\Column(type: 'float', nullable: true)]
    #[Assert\Type(type: 'float')]
    #[Groups(['billingsettingrent'])]
    private $singleAmount;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Assert\Choice(callback: ['\AppBundle\Enum\Billing\PeriodicityEnum', 'toArray'])]
    #[Groups(['billingsettingrent'])]
    private $periodicity;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', length: 7, nullable: true)]
    #[Assert\Length(max: 7, maxMessage: 'invalid-max-length')]
    #[Assert\Type(type: 'string')]
    #[Groups(['billingsettingrent'])]
    private $accountingCode;
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer', nullable: true)]
    #[Assert\Type(type: 'integer', message: 'invalid-integer')]
    #[Groups(['billingsettingrent'])]
    private $nature;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', length: 200, nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Groups(['billingsettingrent'])]
    private $accountingCodelabel;
    /**
     * Constructor
     */
    public function __construct()
    {
    }
    /**
     * 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 reductionType
     *
     * @param string $reductionType
     *
     * @return BillingSettingRent
     */
    public function setReductionType($reductionType)
    {
        $this->reductionType = $reductionType;

        return $this;
    }
    /**
     * Get reductionType
     *
     * @return string
     */
    public function getReductionType()
    {
        return $this->reductionType;
    }
    /**
     * Set instrumentFamilyReduction
     *
     * @param array $instrumentFamilyReduction
     *
     * @return BillingSettingRent
     */
    public function setInstrumentFamilyReduction($instrumentFamilyReduction)
    {
        $this->instrumentFamilyReduction = $instrumentFamilyReduction;

        return $this;
    }
    /**
     * Get instrumentFamilyReduction
     *
     * @return array
     */
    public function getInstrumentFamilyReduction()
    {
        return $this->instrumentFamilyReduction;
    }
    /**
     * Set purchaseDateReduction
     *
     * @param array $purchaseDateReduction
     *
     * @return BillingSettingRent
     */
    public function setPurchaseDateReduction($purchaseDateReduction)
    {
        $this->purchaseDateReduction = $purchaseDateReduction;

        return $this;
    }
    /**
     * Get purchaseDateReduction
     *
     * @return array
     */
    public function getPurchaseDateReduction()
    {
        return $this->purchaseDateReduction;
    }
    /**
     * Set purchaseAmountReduction
     *
     * @param array $purchaseAmountReduction
     *
     * @return BillingSettingRent
     */
    public function setPurchaseAmountReduction($purchaseAmountReduction)
    {
        $this->purchaseAmountReduction = $purchaseAmountReduction;

        return $this;
    }
    /**
     * Get purchaseAmountReduction
     *
     * @return array
     */
    public function getPurchaseAmountReduction()
    {
        return $this->purchaseAmountReduction;
    }
    /**
     * Set rentalYearsReduction
     *
     * @param array $rentalYearsReduction
     *
     * @return BillingSettingRent
     */
    public function setRentalYearsReduction($rentalYearsReduction)
    {
        $this->rentalYearsReduction = $rentalYearsReduction;

        return $this;
    }
    /**
     * Get rentalYearsReduction
     *
     * @return array
     */
    public function getRentalYearsReduction()
    {
        return $this->rentalYearsReduction;
    }
    /**
     * Set billingSetting
     *
     * @param \AppBundle\Entity\Billing\BillingSetting $billingSetting
     *
     * @return BillingSettingRent
     */
    public function setBillingSetting(\AppBundle\Entity\Billing\BillingSetting $billingSetting)
    {
        $this->billingSetting = $billingSetting;

        return $this;
    }
    /**
     * Get billingSetting
     *
     * @return \AppBundle\Entity\Billing\BillingSetting
     */
    public function getBillingSetting()
    {
        return $this->billingSetting;
    }
    /**
     * Set thresholdFirstAmount
     *
     * @param float $thresholdFirstAmount
     *
     * @return BillingSettingRent
     */
    public function setThresholdFirstAmount($thresholdFirstAmount)
    {
        $this->thresholdFirstAmount = floatval($thresholdFirstAmount);

        return $this;
    }
    /**
     * Get thresholdFirstAmount
     *
     * @return float
     */
    public function getThresholdFirstAmount()
    {
        return $this->thresholdFirstAmount;
    }
    /**
     * Set thresholdSecondAmount
     *
     * @param float $thresholdSecondAmount
     *
     * @return BillingSettingRent
     */
    public function setThresholdSecondAmount($thresholdSecondAmount)
    {
        $this->thresholdSecondAmount = floatval($thresholdSecondAmount);

        return $this;
    }
    /**
     * Get thresholdSecondAmount
     *
     * @return float
     */
    public function getThresholdSecondAmount()
    {
        return $this->thresholdSecondAmount;
    }
    /**
     * Set thresholdNumberYear
     *
     * @param \Integer $thresholdNumberYear
     *
     * @return BillingSettingRent
     */
    public function setThresholdNumberYear($thresholdNumberYear)
    {
        $this->thresholdNumberYear = $thresholdNumberYear;

        return $this;
    }
    /**
     * Get thresholdNumberYear
     *
     * @return \Integer
     */
    public function getThresholdNumberYear()
    {
        return $this->thresholdNumberYear;
    }
    /**
     * Set instrumentFamilyAndRentalYearsReduction
     *
     * @param array $instrumentFamilyAndRentalYearsReduction
     *
     * @return BillingSettingRent
     */
    public function setInstrumentFamilyAndRentalYearsReduction($instrumentFamilyAndRentalYearsReduction)
    {
        $this->instrumentFamilyAndRentalYearsReduction = $instrumentFamilyAndRentalYearsReduction;

        return $this;
    }
    /**
     * Get instrumentFamilyAndRentalYearsReduction
     *
     * @return array
     */
    public function getInstrumentFamilyAndRentalYearsReduction()
    {
        return $this->instrumentFamilyAndRentalYearsReduction;
    }
    /**
     * Set singleAmount
     *
     * @param float $singleAmount
     *
     * @return BillingSettingRent
     */
    public function setSingleAmount($singleAmount)
    {
        $this->singleAmount = floatval($singleAmount);

        return $this;
    }
    /**
     * Get singleAmount
     *
     * @return float
     */
    public function getSingleAmount()
    {
        return $this->singleAmount;
    }
    /**
     * Set periodicity
     *
     * @param string $periodicity
     *
     * @return BillingSettingRent
     */
    public function setPeriodicity($periodicity)
    {
        $this->periodicity = $periodicity;

        return $this;
    }
    /**
     * Get periodicity
     *
     * @return string
     */
    public function getPeriodicity()
    {
        return $this->periodicity;
    }
    /**
     * Set accountingCode
     *
     * @param integer $accountingCode
     *
     * @return BillingSettingRent
     */
    public function setAccountingCode($accountingCode)
    {
        $this->accountingCode = $accountingCode;

        return $this;
    }
    /**
     * Get accountingCode
     *
     * @return integer
     */
    public function getAccountingCode()
    {
        return $this->accountingCode;
    }
    /**
     * Set nature
     *
     * @param integer $nature
     *
     * @return BillingSettingRent
     */
    public function setNature($nature)
    {
        $this->nature = $nature;

        return $this;
    }
    /**
     * Get nature
     *
     * @return integer
     */
    public function getNature()
    {
        return $this->nature;
    }
    /**
     * Set accountingCodelabel
     *
     * @param string $accountingCodelabel
     *
     * @return BillingSettingRent
     */
    public function setAccountingCodelabel($accountingCodelabel)
    {
        $this->accountingCodelabel = $accountingCodelabel;

        return $this;
    }
    /**
     * Get accountingCodelabel
     *
     * @return string
     */
    public function getAccountingCodelabel()
    {
        return $this->accountingCodelabel;
    }
}
