Merge branch '791-support-for-insurance-premiums-banner' of gitlab.com:jankstudio/resq into 780-regional-pricing

This commit is contained in:
Korina Cordero 2024-02-23 04:01:58 -05:00
commit 34adefb798
2 changed files with 26 additions and 0 deletions

View file

@ -308,3 +308,8 @@ apiv2_insurance_premiums_banner:
path: /apiv2/insurance/premiums_banner path: /apiv2/insurance/premiums_banner
controller: App\Controller\CustomerAppAPI\InsuranceController::getPremiumsBanner controller: App\Controller\CustomerAppAPI\InsuranceController::getPremiumsBanner
methods: [GET] 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) protected function getLineType($mv_type_id, $vehicle_use_type, $is_public = false)
{ {
$line = ''; $line = '';