Rename validateRequest to validateJORequest. Modify required parameters for getEstimate. #686
This commit is contained in:
parent
ce6b1f8049
commit
7985ec8f34
1 changed files with 6 additions and 18 deletions
|
|
@ -412,23 +412,11 @@ class JobOrderController extends APIController
|
||||||
// check required parameters and api key
|
// check required parameters and api key
|
||||||
$required_params = [
|
$required_params = [
|
||||||
'service_type',
|
'service_type',
|
||||||
'cv_id',
|
'vehicle_id',
|
||||||
// 'batt_id',
|
|
||||||
'trade_in',
|
|
||||||
];
|
];
|
||||||
$res = $this->checkParamsAndKey($req, $em, $required_params);
|
$msg = $this->checkRequiredParameters($req, $required_params);
|
||||||
if ($res->isError())
|
if ($msg)
|
||||||
return $res->getReturnResponse();
|
return new APIResponse(false, $msg);
|
||||||
|
|
||||||
// customer
|
|
||||||
// TODO: needs to be modified to get customer
|
|
||||||
$cust = $this->session->getCustomer();
|
|
||||||
if ($cust == null)
|
|
||||||
{
|
|
||||||
$res->setError(true)
|
|
||||||
->setErrorMessage('No customer information found');
|
|
||||||
return $res->getReturnResponse();
|
|
||||||
}
|
|
||||||
|
|
||||||
// make invoice criteria
|
// make invoice criteria
|
||||||
$icrit = new InvoiceCriteria();
|
$icrit = new InvoiceCriteria();
|
||||||
|
|
@ -1483,7 +1471,7 @@ class JobOrderController extends APIController
|
||||||
|
|
||||||
protected function getJobOrderRequestInfo(Request $req, EntityManagerInterface $em, &$data)
|
protected function getJobOrderRequestInfo(Request $req, EntityManagerInterface $em, &$data)
|
||||||
{
|
{
|
||||||
$error = $this->validateRequest($req, $em);
|
$error = $this->validateJORequest($req, $em);
|
||||||
if ($error != null)
|
if ($error != null)
|
||||||
{
|
{
|
||||||
// there is a validation error
|
// there is a validation error
|
||||||
|
|
@ -1620,7 +1608,7 @@ class JobOrderController extends APIController
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function validateRequest(Request $req, EntityManagerInterface $em)
|
protected function validateJORequest(Request $req, EntityManagerInterface $em)
|
||||||
{
|
{
|
||||||
$r = $req->request;
|
$r = $req->request;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue