feat: 实现卡和设备的套餐系列绑定功能
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 5m37s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 5m37s
- 添加 Device 和 IotCard 模型的 SeriesID 字段 - 实现 DeviceService 和 IotCardService 的套餐系列绑定逻辑 - 添加 DeviceStore 和 IotCardStore 的数据库操作方法 - 更新 API 接口和路由支持套餐系列绑定 - 创建数据库迁移脚本(000027_add_series_binding_fields) - 添加完整的单元测试和集成测试 - 更新 OpenAPI 文档 - 归档 OpenSpec 变更文档 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
## 1. 新增模型
|
||||
|
||||
- [ ] 1.1 创建 `internal/model/order.go`,定义 Order 模型(order_no, order_type, buyer_type, buyer_id, iot_card_id, device_id, total_amount, payment_method, payment_status, paid_at, commission_status)
|
||||
- [ ] 1.1 创建 `internal/model/order.go`,定义 Order 模型(order_no, order_type, buyer_type, buyer_id, iot_card_id, device_id, total_amount, payment_method, payment_status, paid_at, commission_status, commission_config_version)
|
||||
- [ ] 1.2 定义 OrderItem 模型(order_id, package_id, package_name, quantity, unit_price, amount)
|
||||
|
||||
## 2. 数据库迁移
|
||||
@@ -42,13 +42,14 @@
|
||||
|
||||
## 7. 订单 Service
|
||||
|
||||
- [ ] 7.1 创建 `internal/service/order/service.go`,实现 Create 方法(验证权限、创建订单和明细)
|
||||
- [ ] 7.1 创建 `internal/service/order/service.go`,实现 Create 方法(验证权限、创建订单和明细、快照佣金配置版本)
|
||||
- [ ] 7.2 实现 Get 方法
|
||||
- [ ] 7.3 实现 List 方法
|
||||
- [ ] 7.4 实现 Cancel 方法(验证状态、更新为已取消)
|
||||
- [ ] 7.5 实现 WalletPay 方法(事务:扣减余额、更新状态、激活套餐)
|
||||
- [ ] 7.6 实现 HandlePaymentCallback 方法(验证签名、幂等处理、激活套餐)
|
||||
- [ ] 7.7 实现 ActivatePackage 辅助方法(创建 PackageUsage 记录)
|
||||
- [ ] 7.5 实现 WalletPay 方法(事务:扣减余额、更新状态、激活套餐、更新销售统计)
|
||||
- [ ] 7.6 实现 HandlePaymentCallback 方法(验证签名、幂等处理、激活套餐、更新销售统计)
|
||||
- [ ] 7.7 实现 ActivatePackage 辅助方法(创建 PackageUsage 记录、更新 ShopSeriesCommissionStats)
|
||||
- [ ] 7.8 实现 SnapshotCommissionConfig 辅助方法(查询并快照当前佣金配置版本)
|
||||
|
||||
## 8. 订单 Handler(后台)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user