- Added new section in AGENTS.md detailing learned workspace facts for better understanding of settlement processes. - Updated AgentNodeDestroyController to remove unnecessary checks for admin users. - Enhanced AgentSettlement controllers to assert permissions for finance adjustments and bill operations. - Improved query scopes in AgentSettlement services to ensure proper data access based on admin roles. - Refactored methods in SettlementPartyEnrichment for better bill row enrichment and data handling. - Introduced new methods in AdminAgentSettlementScope for managing agent node visibility and finance adjustments.
29 lines
916 B
PHP
29 lines
916 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Api\V1\Admin\AgentSettlement;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Services\AgentSettlement\SettlementPeriodOpenHintsService;
|
|
use App\Support\AdminAgentSettlementScope;
|
|
use App\Support\ApiResponse;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\Request;
|
|
|
|
/** GET /api/v1/admin/settlement-periods/open-hints */
|
|
final class AgentSettlementPeriodOpenHintsController extends Controller
|
|
{
|
|
public function __invoke(
|
|
Request $request,
|
|
SettlementPeriodOpenHintsService $hintsService,
|
|
): JsonResponse {
|
|
$admin = $request->lotteryAdmin();
|
|
abort_if($admin === null, 401);
|
|
|
|
$siteId = (int) $request->query('admin_site_id', 0);
|
|
abort_if($siteId <= 0, 422);
|
|
abort_if(! AdminAgentSettlementScope::siteAccessible($admin, $siteId), 404);
|
|
|
|
return ApiResponse::success($hintsService->hints($siteId));
|
|
}
|
|
}
|