Skip to content

Commit

Permalink
Lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
ok200paul authored and github-actions[bot] committed Nov 29, 2024
1 parent aa765cc commit 2452b52
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function index(): JsonResponse
public function store(): JsonResponse
{
$validationArray = [
'voucher_set_id' => [
'voucher_set_id' => [
'required',
'string',
Rule::exists('voucher_sets', 'id'),
Expand All @@ -169,10 +169,10 @@ public function store(): JsonResponse

$this->responseCode = 400;
$this->message = $validator->errors()
->first();

} else {
->first();

}
else {

try {

Expand All @@ -181,15 +181,15 @@ public function store(): JsonResponse
$voucherSet = VoucherSet::find($voucherSetId);
$voucherSetServiceTeam = Team::find($voucherSet->allocated_to_service_team_id);
$merchantRelationship = TeamMerchantTeam::where('team_id', $voucherSetServiceTeam->id)
->where('merchant_team_id', $merchantTeamId)->first();

->where('merchant_team_id', $merchantTeamId)->first();

/**
* Ensure that the merchant team is a merchant for the service team
*/
if (!$merchantRelationship) {
$this->responseCode = 400;
$this->message = ApiResponse::RESPONSE_INVALID_MERCHANT_TEAM_FOR_SERVICE_TEAM->value;

return $this->respond();
}

Expand Down Expand Up @@ -217,9 +217,8 @@ public function store(): JsonResponse
$this->message = ApiResponse::RESPONSE_SAVED->value;
$this->data = $model;


} catch (Exception $e) {

}
catch (Exception $e) {

$this->responseCode = 500;
$this->message = ApiResponse::RESPONSE_ERROR->value . ': "' . $e->getMessage() . '".';
Expand Down Expand Up @@ -345,7 +344,8 @@ public function destroy(string $id)
$model->delete();
$this->message = ApiResponse::RESPONSE_DELETED->value;

} catch (Exception $e) {
}
catch (Exception $e) {

$this->responseCode = 500;
$this->message = ApiResponse::RESPONSE_ERROR->value . ':' . $e->getMessage();
Expand Down
104 changes: 52 additions & 52 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
->group(function () {

/**
* Countries
*/
* Countries
*/
Route::post('/countries', [ApiCountriesController::class, 'store'])
->name('api.v1.countries.post')
->middleware(
Expand Down Expand Up @@ -100,8 +100,8 @@
);

/**
* My Team
*/
* My Team
*/
Route::get('/my-team', [ApiMyTeamController::class, 'index'])
->name('api.v1.my-team.getMany')
->middleware(
Expand Down Expand Up @@ -153,8 +153,8 @@
);

/**
* My Audit Items
*/
* My Audit Items
*/
Route::post('/my-team-audit-items', [ApiMyTeamAuditItemsController::class, 'store'])
->name('api.v1.my-team-audit-items.post')
->middleware(
Expand Down Expand Up @@ -206,8 +206,8 @@
);

/**
* My Teams
*/
* My Teams
*/
Route::post('/my-teams', [ApiMyTeamsController::class, 'store'])
->name('api.v1.my-teams.post')
->middleware(
Expand Down Expand Up @@ -258,8 +258,8 @@
);

/**
* My Search
*/
* My Search
*/
Route::post('/my-team-search', [ApiMyTeamSearchController::class, 'store'])
->name('api.v1.my-team-search.post')
->middleware(
Expand Down Expand Up @@ -311,8 +311,8 @@
);

/**
* My Voucher Sets
*/
* My Voucher Sets
*/
Route::post('/my-team-voucher-sets', [ApiMyTeamVoucherSetsController::class, 'store'])
->name('api.v1.my-team-voucher-sets.post')
->middleware(
Expand Down Expand Up @@ -364,8 +364,8 @@
);

/**
* My Team Vouchers (created by or allocated to my team)
*/
* My Team Vouchers (created by or allocated to my team)
*/
Route::post('/my-team-vouchers', [ApiMyTeamVouchersController::class, 'store'])
->name('api.v1.my-team-vouchers.post')
->middleware(
Expand Down Expand Up @@ -417,8 +417,8 @@
);

/**
* My Team Voucher Sets (created by my team)
*/
* My Team Voucher Sets (created by my team)
*/
Route::post('/my-team-voucher-sets-created', [ApiMyTeamVoucherSetsCreatedController::class, 'store'])
->name('api.v1.my-team-voucher-sets-created.post')
->middleware(
Expand Down Expand Up @@ -470,8 +470,8 @@
);

/**
* My Team Voucher Sets (allocated to my team)
*/
* My Team Voucher Sets (allocated to my team)
*/
Route::post('/my-team-voucher-sets-allocated', [ApiMyTeamVoucherSetsAllocatedController::class, 'store'])
->name('api.v1.my-team-voucher-sets-allocated.post')
->middleware(
Expand Down Expand Up @@ -523,8 +523,8 @@
);

/**
* Voucher Validation (for unattended redemptions)
*/
* Voucher Validation (for unattended redemptions)
*/
Route::middleware('throttle:validations')->group(function () {

Route::post('/voucher-validation', [ApiVoucherValidationController::class, 'store'])
Expand All @@ -545,8 +545,8 @@
});

/**
* Voucher Beneficiary Distributions
*/
* Voucher Beneficiary Distributions
*/
Route::post('/voucher-beneficiary-distributions', [ApiVoucherBeneficiaryDistributionController::class, 'store'])
->name('api.v1.voucher-beneficiary-distributions.post')
->middleware(
Expand Down Expand Up @@ -598,8 +598,8 @@
);

/**
* Voucher Redemptions
*/
* Voucher Redemptions
*/
Route::post('/voucher-redemptions', [ApiVoucherRedemptionsController::class, 'store'])
->name('api.v1.voucher-redemptions.post')
->middleware(
Expand Down Expand Up @@ -651,8 +651,8 @@
);

/**
* Voucher set merchant team approval request
*/
* Voucher set merchant team approval request
*/
Route::get('/my-team-vsmtar', [ApiMyTeamVSMTARController::class, 'index'])
->name('api.v1.my-team-vsmtar.getMany')
->middleware(
Expand Down Expand Up @@ -704,8 +704,8 @@
);

/**
* Shops
*/
* Shops
*/
Route::post('/shops', [ApiShopsController::class, 'store'])
->name('api.v1.shops.post')
->middleware(
Expand Down Expand Up @@ -757,8 +757,8 @@
);

/**
* System Statistics
*/
* System Statistics
*/
Route::post('/system-statistics', [ApiSystemStatisticsController::class, 'store'])
->name('api.v1.system-statistics.post')
->middleware(
Expand Down Expand Up @@ -810,8 +810,8 @@
);

/**
* Admin Api Routes
*/
* Admin Api Routes
*/
Route::prefix('admin')
->middleware(['auth:sanctum', CheckAdminStatus::class])
->group(function () {
Expand Down Expand Up @@ -877,8 +877,8 @@
)->names('api.v1.admin.team-voucher-templates');

/**
* User
*/
* User
*/
Route::post('/users', [ApiAdminUsersController::class, 'store'])
->name('api.v1.admin.users.post');

Expand All @@ -895,8 +895,8 @@
->name('api.v1.admin.users.delete');

/**
* Vouchers
*/
* Vouchers
*/
Route::post('/vouchers', [ApiAdminVouchersController::class, 'store'])
->name('api.v1.admin-vouchers.post');

Expand All @@ -913,8 +913,8 @@
->name('api.v1.admin-vouchers.delete');

/**
* Voucher Sets
*/
* Voucher Sets
*/
Route::post('/voucher-sets', [ApiAdminVoucherSetsController::class, 'store'])
->name('api.v1.admin-voucher-sets.post');

Expand All @@ -938,8 +938,8 @@
});

/**
* Voucher Redemptions
*/
* Voucher Redemptions
*/
Route::post('/voucher-redemptions', [ApiVoucherRedemptionsController::class, 'store'])
->name('api.v1.voucher-redemptions.post')
->middleware(
Expand Down Expand Up @@ -991,8 +991,8 @@
);

/**
* Shops
*/
* Shops
*/
Route::post('/shops', [ApiShopsController::class, 'store'])
->name('api.v1.shops.post')
->middleware(
Expand Down Expand Up @@ -1044,8 +1044,8 @@
);

/**
* System Statistics
*/
* System Statistics
*/
Route::post('/system-statistics', [ApiSystemStatisticsController::class, 'store'])
->name('api.v1.system-statistics.post')
->middleware(
Expand Down Expand Up @@ -1097,8 +1097,8 @@
);

/**
* Admin Api Routes
*/
* Admin Api Routes
*/
Route::prefix('admin')
->middleware(['auth:sanctum', CheckAdminStatus::class])
->group(function () {
Expand Down Expand Up @@ -1164,8 +1164,8 @@
)->names('api.v1.admin.team-voucher-templates');

/**
* Vouchers
*/
* Vouchers
*/
Route::post('/vouchers', [ApiAdminVouchersController::class, 'store'])
->name('api.v1.admin-vouchers.post');

Expand All @@ -1182,8 +1182,8 @@
->name('api.v1.admin-vouchers.delete');

/**
* Voucher Sets
*/
* Voucher Sets
*/
Route::post('/voucher-sets', [ApiAdminVoucherSetsController::class, 'store'])
->name('api.v1.admin-voucher-sets.post');

Expand All @@ -1200,8 +1200,8 @@
->name('api.v1.admin-voucher-sets.delete');

/**
* Voucher Set Merchant Teams
*/
* Voucher Set Merchant Teams
*/
Route::post('/voucher-set-merchant-teams', [ApiAdminVoucherSetMerchantTeamsController::class, 'store'])
->name('api.v1.admin-voucher-set-mt.post');

Expand Down

0 comments on commit 2452b52

Please sign in to comment.