Resolve "Aggregate Rider Rating" #1689

Open
korina.cordero wants to merge 92 commits from 764-aggregate-rider-rating into 746-resq-2-0-final
2 changed files with 29 additions and 15 deletions
Showing only changes of commit a59aa0f66d - Show all commits

View file

@ -18,6 +18,7 @@ use App\Ramcar\InsuranceApplicationStatus;
use App\Ramcar\InsuranceMVType; use App\Ramcar\InsuranceMVType;
use App\Ramcar\InsuranceClientType; use App\Ramcar\InsuranceClientType;
use App\Ramcar\TransactionStatus; use App\Ramcar\TransactionStatus;
use App\Ramcar\InsuranceBodyType;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use DateTime; use DateTime;
@ -316,21 +317,16 @@ class InsuranceController extends ApiController
return new ApiResponse(false, $validity['error']); return new ApiResponse(false, $validity['error']);
} }
// TODO: if this changes often, make an entity and make it manageable on CRM $bt_collection = InsuranceBodyType::getCollection();
$body_types = [ $body_types = [];
[
'id' => 'SEDAN', // NOTE: formatting it this way to match how insurance third party API returns their own stuff, so it's all handled one way on the app
'name' => 'Sedan', foreach ($bt_collection as $bt_key => $bt_name) {
], $body_types[] = [
[ 'id' => $bt_key,
'id' => 'SUV', 'name' => $bt_name,
'name' => 'SUV', ];
], }
[
'id' => 'TRUCK',
'name' => 'Truck',
]
];
return new ApiResponse(true, '', [ return new ApiResponse(true, '', [
'body_types' => $body_types, 'body_types' => $body_types,

View file

@ -0,0 +1,18 @@
<?php
namespace App\Ramcar;
class InsuranceBodyType extends NameValue
{
const SEDAN = 'sedan';
const SUV = 'suv';
const TRUCK = 'truck';
const MOTORCYCLE = 'motorcycle';
const COLLECTION = [
'SEDAN' => 'Sedan',
'SUV' => 'SUV',
'TRUCK' => 'Truck',
'MOTORCYCLE' => 'Motorcycle',
];
}