Draft: Resolve "Customer source changes" #1461

Closed
korina.cordero wants to merge 4 commits from 548-customer-source-changes into master
2 changed files with 24 additions and 0 deletions
Showing only changes of commit 20dd3f51df - Show all commits

View 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',
];
}

View file

@ -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'));