feat: PollingRealnameHandler 新增设备级套餐实名激活联动

- 结构体新增 deviceSimBindingStore 字段,构造函数参数列表末尾追加
- 新增 triggerDeviceRealnameActivation:卡首次实名(0→1)时查询所属设备,
  若有绑定则提交 carrier_type=device 的 TaskTypePackageFirstActivation 任务
- 独立卡(无绑定设备)静默跳过,任务提交失败仅记录 Warn 日志不阻断流程
- registerPollingHandlers 传入 h.workerResult.Stores.DeviceSimBinding
- 修复「购买后某张卡实名」场景下设备级套餐永不激活的缺陷

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-04-18 09:30:50 +08:00
parent 8e61cb1a54
commit 28ac58ea18
2 changed files with 54 additions and 11 deletions

View File

@@ -156,7 +156,7 @@ func (h *Handler) registerCommissionCalculationHandler() {
func (h *Handler) registerPollingHandlers() {
realnameHandler := task.NewPollingRealnameHandler(
h.pollingBase, h.gatewayClient, h.workerResult.Stores.IotCard,
h.asynqClient, h.pollingStopResumeSvc)
h.asynqClient, h.pollingStopResumeSvc, h.workerResult.Stores.DeviceSimBinding)
carrierStore := postgres.NewCarrierStore(h.db)
carddataHandler := task.NewPollingCarddataHandler(
h.pollingBase, h.gatewayClient, h.workerResult.Stores.IotCard,