feat: add AgentNodeIndexController for node listing and remove settlement_cycle field from AgentProfile logic

This commit is contained in:
2026-06-11 18:01:58 +08:00
parent 4d1c2b3d63
commit e14b7b4569
30 changed files with 383 additions and 91 deletions

View File

@@ -30,6 +30,11 @@ final class AdminIntegrationSiteStoreRequest extends ApiFormRequest
'iframe_allowed_origins.*' => ['string', 'max:512'],
'lottery_h5_base_url' => ['nullable', 'string', 'max:512'],
'notes' => ['nullable', 'string', 'max:5000'],
'admin_account' => ['required', 'array'],
'admin_account.username' => ['required', 'string', 'max:64', Rule::unique('admin_users', 'username')],
'admin_account.nickname' => ['required', 'string', 'max:64'],
'admin_account.password' => ['required', 'string', 'min:8', 'max:255'],
'admin_account.email' => ['nullable', 'email', 'max:255'],
];
}
}

View File

@@ -29,8 +29,8 @@ final class AdminPlayerStoreRequest extends ApiFormRequest
'status' => ['sometimes', 'integer', 'in:0,1,2'],
'agent_node_id' => ['sometimes', 'nullable', 'integer', 'min:1'],
'credit_limit' => ['sometimes', 'integer', 'min:0'],
'rebate_rate' => ['sometimes', 'numeric', 'min:0', 'max:1'],
'extra_rebate_rate' => ['sometimes', 'numeric', 'min:0', 'max:1'],
'rebate_rate' => ['sometimes', 'numeric', 'min:0', 'max:100'],
'extra_rebate_rate' => ['sometimes', 'numeric', 'min:0', 'max:100'],
];
}

View File

@@ -25,12 +25,12 @@ final class AdminPlayerUpdateRequest extends ApiFormRequest
'default_currency' => ['sometimes', 'string', 'max:16', Rule::exists('currencies', 'code')],
'status' => ['sometimes', 'integer', Rule::in([0, 1, 2])],
'credit_limit' => ['sometimes', 'integer', 'min:0'],
'rebate_rate' => ['sometimes', 'numeric', 'min:0', 'max:1'],
'extra_rebate_rate' => ['sometimes', 'numeric', 'min:0', 'max:1'],
'rebate_rate' => ['sometimes', 'numeric', 'min:0', 'max:100'],
'extra_rebate_rate' => ['sometimes', 'numeric', 'min:0', 'max:100'],
'rebate_profiles' => ['sometimes', 'array'],
'rebate_profiles.*.game_type' => ['required_with:rebate_profiles', 'string', 'max:32'],
'rebate_profiles.*.rebate_rate' => ['sometimes', 'numeric', 'min:0', 'max:1'],
'rebate_profiles.*.extra_rebate_rate' => ['sometimes', 'numeric', 'min:0', 'max:1'],
'rebate_profiles.*.rebate_rate' => ['sometimes', 'numeric', 'min:0', 'max:100'],
'rebate_profiles.*.extra_rebate_rate' => ['sometimes', 'numeric', 'min:0', 'max:100'],
'rebate_profiles.*.inherit_from_agent' => ['sometimes', 'boolean'],
'risk_tags' => ['sometimes', 'array'],
'risk_tags.*' => ['string', 'max:64'],

View File

@@ -2,8 +2,6 @@
namespace App\Http\Requests\Admin\Concerns;
use App\Support\AgentSettlementCycle;
trait AgentProfileFieldRules
{
/** @return array<string, mixed> */
@@ -15,7 +13,6 @@ trait AgentProfileFieldRules
'credit_limit' => ['sometimes', 'integer', 'min:0'],
'rebate_limit' => ['sometimes', 'numeric', 'min:0', 'max:100'],
'default_player_rebate' => ['sometimes', 'numeric', 'min:0', 'max:100'],
'settlement_cycle' => ['sometimes', 'string', 'in:'.implode(',', AgentSettlementCycle::VALUES)],
'can_grant_extra_rebate' => ['sometimes', 'boolean'],
'can_create_child_agent' => ['sometimes', 'boolean'],
'can_create_player' => ['sometimes', 'boolean'],
@@ -26,12 +23,6 @@ trait AgentProfileFieldRules
protected function prepareAgentProfileFieldsForValidation(): void
{
if (! $this->has('settlement_cycle')) {
return;
}
$this->merge([
'settlement_cycle' => AgentSettlementCycle::normalize($this->input('settlement_cycle')),
]);
// 预处理字段(如需要)
}
}