feat: add platform invoice dunning workflow

This commit is contained in:
Codex
2026-06-30 05:27:58 +08:00
parent f9f96bee63
commit c74432ce98
25 changed files with 858 additions and 23 deletions

View File

@@ -65,6 +65,16 @@ WORKER_COMMERCE_BATCH_SIZE=20
WORKER_COMMERCE_MIN_AGE_SECONDS=300
WORKER_COMMERCE_REQUEST_TIMEOUT_MS=10000
# Worker 配置:平台 SaaS 订阅自动开票和逾期催缴。
# 自动开票只处理有明确 expires_at 且未开过非 void 订阅账单的订阅。
WORKER_PLATFORM_BILLING_BATCH_SIZE=50
WORKER_PLATFORM_BILLING_DAYS_AHEAD=45
WORKER_PLATFORM_BILLING_DUE_DAYS=15
WORKER_PLATFORM_BILLING_ID=platform-billing-1
# 逾期催缴只标记 overdue、写 tenant_invoice_reminders 和审计,不自动停用租户。
WORKER_PLATFORM_DUNNING_BATCH_SIZE=100
WORKER_PLATFORM_DUNNING_ID=platform-dunning-1
# Worker 配置:内容资源复检。异常托管对象会被标记 failed 并从 active 退回 draft。
WORKER_ASSET_BATCH_SIZE=50
WORKER_ASSET_MIN_AGE_SECONDS=300