<?php

namespace RxConnexionBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer;
use RxConnexionBundle\Entity\Base\BaseEntity;

/**
 * @ORM\Entity(repositoryClass="RxConnexionBundle\Repository\SupplierStatusRepository")
 * @ORM\Table(name="supplier_status")
 */

class SupplierStatusEntity extends BaseEntity
{
    const APPROVAL_DESCRIPTION_PENDING = 'Pending Approval';
    const APPROVAL_DESCRIPTION_APPROVED = 'Approved';
    const APPROVAL_DESCRIPTION_REJECTED = 'Rejected';

    /**
     * @ORM\Column(name="status", type="string", nullable=true)
     */
    protected $status;

    /**
     * @ORM\Column(name="approval_description", type="string", nullable=true)
     */
    protected $approvalDescription;

    /**
     * @ORM\Column(name="note", type="text", nullable=true)
     */
    protected $note;

    /**
     * @ORM\Column(name="batch_no", type="integer")
     */
    protected $batchNo;

    /**
     * @ORM\ManyToOne(targetEntity="SupplierEntity", inversedBy="supplierStatuses")
     * @ORM\JoinColumn(name="supplier_id", referencedColumnName="id")
     */
    protected $supplier;

    /**
     * @ORM\ManyToOne(targetEntity="RxConnexionBundle\Entity\AccountUserEntity", inversedBy="supplierStatuses")
     * @ORM\JoinColumn(name="account_user_id", referencedColumnName="id")
     */
    protected $accountUser;

    /**
     * Set createdAt
     *
     * @ORM\PrePersist
     */
    public function setCreatedAtValue()
    {
        parent::setCreatedAtValue();
//        $this->approvalDescription = self::APPROVAL_DESCRIPTION_PENDING;
//        $this->status = self::APPROVAL_DESCRIPTION_PENDING;
    }

    /*--------------------------------------------------------------------------------------------------------*/
    /*					User Defined Setters and Getters													  */
    /*--------------------------------------------------------------------------------------------------------*/

    /*--------------------------------------------------------------------------------------------------------*/
    /*					Setters and Getters																	  */
    /*--------------------------------------------------------------------------------------------------------*/

    /**
     * Set status
     *
     * @param string $status
     *
     * @return SupplierStatusEntity
     */
    public function setStatus($status)
    {
        $this->status = $status;

        return $this;
    }

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

    /**
     * Set approvalDescription
     *
     * @param string $approvalDescription
     *
     * @return SupplierStatusEntity
     */
    public function setApprovalDescription($approvalDescription)
    {
        $this->approvalDescription = $approvalDescription;

        return $this;
    }

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

    /**
     * Set note
     *
     * @param string $note
     *
     * @return SupplierStatusEntity
     */
    public function setNote($note)
    {
        $this->note = $note;

        return $this;
    }

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

    /**
     * Set batchNo
     *
     * @param integer $batchNo
     *
     * @return SupplierStatusEntity
     */
    public function setBatchNo($batchNo)
    {
        $this->batchNo = $batchNo;

        return $this;
    }

    /**
     * Get batchNo
     *
     * @return integer
     */
    public function getBatchNo()
    {
        return $this->batchNo;
    }

    /**
     * Set supplier
     *
     * @param \RxConnexionBundle\Entity\SupplierEntity $supplier
     *
     * @return SupplierStatusEntity
     */
    public function setSupplier(\RxConnexionBundle\Entity\SupplierEntity $supplier = null)
    {
        $this->supplier = $supplier;

        return $this;
    }

    /**
     * Get supplier
     *
     * @return \RxConnexionBundle\Entity\SupplierEntity
     */
    public function getSupplier()
    {
        return $this->supplier;
    }

    /**
     * Set accountUser
     *
     * @param \RxConnexionBundle\Entity\AccountUserEntity $accountUser
     *
     * @return SupplierStatusEntity
     */
    public function setAccountUser(\RxConnexionBundle\Entity\AccountUserEntity $accountUser = null)
    {
        $this->accountUser = $accountUser;

        return $this;
    }

    /**
     * Get accountUser
     *
     * @return \RxConnexionBundle\Entity\AccountUserEntity
     */
    public function getAccountUser()
    {
        return $this->accountUser;
    }
}
