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
|
||||
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
|
||||
#App\Service\GISManager\Bing: ~
|
||||
App\Service\GISManager\OpenStreet: ~
|
||||
|
|
|
|||
|
|
@ -185,6 +185,13 @@ services:
|
|||
# rider assignment interface
|
||||
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
|
||||
#App\Service\GISManager\Bing: ~
|
||||
App\Service\GISManager\OpenStreet: ~
|
||||
|
|
|
|||
|
|
@ -2324,6 +2324,14 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
return $params;
|
||||
}
|
||||
|
||||
public function checkIfNewBattery(JobOrder $jo)
|
||||
{
|
||||
if ($jo->getServiceType() == CMBServiceType::BATTERY_REPLACEMENT_NEW)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function fillDropdownParameters(&$params)
|
||||
{
|
||||
$em = $this->em;
|
||||
|
|
|
|||
|
|
@ -2283,6 +2283,14 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
->setWarrantyExpiration($warr_date);
|
||||
}
|
||||
|
||||
public function checkIfNewBattery(JobOrder $jo)
|
||||
{
|
||||
if ($jo->getServiceType() == ServiceType::BATTERY_REPLACEMENT_NEW)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function fillDropdownParameters(&$params)
|
||||
{
|
||||
$em = $this->em;
|
||||
|
|
|
|||
|
|
@ -95,4 +95,7 @@ interface JobOrderHandlerInterface
|
|||
|
||||
// update customer vehicle battery warranty info
|
||||
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();
|
||||
|
||||
// create warranty
|
||||
if ($jo->getServiceType() == CMBServiceType::BATTERY_REPLACEMENT_NEW)
|
||||
if($this->jo_handler->checkIfNewBattery($jo))
|
||||
{
|
||||
$serial = null;
|
||||
$warranty_class = $jo->getWarrantyClass();
|
||||
|
|
|
|||
Loading…
Reference in a new issue