Modify name of stype_id parameter to service_type for clarity. #421

This commit is contained in:
Korina Cordero 2020-06-05 09:52:23 +00:00
parent 760fa7acf3
commit 8f108c18cb

View file

@ -978,17 +978,17 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface
$this->debugRequest($req);
// allow rider to change service, promo, battery and trade-in options
$required_params = ['jo_id', 'stype_id', 'promo_id'];
$required_params = ['jo_id', 'service_type', 'promo_id'];
$data = $this->checkJO($req, $required_params, $jo);
if (isset($data['error']))
return $data;
// check service type
$stype_id = $req->request->get('stype_id');
if (!ServiceType::validate($stype_id))
$service_type = $req->request->get('service_type');
if (!ServiceType::validate($service_type))
{
$data = [
'error' => 'Invalid service type - ' . $stype_id
'error' => 'Invalid service type - ' . $service_type
];
return $data;
}
@ -1061,7 +1061,7 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface
// generate new invoice
$crit = new InvoiceCriteria();
$crit->setServiceType($stype_id);
$crit->setServiceType($service_type);
$crit->setCustomerVehicle($cv);
$crit->setHasCoolant($jo->hasCoolant());
@ -1082,7 +1082,7 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface
$this->em->flush();
// save job order
$jo->setServiceType($stype_id);
$jo->setServiceType($service_type);
// save invoice
$jo->setInvoice($invoice);