All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m26s
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
33 lines
1.5 KiB
Markdown
33 lines
1.5 KiB
Markdown
## Why
|
|
|
|
`/api/admin/agent-recharges` 线下充值确认接口(`OfflinePay`)未要求上传支付凭证,而同类的 `/api/admin/orders` 线下支付已强制上传凭证。两个业务场景均涉及线下资金流转,审计和对账需要同等的凭证留存能力。
|
|
|
|
## What Changes
|
|
|
|
- `CreateAgentRechargeRequest` DTO 新增 `payment_voucher_key` 字段(`payment_method=offline` 时必填)
|
|
- `AgentRechargeResponse` DTO 新增 `payment_voucher_key` 响应字段
|
|
- `AgentRechargeRecord` Model 新增 `payment_voucher_key` 数据库列
|
|
- `Create` Service 方法新增:当 `payment_method=offline` 时校验凭证非空,并将凭证写入充值记录
|
|
- 数据库迁移:`tb_agent_recharge_record` 表新增 `payment_voucher_key` 列
|
|
- `OfflinePay` 接口不涉及凭证(财务确认流程,凭证已在创建时录入)
|
|
|
|
## Capabilities
|
|
|
|
### New Capabilities
|
|
|
|
- `agent-recharge-payment-voucher`:代理充值线下支付凭证上传与存储能力,对齐 orders 接口的凭证管理标准
|
|
|
|
### Modified Capabilities
|
|
|
|
(无已有 spec 变更)
|
|
|
|
## Impact
|
|
|
|
| 层级 | 文件 | 变更类型 |
|
|
|------|------|---------|
|
|
| DTO | `internal/model/dto/agent_recharge_dto.go` | `CreateAgentRechargeRequest` + `AgentRechargeResponse` 新增字段 |
|
|
| Model | `internal/model/agent_wallet.go` | `AgentRechargeRecord` 新增字段 |
|
|
| Service | `internal/service/agent_recharge/service.go` | `Create` 方法新增校验与保存逻辑 |
|
|
| DB | `migrations/` | 新增迁移文件 |
|
|
| Handler | `internal/handler/admin/agent_recharge.go` | 无需改动(透传) |
|