<?php
namespace App\Entity\Shop\Order;
use App\Entity\BaseEntity;
use App\Entity\Shop\Product\Product;
use App\Entity\Shop\Shop\Shop;
use App\Repository\Shop\DiscountRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
#[ORM\Entity(repositoryClass: DiscountRepository::class)]
class Discount extends BaseEntity
{
#[ORM\Id]
#[ORM\Column(type: 'guid', unique: true)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: UuidGenerator::class)]
private ?string $id;
#[ORM\Column]
private ?float $percentage = null;
#[ORM\Column(type: Types::BIGINT)]
private ?string $fixedAmount = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $startDate = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $endDate = null;
#[ORM\ManyToOne(inversedBy: 'discounts')]
#[ORM\JoinColumn(nullable: false)]
private ?Product $product = null;
#[ORM\ManyToOne(inversedBy: 'discounts')]
#[ORM\JoinColumn(nullable: false)]
private ?Shop $shop = null;
public function getId(): ?string
{
return $this->id;
}
public function getPercentage(): ?float
{
return $this->percentage;
}
public function setPercentage(float $percentage): static
{
$this->percentage = $percentage;
return $this;
}
public function getFixedAmount(): ?string
{
return $this->fixedAmount;
}
public function setFixedAmount(string $fixedAmount): static
{
$this->fixedAmount = $fixedAmount;
return $this;
}
public function getStartDate(): ?\DateTimeInterface
{
return $this->startDate;
}
public function setStartDate(?\DateTimeInterface $startDate): static
{
$this->startDate = $startDate;
return $this;
}
public function getEndDate(): ?\DateTimeInterface
{
return $this->endDate;
}
public function setEndDate(?\DateTimeInterface $endDate): static
{
$this->endDate = $endDate;
return $this;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(?Product $product): static
{
$this->product = $product;
return $this;
}
public function getShop(): ?Shop
{
return $this->shop;
}
public function setShop(?Shop $shop): static
{
$this->shop = $shop;
return $this;
}
}