fix: update some files
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m44s

This commit is contained in:
luo
2026-08-18 17:36:41 +08:00
parent 93f67967c5
commit d9d07422a9
38 changed files with 1140 additions and 728 deletions

View File

@@ -0,0 +1,56 @@
## 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 将记录标记为已补发审批

View File

@@ -0,0 +1,56 @@
## ADDED Requirements
### Requirement: Refund Historical Approval Resend API
The refund service SHALL expose a historical approval resend operation through `POST /api/admin/refunds/{id}/trigger-approval`.
#### Scenario: Resend approval for a historical refund
- **GIVEN** 一个需要补发审批的历史退款申请 `id`
- **WHEN** 前端调用 `POST /api/admin/refunds/{id}/trigger-approval`
- **THEN** 请求 MUST 在路径参数中携带该退款申请 `id`
- **AND** 成功响应 MUST 被解析为完整的 `Refund` 记录,并保留 `approval_provider``approval_instance_id``approval_status``approval_status_name` 字段
### Requirement: Refund Historical Approval Resend Entry
The refund list page SHALL provide a `补发审批` action only for refund records whose `status` is pending approval and whose `approval_status` is empty, and SHALL gate it by permission.
#### Scenario: Show resend action for an eligible refund
- **GIVEN** 平台账号拥有 `refund:trigger_approval` 权限
- **AND** 退款申请的 `status` 为待审批1
- **AND** 退款申请的 `approval_status` 为空(`null``undefined`
- **WHEN** 页面渲染退款列表
- **THEN** 页面 MUST 为该记录显示“补发审批”操作
#### Scenario: Hide resend action when refund status is not pending
- **GIVEN** 退款申请的 `status` 不为待审批1
- **WHEN** 页面渲染该记录
- **THEN** 页面 MUST NOT 显示“补发审批”操作
#### Scenario: Hide resend action when approval status is present
- **GIVEN** 退款申请的 `approval_status` 不为空
- **WHEN** 页面渲染该记录
- **THEN** 页面 MUST NOT 显示“补发审批”操作
#### Scenario: Hide resend action without permission
- **GIVEN** 当前账号不拥有 `refund: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 将记录标记为已补发审批