Add customer source when new customer is created via admin panel. #548
This commit is contained in:
parent
3f2467f8f7
commit
20dd3f51df
2 changed files with 24 additions and 0 deletions
20
src/Ramcar/CustomerSource.php
Normal file
20
src/Ramcar/CustomerSource.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace App\Ramcar;
|
||||
|
||||
class CustomerSource extends NameValue
|
||||
{
|
||||
const MOBILE = 'mobile_api';
|
||||
const THIRD_PARTY = 'third_party_api';
|
||||
const WARRANTY = 'warranty';
|
||||
const ADMIN_PANEL = 'admin_panel';
|
||||
const LEGACY = 'legacy';
|
||||
|
||||
const COLLECTION = [
|
||||
'mobile_api' => 'Mobile API',
|
||||
'third_party_api' => 'Third Party API',
|
||||
'warranty' => 'Warranty',
|
||||
'admin_panel' => 'Admin Panel',
|
||||
'legacy' => 'Legacy',
|
||||
];
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@ use App\Ramcar\CustomerClassification;
|
|||
use App\Ramcar\FuelType;
|
||||
use App\Ramcar\VehicleStatusCondition;
|
||||
use App\Ramcar\CrudException;
|
||||
use App\Ramcar\CustomerSource;
|
||||
|
||||
use App\Entity\Customer;
|
||||
use App\Entity\CustomerVehicle;
|
||||
|
|
@ -185,6 +186,9 @@ class ResqCustomerHandler implements CustomerHandlerInterface
|
|||
|
||||
$this->setObject($row, $req);
|
||||
|
||||
// set customer source only when new customer
|
||||
$row->setCreateSource(CustomerSource::ADMIN_PANEL);
|
||||
|
||||
// custom validation for vehicles
|
||||
$vehicles = json_decode($req->request->get('vehicles'));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue