diff --git a/app/Controllers/RuleImportController.php b/app/Controllers/RuleImportController.php index 1fc562b9..d1647bae 100644 --- a/app/Controllers/RuleImportController.php +++ b/app/Controllers/RuleImportController.php @@ -37,6 +37,7 @@ class RuleImportController extends AdminController 'motor' => [ 'department', 'vehicle_type', + 'vehicle_sub_type', 'policy_type', 'vehicle_age', 'is_new_vehicle', diff --git a/app/Libraries/RuleImportService.php b/app/Libraries/RuleImportService.php index cebc2e9f..33fdab3d 100644 --- a/app/Libraries/RuleImportService.php +++ b/app/Libraries/RuleImportService.php @@ -1111,31 +1111,31 @@ class RuleImportService if ($weightMin !== '' && $weightMax !== '') { if ($weightMin === $weightMax) { $conditions[] = [ - 'field' => 'vehicle_weight', + 'field' => 'weight', 'operator' => '==', 'value' => (float)$weightMin ]; } else { $conditions[] = [ - 'field' => 'vehicle_weight', + 'field' => 'weight', 'operator' => '>=', 'value' => (float)$weightMin ]; $conditions[] = [ - 'field' => 'vehicle_weight', + 'field' => 'weight', 'operator' => '<=', 'value' => (float)$weightMax ]; } } elseif ($weightMin !== '') { $conditions[] = [ - 'field' => 'vehicle_weight', + 'field' => 'weight', 'operator' => '>=', 'value' => (float)$weightMin ]; } elseif ($weightMax !== '') { $conditions[] = [ - 'field' => 'vehicle_weight', + 'field' => 'weight', 'operator' => '<=', 'value' => (float)$weightMax ]; @@ -1147,13 +1147,13 @@ class RuleImportService if (count($states) > 1) { $conditions[] = [ - 'field' => 'rto_state', + 'field' => 'geo_rto_state', 'operator' => 'in', 'value' => $states ]; } else { $conditions[] = [ - 'field' => 'rto_state', + 'field' => 'geo_rto_state', 'operator' => '==', 'value' => $states[0] ]; @@ -1166,13 +1166,13 @@ class RuleImportService if (count($cities) > 1) { $conditions[] = [ - 'field' => 'rto_city', + 'field' => 'geo_rto_city', 'operator' => 'in', 'value' => $cities ]; } else { $conditions[] = [ - 'field' => 'rto_city', + 'field' => 'geo_rto_city', 'operator' => '==', 'value' => $cities[0] ]; @@ -1191,7 +1191,7 @@ class RuleImportService // Policy Name if (!empty($rowData[self::COL_POLICY_NAME])) { $conditions[] = [ - 'field' => 'policy_name', + 'field' => 'product', 'operator' => '==', 'value' => $this->sanitize($rowData[self::COL_POLICY_NAME]) ];