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')
|
$this->setName('test:create-insurance-application')
|
||||||
->setDescription('Test create insurance application service.')
|
->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)
|
public function __construct(InsuranceConnector $insurance, InsuranceDataValidator $ins_validator)
|
||||||
|
|
@ -52,7 +52,7 @@ class TestInsuranceConnectorCommand extends Command
|
||||||
->setAddressBarangay('Legaspi Village')
|
->setAddressBarangay('Legaspi Village')
|
||||||
->setAddressCity('Makati City')
|
->setAddressCity('Makati City')
|
||||||
->setAddressProvince('Metro Manila')
|
->setAddressProvince('Metro Manila')
|
||||||
->setZipcode('1200')
|
->setZipcode(1200)
|
||||||
->setMobileNumber('09171234567')
|
->setMobileNumber('09171234567')
|
||||||
->setEmailAddress('test.resq@gmail.com');
|
->setEmailAddress('test.resq@gmail.com');
|
||||||
|
|
||||||
|
|
@ -83,5 +83,4 @@ class TestInsuranceConnectorCommand extends Command
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ class InsuranceDataValidator
|
||||||
}
|
}
|
||||||
|
|
||||||
// zipcode is required
|
// zipcode is required
|
||||||
if (empty($client_data->getZipcode()))
|
if ($client_data->getZipcode() == 0)
|
||||||
{
|
{
|
||||||
$error = 'Zipcode is required.';
|
$error = 'Zipcode is required.';
|
||||||
return $error;
|
return $error;
|
||||||
|
|
@ -141,6 +141,8 @@ class InsuranceDataValidator
|
||||||
return $error;
|
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
|
// plate number is correct format
|
||||||
$is_valid_plate = $this->checkPlateNumber($client_data->getPlateNumber());
|
$is_valid_plate = $this->checkPlateNumber($client_data->getPlateNumber());
|
||||||
if (!($is_valid_plate))
|
if (!($is_valid_plate))
|
||||||
|
|
@ -180,7 +182,7 @@ class InsuranceDataValidator
|
||||||
// motor vehicle type id is required
|
// motor vehicle type id is required
|
||||||
if ($client_data->getMvTypeID() == 0)
|
if ($client_data->getMvTypeID() == 0)
|
||||||
{
|
{
|
||||||
$error = 'Motor vehicle type must be set.';
|
$error = 'Motor vehicle type is required.';
|
||||||
return $error;
|
return $error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -220,7 +222,7 @@ class InsuranceDataValidator
|
||||||
// check line type and flag_public combination
|
// check line type and flag_public combination
|
||||||
// if line type is MCOC/private motorcycle, flag_public should be false
|
// if line type is MCOC/private motorcycle, flag_public should be false
|
||||||
// if line type is LCOC/public motorcycle, flag_public should be true
|
// if line type is LCOC/public motorcycle, flag_public should be true
|
||||||
if ($client_data->getLine() == LineType::PRIVATE_MOTORCYCLE)
|
if ($client_data->getLine() == LineType::PRIVATE_MOTORCYCLE)
|
||||||
{
|
{
|
||||||
if ($client_data->isPublic())
|
if ($client_data->isPublic())
|
||||||
{
|
{
|
||||||
|
|
@ -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()))
|
if (!($client_data->isPublic()))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue