## 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 将记录标记为已补发审批