<?php
namespace App\Entity\PurchaseTracking;
use App\Annotation\SiteAware;
use App\Entity\AbstractBase;
use App\Entity\Garages\Garage;
use App\Entity\Interfaces\SiteInterface;
use App\Entity\OnlineShop\Supplier;
use App\Entity\Traits\SiteTrait;
use App\Repository\PurchaseTracking\GaragePurchaseRepository;
use DateTimeInterface;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Table(name="vulco_garage_purchase", indexes={@ORM\Index(name="garage_purchase_site_idx", columns={"site"})}, uniqueConstraints={@ORM\UniqueConstraint(name="garage_and_supplier_and_year_purchases_unique_idx", columns={"garage_id", "supplier_id", "year"})})
* @ORM\Entity(repositoryClass=GaragePurchaseRepository::class)
* @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
* @SiteAware(siteFieldName="site")
*/
class GaragePurchase extends AbstractBase implements SiteInterface
{
use SiteTrait;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Garages\Garage", inversedBy="purchases")
* @ORM\JoinColumn(name="garage_id", referencedColumnName="id")
*/
private Garage $garage;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\OnlineShop\Supplier", fetch="EAGER")
* @ORM\JoinColumn(name="supplier_id", referencedColumnName="id", onDelete="CASCADE")
*/
private Supplier $supplier;
/**
* @ORM\Column(type="integer")
*/
private $year;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
protected ?DateTimeInterface $date;
/**
* @ORM\Column(type="float")
*/
private $amount;
/**
* @ORM\Column(type="float")
*/
private $rappelPercentage;
/**
* @ORM\Column(type="float")
*/
private $rappelAmount;
public function getGarage(): Garage
{
return $this->garage;
}
public function setGarage(Garage $garage): self
{
$this->garage = $garage;
return $this;
}
public function getSupplier(): Supplier
{
return $this->supplier;
}
public function setSupplier(Supplier $supplier): self
{
$this->supplier = $supplier;
return $this;
}
public function getYear(): int
{
return $this->year;
}
public function setYear(int $year): self
{
$this->year = $year;
return $this;
}
public function getDate(): ?DateTimeInterface
{
return $this->date;
}
public function setDate(?DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getAmount(): float
{
return $this->amount;
}
public function setAmount(float $amount): self
{
$this->amount = $amount;
return $this;
}
public function getRappelPercentage(): float
{
return $this->rappelPercentage;
}
public function setRappelPercentage(float $rappelPercentage): self
{
$this->rappelPercentage = $rappelPercentage;
return $this;
}
public function getRappelAmount(): float
{
return $this->rappelAmount;
}
public function setRappelAmount(float $rappelAmount): self
{
$this->rappelAmount = $rappelAmount;
return $this;
}
}