Add checkIfNewBattery function to job order service. Add RiderAPIHandler to the respective services.yaml. #336
This commit is contained in:
parent
23253a1e65
commit
f0212cc6d4
6 changed files with 35 additions and 1 deletions
|
|
@ -185,6 +185,14 @@ services:
|
||||||
# rider assignment interface
|
# rider assignment interface
|
||||||
App\Service\RiderAssignmentHandlerInterface: "@App\\Service\\RiderAssignmentHandler\\CMBRiderAssignmentHandler"
|
App\Service\RiderAssignmentHandlerInterface: "@App\\Service\\RiderAssignmentHandler\\CMBRiderAssignmentHandler"
|
||||||
|
|
||||||
|
# rider API service
|
||||||
|
App\Service\RiderAPIHandler\CMBRiderAPIHandler:
|
||||||
|
arguments:
|
||||||
|
$country_code: "%env(COUNTRY_CODE)%"
|
||||||
|
|
||||||
|
# rider API interface
|
||||||
|
App\Service\RiderAPIHandlerInterface: "@App\\Service\\RiderAPIHandler\\CMBRiderAPIHandler"
|
||||||
|
|
||||||
# map manager
|
# map manager
|
||||||
#App\Service\GISManager\Bing: ~
|
#App\Service\GISManager\Bing: ~
|
||||||
App\Service\GISManager\OpenStreet: ~
|
App\Service\GISManager\OpenStreet: ~
|
||||||
|
|
|
||||||
|
|
@ -185,6 +185,13 @@ services:
|
||||||
# rider assignment interface
|
# rider assignment interface
|
||||||
App\Service\RiderAssignmentHandlerInterface: "@App\\Service\\RiderAssignmentHandler\\ResqRiderAssignmentHandler"
|
App\Service\RiderAssignmentHandlerInterface: "@App\\Service\\RiderAssignmentHandler\\ResqRiderAssignmentHandler"
|
||||||
|
|
||||||
|
# rider API service
|
||||||
|
App\Service\RiderAPIHandler\ResqRiderAPIHandler:
|
||||||
|
arguments:
|
||||||
|
$country_code: "%env(COUNTRY_CODE)%"
|
||||||
|
|
||||||
|
App\Service\RiderAPIHandlerInterface: "@App\\Service\\RiderAPIHandler\\ResqRiderAPIHandler"
|
||||||
|
|
||||||
# map manager
|
# map manager
|
||||||
#App\Service\GISManager\Bing: ~
|
#App\Service\GISManager\Bing: ~
|
||||||
App\Service\GISManager\OpenStreet: ~
|
App\Service\GISManager\OpenStreet: ~
|
||||||
|
|
|
||||||
|
|
@ -2324,6 +2324,14 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
||||||
return $params;
|
return $params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function checkIfNewBattery(JobOrder $jo)
|
||||||
|
{
|
||||||
|
if ($jo->getServiceType() == CMBServiceType::BATTERY_REPLACEMENT_NEW)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
protected function fillDropdownParameters(&$params)
|
protected function fillDropdownParameters(&$params)
|
||||||
{
|
{
|
||||||
$em = $this->em;
|
$em = $this->em;
|
||||||
|
|
|
||||||
|
|
@ -2283,6 +2283,14 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
->setWarrantyExpiration($warr_date);
|
->setWarrantyExpiration($warr_date);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function checkIfNewBattery(JobOrder $jo)
|
||||||
|
{
|
||||||
|
if ($jo->getServiceType() == ServiceType::BATTERY_REPLACEMENT_NEW)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
protected function fillDropdownParameters(&$params)
|
protected function fillDropdownParameters(&$params)
|
||||||
{
|
{
|
||||||
$em = $this->em;
|
$em = $this->em;
|
||||||
|
|
|
||||||
|
|
@ -95,4 +95,7 @@ interface JobOrderHandlerInterface
|
||||||
|
|
||||||
// update customer vehicle battery warranty info
|
// update customer vehicle battery warranty info
|
||||||
public function updateVehicleBattery(JobOrder $jo);
|
public function updateVehicleBattery(JobOrder $jo);
|
||||||
|
|
||||||
|
// check if service type is new battery
|
||||||
|
public function checkIfNewBattery(JobOrder $jo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -524,7 +524,7 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
|
|
||||||
// create warranty
|
// create warranty
|
||||||
if ($jo->getServiceType() == CMBServiceType::BATTERY_REPLACEMENT_NEW)
|
if($this->jo_handler->checkIfNewBattery($jo))
|
||||||
{
|
{
|
||||||
$serial = null;
|
$serial = null;
|
||||||
$warranty_class = $jo->getWarrantyClass();
|
$warranty_class = $jo->getWarrantyClass();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue