feat: enhance player authentication and agent management features
Some checks failed
lotterLaravel CI / test (push) Has been cancelled

- Updated AGENTS.md to clarify player interface bindings and agent account restrictions.
- Improved PlayerAuthLoginController to include captcha verification for player login.
- Enhanced AdminPlayerIndexController with permission checks for admin users.
- Refactored AdminPlayerStoreController to enforce agent node restrictions for non-super admins.
- Introduced new error codes for player authentication failures and updated related services.
- Enhanced validation rules for agent profiles to include settlement cycle options.
- Improved AdminCaptchaService to support separate scopes for admin and player captcha handling.
- Updated various services to ensure proper credit management and settlement processes.
This commit is contained in:
2026-06-17 15:27:00 +08:00
parent b496a9457c
commit 2e0b257160
49 changed files with 714 additions and 334 deletions

View File

@@ -32,6 +32,12 @@ test('period close aggregates share ledger written by game settlement recorder',
]);
grantSuperAdminRole($super);
AgentProfile::query()->where('agent_node_id', $rootId)->update([
'total_share_rate' => 100,
'default_player_rebate' => 0.005,
'rebate_limit' => 0.01,
]);
$leaf = app(AgentNodeService::class)->createChild($super, agentChildPayload([
'parent_id' => $rootId,
'code' => 'PIPE-C',
@@ -39,14 +45,10 @@ test('period close aggregates share ledger written by game settlement recorder',
'username' => 'pipe_c',
'total_share_rate' => 25,
'credit_limit' => 100_000,
'rebate_limit' => 0.01,
'default_player_rebate' => 0.005,
]));
AgentProfile::query()->where('agent_node_id', $rootId)->update([
'total_share_rate' => 100,
'default_player_rebate' => 0.005,
]);
$player = Player::query()->create([
'site_code' => $siteCode,
'agent_node_id' => $leaf->id,
@@ -185,6 +187,12 @@ test('credit settlement records base rebate plus add-on rebate and keeps extra r
]);
grantSuperAdminRole($super);
AgentProfile::query()->where('agent_node_id', $rootId)->update([
'total_share_rate' => 100,
'default_player_rebate' => 0.005,
'rebate_limit' => 0.01,
]);
$leaf = app(AgentNodeService::class)->createChild($super, agentChildPayload([
'parent_id' => $rootId,
'code' => 'PIPE-X',
@@ -192,15 +200,11 @@ test('credit settlement records base rebate plus add-on rebate and keeps extra r
'username' => 'pipe_x',
'total_share_rate' => 25,
'credit_limit' => 100_000,
'rebate_limit' => 0.01,
'default_player_rebate' => 0.005,
'can_grant_extra_rebate' => true,
]));
AgentProfile::query()->where('agent_node_id', $rootId)->update([
'total_share_rate' => 100,
'default_player_rebate' => 0.005,
]);
$player = Player::query()->create([
'site_code' => $siteCode,
'agent_node_id' => $leaf->id,