Add insurance body types endpoint #791

This commit is contained in:
Ramon Gutierrez 2024-02-23 16:53:04 +08:00
parent 270a4cfb10
commit 78a43ae85c
2 changed files with 26 additions and 0 deletions

View file

@ -307,4 +307,9 @@ apiv2_insurance_application_create:
apiv2_insurance_premiums_banner:
path: /apiv2/insurance/premiums_banner
controller: App\Controller\CustomerAppAPI\InsuranceController::getPremiumsBanner
methods: [GET]
apiv2_insurance_body_types:
path: /apiv2/insurance/body_types
controller: App\Controller\CustomerAppAPI\InsuranceController::getBodyTypes
methods: [GET]

View file

@ -307,6 +307,27 @@ class InsuranceController extends ApiController
]);
}
public function getBodyTypes(Request $req)
{
// validate params
$validity = $this->validateRequest($req);
if (!$validity['is_valid']) {
return new ApiResponse(false, $validity['error']);
}
// TODO: if this changes often, make an entity and make it manageable on CRM
$body_types = [
'SEDAN' => 'Sedan',
'SUV' => 'SUV',
'TRUCK' => 'Truck',
];
return new ApiResponse(true, '', [
'body_types' => $body_types,
]);
}
protected function getLineType($mv_type_id, $vehicle_use_type, $is_public = false)
{
$line = '';