<?php

namespace RxConnexionBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use RxConnexionBundle\Entity\Base\BaseEntity;
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer;
use JMS\Serializer\Annotation\Groups;
use JMS\Serializer\Annotation\MaxDepth;

/**
 * @ORM\Entity(repositoryClass="RxConnexionBundle\Repository\PatientRefundBreakdownRepository")
 * @ORM\Table(name="patient_refund_breakdown")
 * @ORM\HasLifecycleCallbacks()
 */

class PatientRefundBreakdownEntity extends BaseEntity
{

    /**
     * @ORM\Column(name="amount", type="decimal", precision=12, scale=2, nullable=true)
     * @Groups("forAudit")
     */
    protected $amount;

    /**
     * @ORM\Column(name="is_deleted", type="boolean")
     */
    protected $isDeleted;

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

    /**
     * @ORM\ManyToOne(targetEntity="PatientBillingBreakdownEntity", inversedBy="patientRefundBreakdowns")
     * @ORM\JoinColumn(name="patient_billing_breakdown_id", referencedColumnName="id")
     * @Groups("forAudit")
     * @MaxDepth(1)
     */
    protected $patientBillingBreakdown;

    /**
     * @ORM\ManyToOne(targetEntity="PatientBillingRefundEntity", inversedBy="patientRefundBreakdowns")
     * @ORM\JoinColumn(name="patient_refund_id", referencedColumnName="id")
     * @Groups("forAudit")
     * @MaxDepth(1)
     */
    protected $patientBillingRefund;

    /**
     * Set createdAt
     *
     * @ORM\PrePersist
     */
    public function setCreatedAtValue()
    {
        parent::setCreatedAtValue();
        $this->isDeleted = 0;
    }

    /*--------------------------------------------------------------------------------------------------------*/
    /*					Use Defined Setters and Getters														  */
    /*--------------------------------------------------------------------------------------------------------*/

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


    /**
     * Set amount
     *
     * @param string $amount
     *
     * @return PatientRefundBreakdownEntity
     */
    public function setAmount($amount)
    {
        $this->amount = floatval(str_replace(',', '', $amount));

        return $this;
    }

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

    /**
     * Set isDeleted
     *
     * @param boolean $isDeleted
     *
     * @return PatientRefundBreakdownEntity
     */
    public function setIsDeleted($isDeleted)
    {
        $this->isDeleted = $isDeleted;

        return $this;
    }

    /**
     * Get isDeleted
     *
     * @return boolean
     */
    public function getIsDeleted()
    {
        return $this->isDeleted;
    }

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

        return $this;
    }

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

    /**
     * Set patientBillingBreakdown
     *
     * @param \RxConnexionBundle\Entity\PatientBillingBreakdownEntity $patientBillingBreakdown
     *
     * @return PatientRefundBreakdownEntity
     */
    public function setPatientBillingBreakdown(\RxConnexionBundle\Entity\PatientBillingBreakdownEntity $patientBillingBreakdown = null)
    {
        $this->patientBillingBreakdown = $patientBillingBreakdown;

        return $this;
    }

    /**
     * Get patientBillingBreakdown
     *
     * @return \RxConnexionBundle\Entity\PatientBillingBreakdownEntity
     */
    public function getPatientBillingBreakdown()
    {
        return $this->patientBillingBreakdown;
    }

    /**
     * Set patientBillingRefund
     *
     * @param \RxConnexionBundle\Entity\PatientBillingRefundEntity $patientBillingRefund
     *
     * @return PatientRefundBreakdownEntity
     */
    public function setPatientBillingRefund(\RxConnexionBundle\Entity\PatientBillingRefundEntity $patientBillingRefund = null)
    {
        $this->patientBillingRefund = $patientBillingRefund;

        return $this;
    }

    /**
     * Get patientBillingRefund
     *
     * @return \RxConnexionBundle\Entity\PatientBillingRefundEntity
     */
    public function getPatientBillingRefund()
    {
        return $this->patientBillingRefund;
    }
}
