Files
junhong_cmp_fiber/openspec/changes/add-carrier-channel-traffic-thresholds/proposal.md
break 59b3df868a
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 12m59s
feat(通道流量阈值): AUG26-011 运营商通道流量阈值达量停机与周期复机
2026-09-16 15:54:49 +08:00

32 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## Scope
- 迭代编号:`AUG26-011`
## Why
运营商通道需按其计费周期流量自动停复机,不能与套餐预警混用。
## What Changes
- 新增通道阈值、周期和停机锁。
- 达量可靠停机,新周期按套餐和其他锁条件复机。
## Capabilities
### New Capabilities
- `carrier-channel-traffic-threshold`: 通道流量阈值控制。
### Modified Capabilities
- 无。
## Impact
影响通道、卡状态、可靠任务、外部运营商调用和 Schema。具体落点
- `tb_carrier` 扩列:`traffic_threshold_enabled``traffic_threshold_value``traffic_threshold_unit`(周期起始日复用既有 `data_reset_day`,不新增列)。
- 新增周期阈值停机锁表:`(carrier_id, card_id, period_start)` 唯一键、任务状态组、提交认领字段、`anomaly_flag`;成对迁移。
- 新增 2 个 Outbox 事件类型停机、复机各一worker 消费。
- 新增 2 个 cron 与 worker 装配点:周期处理(解锁/条件复机)、恢复扫描(只查询回填),均 `@every 1m` + `asynq.Unique(10m)`,照 `TaskTypeRefundChannelRecovery` 形态注册。
- 新增停因常量 `channel_threshold`4 个复机入口新增持锁拒绝。
- carrier 管理接口字段级守卫与响应过滤(阈值字段仅平台账号可见可写)。