Fix issues found during abnormal scenario testing. #727
This commit is contained in:
parent
987c865620
commit
ff32ee6154
2 changed files with 9 additions and 7 deletions
|
|
@ -23,7 +23,7 @@ class TestInsuranceConnectorCommand extends Command
|
|||
{
|
||||
$this->setName('test:create-insurance-application')
|
||||
->setDescription('Test create insurance application service.')
|
||||
->setHelp('Test the create insuranace application service.');
|
||||
->setHelp('Test the create insurance application service.');
|
||||
}
|
||||
|
||||
public function __construct(InsuranceConnector $insurance, InsuranceDataValidator $ins_validator)
|
||||
|
|
@ -52,7 +52,7 @@ class TestInsuranceConnectorCommand extends Command
|
|||
->setAddressBarangay('Legaspi Village')
|
||||
->setAddressCity('Makati City')
|
||||
->setAddressProvince('Metro Manila')
|
||||
->setZipcode('1200')
|
||||
->setZipcode(1200)
|
||||
->setMobileNumber('09171234567')
|
||||
->setEmailAddress('test.resq@gmail.com');
|
||||
|
||||
|
|
@ -83,5 +83,4 @@ class TestInsuranceConnectorCommand extends Command
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class InsuranceDataValidator
|
|||
}
|
||||
|
||||
// zipcode is required
|
||||
if (empty($client_data->getZipcode()))
|
||||
if ($client_data->getZipcode() == 0)
|
||||
{
|
||||
$error = 'Zipcode is required.';
|
||||
return $error;
|
||||
|
|
@ -141,6 +141,8 @@ class InsuranceDataValidator
|
|||
return $error;
|
||||
}
|
||||
|
||||
// TODO: the insurance api doesn't care if the plate number is valid.
|
||||
// do we still check for valid plate number?
|
||||
// plate number is correct format
|
||||
$is_valid_plate = $this->checkPlateNumber($client_data->getPlateNumber());
|
||||
if (!($is_valid_plate))
|
||||
|
|
@ -180,7 +182,7 @@ class InsuranceDataValidator
|
|||
// motor vehicle type id is required
|
||||
if ($client_data->getMvTypeID() == 0)
|
||||
{
|
||||
$error = 'Motor vehicle type must be set.';
|
||||
$error = 'Motor vehicle type is required.';
|
||||
return $error;
|
||||
}
|
||||
|
||||
|
|
@ -229,7 +231,8 @@ class InsuranceDataValidator
|
|||
}
|
||||
}
|
||||
|
||||
if ($client_data->getLine() == LineType::PUBLIC_MOTORCYCLE)
|
||||
if (($client_data->getLine() == LineType::PUBLIC_MOTORCYCLE) ||
|
||||
($client_data->getLine() == LineType::COMMERCIAL_VEHICLE))
|
||||
{
|
||||
if (!($client_data->isPublic()))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue