refactor: 调整返点字段为百分比格式并新增集成指南路由

- 将 rebate_limit 和 default_player_rebate 的校验范围从 0-1 改为 0-100
- 在服务层进行百分比与小数的转换(输入除以100,输出乘以100)
- 更新相关测试用例以匹配新的百分比格式
- 新增 admin/docs/integration-guide 路由用于集成文档展示
This commit is contained in:
2026-06-11 09:23:16 +08:00
parent 1d13d19b65
commit 4d1c2b3d63
5 changed files with 457 additions and 11 deletions

View File

@@ -42,8 +42,8 @@ test('super admin can update agent profile with capability flags', function ():
->putJson('/api/v1/admin/agent-nodes/'.$child->id.'/profile', [
'total_share_rate' => 12,
'credit_limit' => 1200,
'rebate_limit' => 0.01,
'default_player_rebate' => 0.005,
'rebate_limit' => 1,
'default_player_rebate' => 0.5,
'settlement_cycle' => 'weekly',
'can_grant_extra_rebate' => false,
'can_create_child_agent' => true,
@@ -224,8 +224,8 @@ test('agent profile update rejects default rebate above limit', function (): voi
$this->withHeader('Authorization', 'Bearer '.$token)
->putJson('/api/v1/admin/agent-nodes/'.$child->id.'/profile', [
'rebate_limit' => 0.005,
'default_player_rebate' => 0.01,
'rebate_limit' => 0.5,
'default_player_rebate' => 1,
])
->assertStatus(422)
->assertJsonPath('code', ErrorCode::ValidationFailed->value);