<?php

namespace App\Entity;

use App\Behavior\Timestampable;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\OrderRepository;
use Gedmo\Mapping\Annotation as Gedmo;


/**
 * @ORM\Entity(repositoryClass=OrderRepository::class)
 * @ORM\HasLifecycleCallbacks()
 * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=false)
 */
class Order
{
    use Timestampable;

    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\Column(type="boolean", options={"comment":"Is delivered now? yes or not"})
     */
    private $sendNow;

    /**
     * @ORM\Column(type="datetime", nullable=true, options={"comment":"If not delivered now, when?"})
     */
    private $deliveryDate;

    /**
     * @ORM\Column(type="decimal", precision=10, scale=3)
     */
    private $subtotal;

    /**
     * @ORM\Column(type="decimal", precision=10, scale=3)
     */
    private $fee;

    /**
     * @ORM\Column(type="decimal", precision=10, scale=3)
     */
    private $total;

    /**
     * @ORM\Column(type="string", length=20, options={"comment":"This code is the one that the user will use to identify the order"})
     */
    private $code;

    /**
     * @ORM\Column(type="string", length=1)
     */
    private $status;

    /**
     * @ORM\Column(type="string", length=2)
     */
    private $paymentType;

    /**
     * @ORM\Column(type="string", length=10, nullable=true)
     */
    private $entity;

    /**
     * @ORM\Column(type="string", length=12, nullable=true)
     */
    private $reference;

    /**
     * @ORM\Column(type="string", length=70, nullable=true)
     */
    private $paymentUid;

    /**
     * @ORM\Column(type="string", length=1)
     */
    private $paymentStatus;

    /**
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $paymentDate;

    /**
     * @ORM\Column(type="string", length=500)
     */
    private $addressDestination;

    /**
     * @ORM\ManyToOne(targetEntity=Restaurant::class, inversedBy="order")
     */
    private $restaurant;

    /**
     * @ORM\OneToOne(targetEntity=User::class, inversedBy="client")
     * @ORM\JoinColumn(name="client_user_id", referencedColumnName="id")
     */
    private $userClient;

    /**
     * @ORM\OneToOne(targetEntity=User::class, inversedBy="deliveryMan")
     * @ORM\JoinColumn(name="deliveryman_user_id", referencedColumnName="id")
     */
    private $userDeliveryMan;

    /**
     * @ORM\OneToMany(targetEntity=TrackingOrder::class, mappedBy="order")
     */
    private $tracking;

    /**
     * @ORM\OneToMany(targetEntity=TrackingOrder::class, mappedBy="order")
     */
    private $orderDetail;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function isSendNow(): ?bool
    {
        return $this->sendNow;
    }

    public function setSendNow(bool $sendNow): self
    {
        $this->sendNow = $sendNow;

        return $this;
    }

    public function getDeliveryDate(): ?\DateTimeInterface
    {
        return $this->deliveryDate;
    }

    public function setDeliveryDate(?\DateTimeInterface $deliveryDate): self
    {
        $this->deliveryDate = $deliveryDate;

        return $this;
    }

    public function getTotal(): ?string
    {
        return $this->total;
    }

    public function setTotal(string $total): self
    {
        $this->total = $total;

        return $this;
    }

    public function getFee(): ?string
    {
        return $this->fee;
    }

    public function setFee(string $fee): self
    {
        $this->fee = $fee;

        return $this;
    }

    public function getCode(): ?string
    {
        return $this->code;
    }

    public function setCode(string $code): self
    {
        $this->code = $code;

        return $this;
    }

    public function getStatus(): ?string
    {
        return $this->status;
    }

    public function setStatus(string $status): self
    {
        $this->status = $status;

        return $this;
    }

    /**
     * Get the value of subtotal
     */
    public function getSubtotal()
    {
        return $this->subtotal;
    }

    /**
     * Set the value of subtotal
     *
     * @return  self
     */
    public function setSubtotal($subtotal)
    {
        $this->subtotal = $subtotal;

        return $this;
    }

