feat: enhance agent management and validation logic

- Updated AGENTS.md to clarify agent account restrictions and permissions.
- Implemented checks in AgentNodeAdminUserStoreController and AgentNodeRoleStoreController to restrict admin user and role creation to the agent's own node.
- Enhanced validation in AdminPlayerStoreController and AdminPlayerUpdateController to enforce credit limit and rebate rate rules based on player funding mode.
- Refactored various request classes to utilize shared admin account field rules for consistency.
- Improved error handling in services related to credit allocation and rebate limits to ensure proper validation and messaging.
This commit is contained in:
2026-06-14 21:13:27 +08:00
parent 395e1c7400
commit 5b6d4cb74d
56 changed files with 1558 additions and 222 deletions

View File

@@ -21,7 +21,11 @@ return [
'player_create_agent_forbidden' => 'You cannot assign the player to this agent node.',
'player_create_capability_forbidden' => 'This agent account is not allowed to create players. Ask your upline to enable the capability.',
'player_already_registered' => 'This main-site player is already registered.',
'player_site_player_id_required' => 'Main-site player ID is required.',
'player_native_username_required' => 'Lottery login username is required.',
'player_username_taken' => 'This login username is already taken.',
'player_wallet_balance_blocks_delete' => 'Player wallet still has balance. Clear it before deletion.',
'player_credit_in_use_blocks_delete' => 'Player still has allocated credit. Settle or release it before deletion.',
'player_has_tickets_blocks_delete' => 'Player has ticket records and cannot be deleted.',
'player_unpaid_settlement_blocks_delete' => 'Player still has unpaid settlement bills and cannot be deleted until they are settled or written off.',
'role_cannot_delete_super_admin' => 'Cannot delete the super admin role.',
@@ -49,4 +53,11 @@ return [
'api_resource_no_permission_binding' => 'Admin API resource has no permission binding: :code',
'currency_default_cannot_delete' => 'Default currency cannot be deleted.',
'currency_referenced_cannot_delete' => 'Currency is referenced by business data and cannot be deleted: :refs',
'agent_cannot_operate_bill' => 'You are not allowed to operate on this bill.',
'agent_cannot_operate_player_bill' => 'You may only record payments for direct players under your node.',
'agent_bound_cannot_manage_periods' => 'Bound agent accounts cannot open or close settlement periods. Contact site finance.',
'agent_bound_cannot_finance_adjust' => 'Bound agent accounts cannot write off bad debt or post finance adjustments. Contact site finance.',
'agent_cannot_view_platform_pnl' => 'Agent accounts cannot view platform-wide P&L reports.',
'admin_site_id_required' => 'Integration site is required.',
'admin_site_not_found' => 'Integration site not found or not accessible.',
];

View File

@@ -15,7 +15,15 @@ return [
'permission_catalog_incomplete' => 'Permission catalog is incomplete (missing: :detail). Run migrate and admin-auth-sync.',
'exceeds_parent' => 'Share rate cannot exceed the parent agent.',
'exceeds_available' => 'Credit limit exceeds the parent\'s available allocation.',
'exceeds_limit' => 'Default player rebate cannot exceed the rebate ceiling.',
'exceeds_limit' => 'Value exceeds the allowed limit.',
'exceeds_player_rebate_limit' => 'Rebate rate cannot exceed the agent rebate ceiling.',
'exceeds_parent_rebate' => 'Rebate ceiling cannot exceed the parent agent.',
'exceeds_default_rebate_limit' => 'Default player rebate cannot exceed this node\'s rebate ceiling.',
'not_allowed' => 'This capability is not enabled for the agent.',
'agent_profile_required' => 'Configure share rate and credit on the agent profile first.',
'parent_profile_required' => 'Configure share rate and credit on the parent agent profile first.',
'wallet_player_prohibited' => 'Wallet players cannot have credit limits or rebate settings.',
'exceeds_unpaid' => 'Payment amount cannot exceed the unpaid balance on this bill.',
'invalid_range' => 'Share rate must be between 0 and 100.',
'below_allocated' => 'Credit limit cannot be lower than credit already allocated to sub-agents.',
'parent_cannot_delegate' => 'The parent has not enabled this capability.',
@@ -31,4 +39,17 @@ return [
'period_not_found' => 'Settlement period not found or not accessible.',
'period_already_closed' => 'This period is already closed.',
'share_snapshot_missing' => 'Some ledger rows are missing share snapshots. Complete draw settlement first.',
'completed' => 'This settlement period is closed; bills and payments cannot be changed.',
'locked' => 'This bill is locked and cannot be modified.',
'not_payable' => 'This bill cannot accept payments in its current status. Confirm it first.',
'not_confirmable' => 'This bill cannot be confirmed in its current status.',
'not_eligible' => 'This bill is not eligible for this operation.',
'no_unpaid' => 'This bill has no unpaid balance.',
'not_locked' => 'This bill is not confirmed/locked yet; adjustments are not allowed.',
'zero' => 'Amount cannot be zero.',
'insufficient' => 'Insufficient available credit. Reduce the stake or ask your agent for a higher limit.',
'overdue' => 'You have overdue bills. Settle them before continuing.',
'invalid' => 'Invalid value. Please check and try again.',
'bill_not_found' => 'Settlement bill not found or not accessible.',
'exists' => 'The selected site does not exist or is not integrated.',
];

View File

@@ -22,6 +22,9 @@ return [
'player_create_agent_forbidden' => '无权将玩家归属到该代理节点。',
'player_create_capability_forbidden' => '当前代理账号未开通「创建玩家」能力,请联系上级代理调整权限。',
'player_already_registered' => '该主站玩家已在彩票平台注册。',
'player_site_player_id_required' => '请填写主站玩家 ID。',
'player_native_username_required' => '请填写彩票端登录账号。',
'player_username_taken' => '该登录账号已被占用,请更换。',
'player_wallet_balance_blocks_delete' => '该玩家钱包仍有余额,请先清空后再删除。',
'player_credit_in_use_blocks_delete' => '该玩家仍有已占用信用额度,请先结清或释放后再删除。',
'player_unpaid_settlement_blocks_delete' => '该玩家仍有未结账单,请先结清或核销后再删除。',
@@ -51,4 +54,11 @@ return [
'api_resource_no_permission_binding' => '后台 API 资源未绑定权限动作::code',
'currency_default_cannot_delete' => '默认币种不可删除。',
'currency_referenced_cannot_delete' => '该币种已被业务数据引用,暂不可删除::refs',
'agent_cannot_operate_bill' => '当前账号无权操作该账单。',
'agent_cannot_operate_player_bill' => '仅可登记直属玩家的账单收付,不能操作其他代理或下级玩家的账单。',
'agent_bound_cannot_manage_periods' => '绑定代理账号不能开/关账期,请联系站点财务操作。',
'agent_bound_cannot_finance_adjust' => '绑定代理账号不能执行坏账核销或补差冲正,请联系站点财务。',
'agent_cannot_view_platform_pnl' => '代理账号不能查看全站盈亏报表。',
'admin_site_id_required' => '请指定接入站点。',
'admin_site_not_found' => '接入站点不存在或无权访问。',
];

View File

@@ -17,7 +17,14 @@ return [
'exceeds_parent' => '占成比例不能超过上级代理。',
'exceeds_available' => '超出代理可下发额度:请提高该代理授信,或减少其他下级/玩家已占用的额度。',
'agent_profile_required' => '该代理尚未配置占成与授信,请先在「占成与授信」保存代理档案。',
'exceeds_limit' => '默认玩家回水不能超过回水上限。',
'parent_profile_required' => '上级代理尚未配置占成与授信,请先完善上级代理档案。',
'exceeds_limit' => '超出允许上限,请调整后重试。',
'exceeds_player_rebate_limit' => '回水比例不能超过代理回水上限。',
'exceeds_parent_rebate' => '回水上限不能超过上级代理。',
'exceeds_default_rebate_limit' => '默认玩家回水不能超过本节点回水上限。',
'not_allowed' => '当前代理未开放该能力,无法设置。',
'wallet_player_prohibited' => '主站钱包玩家不支持授信额度与回水设置。',
'exceeds_unpaid' => '收付金额不能超过账单未结金额。',
'invalid_range' => '占成比例必须在 0100 之间。',
'below_allocated' => '代理授信额度不能低于已下发给下级代理与玩家的总额。',
'below_player_used' => '玩家授信额度不能低于该玩家已占用(含冻结)的额度。',
@@ -35,4 +42,17 @@ return [
'period_not_found' => '账期不存在或无权访问。',
'period_already_closed' => '该账期已关账,请勿重复操作。',
'share_snapshot_missing' => '账期内存在缺少占成快照的流水,无法关账。请先完成开奖结算或联系技术支持。',
'completed' => '该账期已关账,无法再修改账单或登记收付。',
'locked' => '账单已锁定,无法修改金额或状态。',
'not_payable' => '当前账单状态不允许登记收付,请先确认账单。',
'not_confirmable' => '当前账单状态不允许确认。',
'not_eligible' => '当前账单不符合此操作条件。',
'no_unpaid' => '该账单已无未结金额。',
'not_locked' => '账单尚未确认锁定,无法执行补差或冲正。',
'zero' => '金额不能为 0。',
'insufficient' => '可用信用额度不足,请减少下注金额或联系代理提高授信。',
'overdue' => '存在逾期未结账单,请先结清后再操作。',
'invalid' => '数值无效,请检查后重试。',
'bill_not_found' => '结算账单不存在或无权访问。',
'exists' => '所选站点不存在或未接入。',
];