feat: enhance agent settlement features and improve data access controls
- 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.
This commit is contained in:
@@ -332,23 +332,17 @@ final class AgentSettlementReportQueryService
|
||||
|
||||
private function applyPlayerSubtree(Builder $query, AdminUser $admin, string $alias = 'p'): void
|
||||
{
|
||||
AdminDataScope::applyToPlayersAlias($query, $admin, $alias);
|
||||
AdminAgentSettlementScope::applyDirectPlayersToAlias($query, $admin, $alias);
|
||||
}
|
||||
|
||||
private function applyAgentSubtree(Builder $query, AdminUser $admin, string $agentNodeColumn): void
|
||||
{
|
||||
$subtreeIds = AdminAgentSettlementScope::subtreeAgentNodeIds($admin);
|
||||
if ($subtreeIds === null) {
|
||||
$actorId = AdminAgentSettlementScope::boundAgentNodeId($admin);
|
||||
if ($actorId === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($subtreeIds === []) {
|
||||
$query->whereRaw('0 = 1');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$query->whereIn($agentNodeColumn, $subtreeIds);
|
||||
$query->where($agentNodeColumn, $actorId);
|
||||
}
|
||||
|
||||
private function siteCodeForAdmin(AdminUser $admin, int $periodId): string
|
||||
|
||||
Reference in New Issue
Block a user