<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Annotation\ApiFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use App\Repository\OrderRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass=OrderRepository::class)
* @ORM\HasLifecycleCallbacks()
* @ApiResource(
* normalizationContext={"groups"={"order:read", "base:read", "assign:read"}},
* denormalizationContext={"groups"={"order:write", "base:write", "assign:write"}},
* )
* @ORM\EntityListeners({"App\EventListener\AbstractListener"})
* @ORM\Table(name="`order`")
*/
class Order
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"order:read"})
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
* @Groups({"order:read", "order:write"})
*/
private $name;
/**
* @ORM\Column(type="string", length=255)
*/
private $orderNo;
/**
* @ORM\Column(type="string", length=255, options={"default": "Pending"})
* @Groups({"order:read", "order:write"})
*/
private $status = 'Pending';
/**
* @ORM\Column(type="string", length=255, options={"default": "Waiting"})
*/
private $paymentStatus = 'Waiting';
/**
* @ORM\ManyToOne(targetEntity=User::class)
* @ORM\JoinColumn(nullable=false)
*/
private $assignedUser;
/**
* @ORM\Column(type="datetime")
* @Groups({"order:read", "order:write"})
*/
private $createdAt;
/**
* @ORM\Column(type="datetime")
*/
private $editedAt;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="string", length=255, options={"default": "cart"})
* @Groups({"order:read", "order:write"})
*/
private $type = 'cart';
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"order:read", "order:write"})
*/
private $paymentMethod;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $paymentMethodId;
/**
* @ORM\Column(type="array", nullable=true)
*/
private $paymentInfo = [];
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $billingAddress1;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $billingAddress2;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $billingCity;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $billingState;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $billingZipCode;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $billingCountry;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $shippingAddress1;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $shippingAddress2;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $shippingCity;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $shippingState;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $shippingZipCode;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $shippingCountry;
/**
* @ORM\Column(type="decimal", precision=17, scale=6, options={"default": 0})
*/
private $subtotal = 0;
/**
* @ORM\Column(type="decimal", precision=17, scale=6, options={"default": 0})
* @Groups({"order:read", "order:write"})
*/
private $total = 0;
/**
* @ORM\Column(type="decimal", precision=17, scale=6, options={"default": 0})
*/
private $discount = 0;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $billingFirstName;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $billingLastName;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"order:read", "order:write"})
*/
private $billingCompany;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $billingPhone;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $billingEmail;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $coupon;
/**
* @ORM\ManyToOne(targetEntity=Member::class, inversedBy="orders")
* @Groups({"order:read", "order:write"})
*/
private $assignedMember;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $abandonTime;
/**
* @ORM\Column(type="string", length=255, options={"default": "eXchange"})
* @Groups({"order:read", "order:write"})
*/
private $source = 'eXchange';
/**
* @ORM\Column(type="boolean", nullable=true, options={"default": false})
* @Groups({"order:read", "order:write"})
*/
private $deleted = false;
/**
* @ORM\Column(type="string", length=100, nullable=true)
* @Groups({"order:read", "order:write"})
*/
private $deletedBy;
/**
* @ORM\Column(type="datetime", nullable=true)
* @Groups({"order:read", "order:write"})
*/
private $deletedTime;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getOrderNo(): ?string
{
return $this->orderNo;
}
public function setOrderNo(string $orderNo): self
{
$this->orderNo = $orderNo;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(string $status): self
{
$this->status = $status;
return $this;
}
public function getPaymentStatus(): ?string
{
return $this->paymentStatus;
}
public function setPaymentStatus(string $paymentStatus): self
{
$this->paymentStatus = $paymentStatus;
return $this;
}
public function getAssignedUser(): ?User
{
return $this->assignedUser;
}
public function setAssignedUser(?User $assignedUser): self
{
$this->assignedUser = $assignedUser;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getEditedAt(): ?\DateTimeInterface
{
return $this->editedAt;
}
public function setEditedAt(\DateTimeInterface $editedAt): self
{
$this->editedAt = $editedAt;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): self
{
$this->type = $type;
return $this;
}
public function getPaymentMethod(): ?string
{
return $this->paymentMethod;
}
public function setPaymentMethod(?string $paymentMethod): self
{
$this->paymentMethod = $paymentMethod;
return $this;
}
public function getPaymentMethodId(): ?string
{
return $this->paymentMethodId;
}
public function setPaymentMethodId(?string $paymentMethodId): self
{
$this->paymentMethodId = $paymentMethodId;
return $this;
}
public function getPaymentInfo(): ?array
{
return $this->paymentInfo;
}
public function setPaymentInfo(?array $paymentInfo): self
{
$this->paymentInfo = $paymentInfo;
return $this;
}
public function getBillingAddress1(): ?string
{
return $this->billingAddress1;
}
public function setBillingAddress1(?string $billingAddress1): self
{
$this->billingAddress1 = $billingAddress1;
return $this;
}
public function getBillingAddress2(): ?string
{
return $this->billingAddress2;
}
public function setBillingAddress2(?string $billingAddress2): self
{
$this->billingAddress2 = $billingAddress2;
return $this;
}
public function getBillingCity(): ?string
{
return $this->billingCity;
}
public function setBillingCity(?string $billingCity): self
{
$this->billingCity = $billingCity;
return $this;
}
public function getBillingState(): ?string
{
return $this->billingState;
}
public function setBillingState(?string $billingState): self
{
$this->billingState = $billingState;
return $this;
}
public function getBillingZipCode(): ?string
{
return $this->billingZipCode;
}
public function setBillingZipCode(?string $billingZipCode): self
{
$this->billingZipCode = $billingZipCode;
return $this;
}
public function getBillingCountry(): ?string
{
return $this->billingCountry;
}
public function setBillingCountry(?string $billingCountry): self
{
$this->billingCountry = $billingCountry;
return $this;
}
public function getShippingAddress1(): ?string
{
return $this->shippingAddress1;
}
public function setShippingAddress1(?string $shippingAddress1): self
{
$this->shippingAddress1 = $shippingAddress1;
return $this;
}
public function getShippingAddress2(): ?string
{
return $this->shippingAddress2;
}
public function setShippingAddress2(?string $shippingAddress2): self
{
$this->shippingAddress2 = $shippingAddress2;
return $this;
}
public function getShippingCity(): ?string
{
return $this->shippingCity;
}
public function setShippingCity(?string $shippingCity): self
{
$this->shippingCity = $shippingCity;
return $this;
}
public function getShippingState(): ?string
{
return $this->shippingState;
}
public function setShippingState(?string $shippingState): self
{
$this->shippingState = $shippingState;
return $this;
}
public function getShippingZipCode(): ?string
{
return $this->shippingZipCode;
}
public function setShippingZipCode(?string $shippingZipCode): self
{
$this->shippingZipCode = $shippingZipCode;
return $this;
}
public function getShippingCountry(): ?string
{
return $this->shippingCountry;
}
public function setShippingCountry(?string $shippingCountry): self
{
$this->shippingCountry = $shippingCountry;
return $this;
}
public function getSubtotal(): ?string
{
return $this->subtotal;
}
public function setSubtotal(string $subtotal): self
{
$this->subtotal = $subtotal;
return $this;
}
public function getTotal(): ?string
{
return $this->total;
}
public function setTotal(string $total): self
{
$this->total = $total;
return $this;
}
public function getDiscount(): ?string
{
return $this->discount;
}
public function setDiscount(string $discount): self
{
$this->discount = $discount;
return $this;
}
public function getBillingFirstName(): ?string
{
return $this->billingFirstName;
}
public function setBillingFirstName(?string $billingFirstName): self
{
$this->billingFirstName = $billingFirstName;
return $this;
}
public function getBillingLastName(): ?string
{
return $this->billingLastName;
}
public function setBillingLastName(?string $billingLastName): self
{
$this->billingLastName = $billingLastName;
return $this;
}
public function getBillingCompany(): ?string
{
return $this->billingCompany;
}
public function setBillingCompany(?string $billingCompany): self
{
$this->billingCompany = $billingCompany;
return $this;
}
public function getBillingPhone(): ?string
{
return $this->billingPhone;
}
public function setBillingPhone(?string $billingPhone): self
{
$this->billingPhone = $billingPhone;
return $this;
}
public function getBillingEmail(): ?string
{
return $this->billingEmail;
}
public function setBillingEmail(?string $billingEmail): self
{
$this->billingEmail = $billingEmail;
return $this;
}
public function getCoupon(): ?string
{
return $this->coupon;
}
public function setCoupon(?string $coupon): self
{
$this->coupon = $coupon;
return $this;
}
public function getAssignedMember(): ?Member
{
return $this->assignedMember;
}
public function setAssignedMember(?Member $assignedMember): self
{
$this->assignedMember = $assignedMember;
return $this;
}
public function getAbandonTime(): ?\DateTimeInterface
{
return $this->abandonTime;
}
public function setAbandonTime(?\DateTimeInterface $abandonTime): self
{
$this->abandonTime = $abandonTime;
return $this;
}
public function getSource(): ?string
{
return $this->source;
}
public function setSource(?string $source): self
{
$this->source = $source;
return $this;
}
public function isDeleted(): ?bool
{
return $this->deleted;
}
public function setDeleted(?bool $deleted): self
{
$this->deleted = $deleted;
return $this;
}
public function getDeletedBy(): ?string
{
return $this->deletedBy;
}
public function setDeletedBy(?string $deletedBy): self
{
$this->deletedBy = $deletedBy;
return $this;
}
public function getDeletedTime(): ?\DateTimeInterface
{
return $this->deletedTime;
}
public function setDeletedTime(?\DateTimeInterface $deletedTime): self
{
$this->deletedTime = $deletedTime;
return $this;
}
}