2.6 KiB
2.6 KiB
ADDED Requirements
Requirement: Agent Recharge Historical Approval Resend API
The agent recharge service SHALL expose a historical approval resend operation through POST /api/admin/agent-recharges/{id}/trigger-approval.
Scenario: Resend approval for a historical offline recharge
- GIVEN 一个需要补发审批的历史线下代理充值记录
id - WHEN 前端调用
POST /api/admin/agent-recharges/{id}/trigger-approval - THEN 请求 MUST 在路径参数中携带该充值记录
id - AND 成功响应 MUST 被解析为完整的
AgentRecharge记录,并保留approval_provider、approval_instance_id、approval_status和approval_status_name字段
Requirement: Agent Recharge Historical Approval Resend Entry
The agent recharge list page SHALL provide a 补发审批 action only for recharge records whose approval_status is empty and whose business status is not completed, rejected, or closed, and SHALL gate it by permission.
Scenario: Show resend action for an eligible recharge
- GIVEN 平台账号拥有
agent_recharge:trigger_approval权限 - AND 充值记录的
approval_status为空(null或undefined) - AND 充值记录的
status不属于已完成(3)、已驳回(6)、已关闭(4) - WHEN 页面渲染代理充值列表
- THEN 页面 MUST 为该记录显示“补发审批”操作
Scenario: Hide resend action when approval status is present
- GIVEN 充值记录的
approval_status不为空 - WHEN 页面渲染该记录
- THEN 页面 MUST NOT 显示“补发审批”操作
Scenario: Hide resend action for terminal recharge statuses
- GIVEN 充值记录的
status为已完成(3)、已驳回(6)或已关闭(4) - WHEN 页面渲染该记录
- THEN 页面 MUST NOT 显示“补发审批”操作
Scenario: Hide resend action without permission
- GIVEN 当前账号不拥有
agent_recharge:trigger_approval权限 - WHEN 页面渲染代理充值记录
- THEN 页面 MUST NOT 显示“补发审批”操作
Scenario: Resend approval succeeds
- GIVEN 用户对符合条件的充值记录点击“补发审批”
- WHEN 接口返回
code=0 - THEN 页面 MUST 显示成功提示并刷新列表
- AND 刷新后的记录 MUST 展示接口返回的最新审批状态
Scenario: Resend approval fails
- GIVEN 接口返回非零
code或请求失败 - WHEN 用户触发“补发审批”
- THEN 页面 MUST 展示后端返回的错误信息
- AND 页面 MUST NOT 将记录标记为已补发审批