feat: 更新玩家信息和统计功能

- 在多个控制器中更新玩家相关数据的查询,新增 'nickname' 字段以增强玩家信息的完整性。
- 在 AdminDashboardSnapshotBuilder 中引入平台风险统计,提供锁定金额和使用百分比的概览。
- 更新 AdminReportQueryService 以返回更详细的统计数据,包括总投注、总中奖和总派彩金额。
- 增强测试用例以验证新增字段和统计功能的准确性。
This commit is contained in:
2026-06-01 16:53:08 +08:00
parent c101ece539
commit d5232c756f
9 changed files with 124 additions and 19 deletions

View File

@@ -98,13 +98,20 @@ test('jwt first successful login auto-registers player mapping', function () {
'exp' => $now + 300,
], 'jwt-test-secret', 'HS256');
$this->withHeader('Authorization', 'Bearer '.$jwt)
$response = $this->withHeader('Authorization', 'Bearer '.$jwt)
->getJson('/api/v1/player/me')
->assertOk()
->assertJsonPath('data.site_player_id', 'brand-new-sso-1')
->assertJsonPath('data.default_currency', 'NPR');
expect(Player::query()->where('site_player_id', 'brand-new-sso-1')->count())->toBe(1);
$username = $response->json('data.username');
expect($username)->toMatch('/^nlotto\d{6}$/')
->and($response->json('data.nickname'))->toBe($username);
$player = Player::query()->where('site_player_id', 'brand-new-sso-1')->first();
expect($player)->not->toBeNull()
->and($player->username)->toBe($username)
->and($player->nickname)->toBe($username);
});
test('player me rejects non-active status with 8005', function () {