Add workaround for battery images in mobile app #107
This commit is contained in:
parent
d7f4f30cc0
commit
1b3c0409df
5 changed files with 21 additions and 1 deletions
2
config/routes/static.yaml
Normal file
2
config/routes/static.yaml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
static_battery_image:
|
||||
path: /battery
|
||||
BIN
public/battery/enduro_mobile.jpg
Normal file
BIN
public/battery/enduro_mobile.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
BIN
public/battery/excel_mobile.jpg
Normal file
BIN
public/battery/excel_mobile.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
public/battery/gold_mobile.jpg
Normal file
BIN
public/battery/gold_mobile.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
|
|
@ -642,6 +642,9 @@ class APIController extends Controller
|
|||
$batts = $vehicle->getBatteries();
|
||||
foreach ($batts as $batt)
|
||||
{
|
||||
// TODO: workaround for now, we get static image of battery based on model name
|
||||
$filename = trim(strtolower($batt->getModel()->getName())) . '_mobile.jpg';
|
||||
$file_path = $req->getSchemeAndHttpHost() . $this->generateUrl('static_battery_image') . '/' . $filename;
|
||||
$batt_list[] = [
|
||||
'id' => $batt->getID(),
|
||||
'mfg_id' => $batt->getManufacturer()->getID(),
|
||||
|
|
@ -653,6 +656,7 @@ class APIController extends Controller
|
|||
'price' => $batt->getSellingPrice(),
|
||||
'wty_private' => $batt->getWarrantyPrivate(),
|
||||
'wty_commercial' => $batt->getWarrantyCommercial(),
|
||||
'image_url' => $file_path,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -1253,6 +1257,20 @@ class APIController extends Controller
|
|||
'status' => $status,
|
||||
];
|
||||
|
||||
// customer vehicle
|
||||
$cv = $jo->getCustomerVehicle();
|
||||
$jo_data['customer_vehicle'] = [
|
||||
'id' => $cv->getID(),
|
||||
'plate_number' => $cv->getPlateNumber(),
|
||||
];
|
||||
|
||||
// rider
|
||||
$rider = $jo->getRider();
|
||||
if ($rider != null)
|
||||
{
|
||||
$jo_data['rider'] = $rider->getFullName();
|
||||
}
|
||||
|
||||
// invoice items
|
||||
$items = [];
|
||||
$jo_items = $jo->getInvoice()->getItems();
|
||||
|
|
@ -1276,7 +1294,7 @@ class APIController extends Controller
|
|||
$jo_data['date_fulfilled'] = $jo->getDateFulfilled()->format('M d, Y');
|
||||
break;
|
||||
case JOStatus::CANCELLED:
|
||||
$jo_data['date_cancelled'] = $jo->getDateCancelled()->format('M d, Y');
|
||||
$jo_data['date_cancelled'] = $jo->getDateCancel()->format('M d, Y');
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue