From d4c3dfadc7fc8b8e388f9ec3b20201da7fa141ef Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Tue, 6 Apr 2021 03:29:49 +0000 Subject: [PATCH] Add new warranty source. #548 --- src/Controller/CAPI/CustomerWarrantyController.php | 2 +- src/Controller/CAPI/WarrantyController.php | 4 +++- src/Ramcar/CustomerSource.php | 14 ++++++++------ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Controller/CAPI/CustomerWarrantyController.php b/src/Controller/CAPI/CustomerWarrantyController.php index 0ebc2c60..cce42ab2 100644 --- a/src/Controller/CAPI/CustomerWarrantyController.php +++ b/src/Controller/CAPI/CustomerWarrantyController.php @@ -420,7 +420,7 @@ class CustomerWarrantyController extends APIController $cust->setFirstName($req->request->get('first_name')) ->setLastName($req->request->get('last_name')) ->setEmail($req->request->get('email')) - ->setCreateSource('web_warranty') + ->setCreateSource(CustomerSource::WEB_WARRANTY) ->setPrivacyPromo($priv_promo) ->setPhoneMobile($req->request->get('contact_num')); diff --git a/src/Controller/CAPI/WarrantyController.php b/src/Controller/CAPI/WarrantyController.php index c444370c..5b9230c3 100644 --- a/src/Controller/CAPI/WarrantyController.php +++ b/src/Controller/CAPI/WarrantyController.php @@ -26,6 +26,7 @@ use App\Ramcar\WarrantyClass; use App\Ramcar\WarrantyStatus; use App\Ramcar\FuelType; use App\Ramcar\VehicleStatusCondition; +use App\Ramcar\CustomerSource; use DateTime; @@ -636,7 +637,8 @@ class WarrantyController extends APIController $new_cust = new Customer(); $new_cust->setFirstName($w_first_name) ->setLastName($w_last_name) - ->setPhoneMobile($w_mobile_num); + ->setPhoneMobile($w_mobile_num) + ->setCreateSource(CustomerSource::APP_WARRANTY); $em->persist($new_cust); diff --git a/src/Ramcar/CustomerSource.php b/src/Ramcar/CustomerSource.php index 9e532654..7f8538aa 100644 --- a/src/Ramcar/CustomerSource.php +++ b/src/Ramcar/CustomerSource.php @@ -4,16 +4,18 @@ 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 MOBILE = 'mobile_api'; + const THIRD_PARTY = 'third_party_api'; + const WEB_WARRANTY = 'web_warranty'; + const APP_WARRANTY = 'app_warranty'; + const ADMIN_PANEL = 'admin_panel'; + const LEGACY = 'legacy'; const COLLECTION = [ 'mobile_api' => 'Mobile API', 'third_party_api' => 'Third Party API', - 'warranty' => 'Warranty', + 'web_warranty' => 'Web Warranty', + 'app_warranty' => 'App Warranty', 'admin_panel' => 'Admin Panel', 'legacy' => 'Legacy', ];