resq/src/Entity/InsuranceApplication.php
2023-10-11 17:06:37 +08:00

226 lines
4.6 KiB
PHP

<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
use DateTime;
/**
* @ORM\Entity
* @ORM\Table(name="insurance_application")
*/
class InsuranceApplication
{
// unique id
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
// link to customer
/**
* @ORM\ManyToOne(targetEntity="Customer")
* @ORM\JoinColumn(name="customer_id", referencedColumnName="id")
*/
protected $customer;
// link to customer vehicle
/**
* @ORM\ManyToOne(targetEntity="CustomerVehicle", inversedBy="insurance")
* @ORM\JoinColumn(name="customer_vehicle_id", referencedColumnName="id")
* @Assert\NotBlank()
*/
protected $customer_vehicle;
// gateway transaction
/**
* @ORM\OneToOne(targetEntity="GatewayTransaction")
* @ORM\JoinColumn(name="gateway_transaction_id", referencedColumnName="id")
*/
protected $gateway_transaction;
// status
/**
* @ORM\Column(type="string", length=32)
*/
protected $status;
// URL of COC
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $coc_url;
// date the application was submitted
/**
* @ORM\Column(type="datetime")
*/
protected $date_submit;
// date the application was paid
/**
* @ORM\Column(type="datetime", nullable=true)
*/
protected $date_pay;
// date the application was marked as completed by the insurance api
/**
* @ORM\Column(type="datetime", nullable=true)
*/
protected $date_complete;
// date the application is set to expire
/**
* @ORM\Column(type="datetime", nullable=true)
*/
protected $date_expire;
// external transaction id
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $ext_transaction_id;
// form data when submitting the application
/**
* @ORM\Column(type="json")
*/
protected $metadata;
public function __construct()
{
$this->date_submit = new DateTime();
$this->date_pay = null;
$this->date_complete = null;
$this->date_expire = null;
$this->metadata = [];
}
public function getID()
{
return $this->id;
}
public function setCustomer(Customer $cust = null)
{
$this->customer = $cust;
return $this;
}
public function getCustomer()
{
return $this->customer;
}
public function setCustomerVehicle(CustomerVehicle $cv = null)
{
$this->customer_vehicle = $cv;
return $this;
}
public function getCustomerVehicle()
{
return $this->customer_vehicle;
}
public function setDateSubmit(DateTime $date)
{
$this->date_submit = $date;
return $this;
}
public function getDateSubmit()
{
return $this->date_submit;
}
public function setGatewayTransaction(GatewayTransaction $transaction)
{
$this->gateway_transaction = $transaction;
return $this;
}
public function getGatewayTransaction()
{
return $this->gateway_transaction;
}
public function setStatus($status)
{
return $this->status = $status;
}
public function getStatus()
{
return $this->status;
}
public function setCOC($url)
{
return $this->coc_url = $url;
}
public function getCOC()
{
return $this->coc_url;
}
public function setDatePay(DateTime $date)
{
$this->date_pay = $date;
return $this;
}
public function getDatePay()
{
return $this->date_pay;
}
public function setDateComplete(DateTime $date)
{
$this->date_complete = $date;
return $this;
}
public function getDateComplete()
{
return $this->date_complete;
}
public function setDateExpire(DateTime $date)
{
$this->date_expire = $date;
return $this;
}
public function getDateExpire()
{
return $this->date_expire;
}
public function setExtTransactionId($transaction_id)
{
$this->ext_transaction_id = $transaction_id;
return $this;
}
public function getExtTransactionId()
{
return $this->ext_transaction_id;
}
public function setMetadata($metadata)
{
return $this->metadata = $metadata;
}
public function getMetadata()
{
return $this->metadata;
}
}