CHANGE_FUELTYPE_POST_PROCESS
This commit is contained in:
parent
61115e0a5d
commit
92351d3123
@ -532,14 +532,24 @@ class PolicyController extends ResourceController
|
|||||||
$data = $readDoc['data'];
|
$data = $readDoc['data'];
|
||||||
|
|
||||||
$vehicleType = $data['vehicle']['vehicle_type'] ?? null;
|
$vehicleType = $data['vehicle']['vehicle_type'] ?? null;
|
||||||
|
$fuelType = $data['vehicle']['fuel_type'] ?? null;
|
||||||
if($vehicleType !== null)
|
if($vehicleType !== null)
|
||||||
{
|
{
|
||||||
$vehicleType = $this->resolveVehicleTypeTier1($vehicleType);
|
$vehicleType = $this->postProcessGeminiData($vehicleType,$this->tier1VehicleTypeMap);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$vehicleType = 'UN_IDEN_DOC';
|
$vehicleType = 'UN_IDEN_DOC';
|
||||||
}
|
}
|
||||||
|
if($fuelType !== null)
|
||||||
|
{
|
||||||
|
$fuelType = $this->postProcessGeminiData($fuelType,$this->fuelType);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$fuelType = 'UN_IDEN_DOC';
|
||||||
|
}
|
||||||
|
|
||||||
//update data in to policy table
|
//update data in to policy table
|
||||||
$policyData['policy_number'] = $data['policy']['policy_number'] ?? null;
|
$policyData['policy_number'] = $data['policy']['policy_number'] ?? null;
|
||||||
$policyData['issued_date'] = $data['policy']['issue_date'] ?? null;
|
$policyData['issued_date'] = $data['policy']['issue_date'] ?? null;
|
||||||
@ -556,7 +566,7 @@ class PolicyController extends ResourceController
|
|||||||
$policyData['rto_state_code'] = $data['vehicle']['rto_state_code'] ?? null;
|
$policyData['rto_state_code'] = $data['vehicle']['rto_state_code'] ?? null;
|
||||||
$policyData['rto_city_code'] = $data['vehicle']['rto_city_code'] ?? null;
|
$policyData['rto_city_code'] = $data['vehicle']['rto_city_code'] ?? null;
|
||||||
$policyData['weight'] = $data['vehicle']['weight'] ?? null;
|
$policyData['weight'] = $data['vehicle']['weight'] ?? null;
|
||||||
$policyData['fuel_type'] = $data['vehicle']['fuel_type'] ?? null;
|
$policyData['fuel_type'] = $fuelType;
|
||||||
$policyData['date_of_registration'] = $data['vehicle']['date_of_registration'] ?? null;
|
$policyData['date_of_registration'] = $data['vehicle']['date_of_registration'] ?? null;
|
||||||
$policyData['year_of_manufacture'] = $data['vehicle']['year_of_manufacture'] ?? null;
|
$policyData['year_of_manufacture'] = $data['vehicle']['year_of_manufacture'] ?? null;
|
||||||
$policyData['engine_no'] = $data['vehicle']['engine_no'] ?? null;
|
$policyData['engine_no'] = $data['vehicle']['engine_no'] ?? null;
|
||||||
@ -1016,13 +1026,13 @@ class PolicyController extends ResourceController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function resolveVehicleTypeTier1(string $incoming)
|
public function postProcessGeminiData(string $incoming, array $masterArray): string
|
||||||
{
|
{
|
||||||
|
|
||||||
$value = strtolower(trim($incoming));
|
$value = strtolower(trim($incoming));
|
||||||
$value = preg_replace('/\s+/', ' ', $value); // normalize spaces
|
$value = preg_replace('/\s+/', ' ', $value); // normalize spaces
|
||||||
|
|
||||||
return $this->phraseMap[$value] ?? 'UN_IDEN_TYPE';
|
return $masterArray[$value] ?? 'UN_IDEN_TYPE';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function calculateCommissionRequest()
|
public function calculateCommissionRequest()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user