Add customer classification field
This commit is contained in:
parent
14d702c42b
commit
fa5122235a
2 changed files with 67 additions and 0 deletions
|
|
@ -34,6 +34,13 @@ class Customer
|
|||
*/
|
||||
protected $last_name;
|
||||
|
||||
// customer classification
|
||||
/**
|
||||
* @ORM\Column(type="string", length=80)
|
||||
* @Assert\NotBlank()
|
||||
*/
|
||||
protected $customer_classification;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", length=80)
|
||||
*/
|
||||
|
|
@ -75,12 +82,21 @@ class Customer
|
|||
*/
|
||||
protected $flag_confirmed;
|
||||
|
||||
// if registered on mobile app
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
protected $flag_mobile_app;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->numbers = new ArrayCollection();
|
||||
$this->sessions = new ArrayCollection();
|
||||
$this->vehicles = new ArrayCollection();
|
||||
$this->job_orders = new ArrayCollection();
|
||||
|
||||
$this->flag_confirmed = false;
|
||||
$this->flag_mobile_app = false;
|
||||
}
|
||||
|
||||
public function getID()
|
||||
|
|
@ -110,6 +126,17 @@ class Customer
|
|||
return $this->last_name;
|
||||
}
|
||||
|
||||
public function setCustomerClassification($customer_classification)
|
||||
{
|
||||
$this->customer_classification = $customer_classification;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCustomerClassification()
|
||||
{
|
||||
return $this->customer_classification;
|
||||
}
|
||||
|
||||
public function setCustomerNotes($customer_notes)
|
||||
{
|
||||
$this->customer_notes = $customer_notes;
|
||||
|
|
@ -147,6 +174,15 @@ class Customer
|
|||
return $numbers;
|
||||
}
|
||||
|
||||
public function getPlateNumberList()
|
||||
{
|
||||
$plate_numbers = [];
|
||||
foreach ($this->vehicles as $vehicle)
|
||||
$plate_numbers[] = $vehicle->getPlateNumber();
|
||||
|
||||
return $plate_numbers;
|
||||
}
|
||||
|
||||
public function addMobileSession(MobileSession $session)
|
||||
{
|
||||
$this->sessions->add($session);
|
||||
|
|
@ -192,6 +228,17 @@ class Customer
|
|||
return $this->flag_confirmed;
|
||||
}
|
||||
|
||||
public function setHasMobileApp($flag_mobile_app = true)
|
||||
{
|
||||
$this->flag_mobile_app = $flag_mobile_app;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function hasMobileApp()
|
||||
{
|
||||
return $this->flag_mobile_app;
|
||||
}
|
||||
|
||||
public function getJobOrders()
|
||||
{
|
||||
return $this->job_orders;
|
||||
|
|
|
|||
20
src/Ramcar/CustomerClassification.php
Normal file
20
src/Ramcar/CustomerClassification.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace App\Ramcar;
|
||||
|
||||
class CustomerClassification extends NameValue
|
||||
{
|
||||
const REGULAR = 'regular';
|
||||
const MEDIA = 'media';
|
||||
const VIP = 'vip';
|
||||
const BLACKLISTED = 'blacklisted';
|
||||
const OTHER = 'other';
|
||||
|
||||
const COLLECTION = [
|
||||
'regular' => 'Regular',
|
||||
'media' => 'Media',
|
||||
'vip' => 'VIP',
|
||||
'blacklisted' => 'Blacklisted',
|
||||
'other' => 'Other',
|
||||
];
|
||||
}
|
||||
Loading…
Reference in a new issue