    /**
     * Get the value of addressDestination
     */
    public function getAddressDestination()
    {
        return $this->addressDestination;
    }

    /**
     * Set the value of addressDestination
     *
     * @return  self
     */
    public function setAddressDestination($addressDestination)
    {
        $this->addressDestination = $addressDestination;

        return $this;
    }

    /**
     * Get the value of orderRestaurant
     */ 
    public function getOrderRestaurant()
    {
        return $this->orderRestaurant;
    }

    /**
     * Set the value of orderRestaurant
     *
     * @return  self
     */ 
    public function setOrderRestaurant($orderRestaurant)
    {
        $this->orderRestaurant = $orderRestaurant;

        return $this;
    }

    /**
     * Get the value of userClient
     */
    public function getUserClient()
    {
        return $this->userClient;
    }

    /**
     * Set the value of userClient
     *
     * @return  self
     */
    public function setUserClient($userClient)
    {
        $this->userClient = $userClient;

        return $this;
    }

    /**
     * Get the value of userDeliveryMan
     */
    public function getUserDeliveryMan()
    {
        return $this->userDeliveryMan;
    }

    /**
     * Set the value of userDeliveryMan
     *
     * @return  self
     */
    public function setUserDeliveryMan($userDeliveryMan)
    {
        $this->userDeliveryMan = $userDeliveryMan;

        return $this;
    }

    /**
     * Get the value of tracking
     */
    public function getTracking()
    {
        return $this->tracking;
    }

    /**
     * Set the value of tracking
     *
     * @return  self
     */
    public function setTracking($tracking)
    {
        $this->tracking = $tracking;

        return $this;
    }

    /**
     * Get the value of orderDetail
     */
    public function getOrderDetail()
    {
        return $this->orderDetail;
    }

    /**
     * Set the value of orderDetail
     *
     * @return  self
     */
    public function setOrderDetail($orderDetail)
    {
        $this->orderDetail = $orderDetail;

        return $this;
    }

    /**
     * Get the value of paymentType
     */
    public function getPaymentType()
    {
        return $this->paymentType;
    }

    /**
     * Set the value of paymentType
     *
     * @return  self
     */
    public function setPaymentType($paymentType)
    {
        $this->paymentType = $paymentType;

        return $this;
    }

    /**
     * Get the value of entity
     */
    public function getEntity()
    {
        return $this->entity;
    }

    /**
     * Set the value of entity
     *
     * @return  self
     */
    public function setEntity($entity)
    {
        $this->entity = $entity;

        return $this;
    }

    /**
     * Get the value of reference
     */
    public function getReference()
    {
        return $this->reference;
    }

    /**
     * Set the value of reference
     *
     * @return  self
     */
    public function setReference($reference)
    {
        $this->reference = $reference;

        return $this;
    }

    /**
     * Get the value of paymentUid
     */
    public function getPaymentUid()
    {
        return $this->paymentUid;
    }

    /**
     * Set the value of paymentUid
     *
     * @return  self
     */
    public function setPaymentUid($paymentUid)
    {
        $this->paymentUid = $paymentUid;

        return $this;
    }

    /**
     * Get the value of paymentStatus
     */
    public function getPaymentStatus()
    {
        return $this->paymentStatus;
    }

    /**
     * Set the value of paymentStatus
     *
     * @return  self
     */
    public function setPaymentStatus($paymentStatus)
    {
        $this->paymentStatus = $paymentStatus;

        return $this;
    }

    /**
     * Get the value of paymentDate
     */
    public function getPaymentDate()
    {
        return $this->paymentDate;
    }

    /**
     * Set the value of paymentDate
     *
     * @return  self
     */
    public function setPaymentDate($paymentDate)
    {
        $this->paymentDate = $paymentDate;

        return $this;
    }

    /**
     * Get the value of restaurant
     */
    public function getRestaurant()
    {
        return $this->restaurant;
    }

    /**
     * Set the value of restaurant
     *
     * @return  self
     */
    public function setRestaurant($restaurant)
    {
        $this->restaurant = $restaurant;

        return $this;
    }
}
