diff --git a/catalyst/api-bundle/Command/TestAPICommand.php b/catalyst/api-bundle/Command/TestAPICommand.php index d32097fe..71497c70 100644 --- a/catalyst/api-bundle/Command/TestAPICommand.php +++ b/catalyst/api-bundle/Command/TestAPICommand.php @@ -55,14 +55,20 @@ class TestAPICommand extends Command 'last_name' => 'Last', 'mobile_number' => '12345678910', ]; - $api->post('/capi/warranties', $params); + //$api->post('/capi/warranties', $params); // get all warranties - $api->get('/capi/warranties'); + $params = [ + 'order' => 'DESC', + 'limit' => '5', + 'start' => '1', + ]; + + $api->get('/capi/warranties', $params); // warranty find - $api->get('/capi/warranties/' . $serial); + //$api->get('/capi/warranties/' . $serial); // warranty update $id = 86811; @@ -77,7 +83,7 @@ class TestAPICommand extends Command 'last_name' => 'Last', 'mobile_number' => '123456789111', ]; - $api->post('/capi/warranties/'. $id, $params); + //$api->post('/capi/warranties/'. $id, $params); // warranty set privacy policy $id = 86811; @@ -85,7 +91,7 @@ class TestAPICommand extends Command $params = [ 'privacy_policy_id' => $policy_id, ]; - $api->post('/capi/warranties/' . $id .'/privacypolicy', $params); + //$api->post('/capi/warranties/' . $id .'/privacypolicy', $params); // warranty claim $id = 86811; @@ -93,27 +99,27 @@ class TestAPICommand extends Command $params = [ 'serial' => $serial, ]; - $api->post('/capi/warranties/' . $id . '/claim', $params); + //$api->post('/capi/warranties/' . $id . '/claim', $params); // warranty cancel $id = 86811; - $api->get('/capi/warranties/' . $id . '/cancel'); + //$api->get('/capi/warranties/' . $id . '/cancel'); // plate warranty - $api->get('/capi/plates/' . $plate_num . '/warranties'); + //$api->get('/capi/plates/' . $plate_num . '/warranties'); // warranty delete $id = 86811; - $api->post('/capi/warranties/' . $id . '/delete'); + //$api->post('/capi/warranties/' . $id . '/delete'); // battery - $api->get('/capi/battery_brands'); - $api->get('/capi/battery_sizes'); - $api->get('/capi/batteries'); + //$api->get('/capi/battery_brands'); + //$api->get('/capi/battery_sizes'); + //$api->get('/capi/batteries'); // vehicle - $api->get('/capi/vehicle_manufacturers'); - $api->get('/capi/vehicles'); + //$api->get('/capi/vehicle_manufacturers'); + //$api->get('/capi/vehicles'); // privacy policy $privacy_policy_id = 2; diff --git a/src/Controller/WarrantyController.php b/src/Controller/WarrantyController.php index 2adf0abb..1d23bc9b 100644 --- a/src/Controller/WarrantyController.php +++ b/src/Controller/WarrantyController.php @@ -603,7 +603,8 @@ class WarrantyController extends Controller } } else - { + { + // what if serial exists but plate number is different? // new warranty $warranty = new Warranty();