Resolve "Aggregate Rider Rating" #1689

Open
korina.cordero wants to merge 92 commits from 764-aggregate-rider-rating into 746-resq-2-0-final
Showing only changes of commit 86744afde3 - Show all commits

View file

@ -804,6 +804,15 @@ class RiderAppController extends ApiController
if (!empty($msg))
return new APIResponse(false, $msg);
// need to check if service type is battery sales
// if so, serial is a required parameter
$serial = $req->request->get('serial', '');
if ($jo->getServiceType() == ServiceType::BATTERY_REPLACEMENT_NEW)
{
if (empty($serial))
return new APIResponse(false, 'Missing parameter(s): serial');
}
// set invoice to paid
$jo->getInvoice()->setStatus(InvoiceStatus::PAID);
@ -855,7 +864,6 @@ class RiderAppController extends ApiController
// create warranty
if($jo_handler->checkIfNewBattery($jo))
{
$serial = null;
$warranty_class = $jo->getWarrantyClass();
$first_name = $jo->getCustomer()->getFirstName();
$last_name = $jo->getCustomer()->getLastName();