refactor(shipping-inventory): 统一库存准备事实来源与门禁状态

This commit is contained in:
hugo committed 2026-09-04 20:23:00 +08:00
1 parent 761a06e21a
commit eb55f407ae
62 files changed
+4242 -1471

No files matched your search

+2 -2
View File
@@ -2,7 +2,7 @@
models/shipping_process_gate.py
用途:门禁级中断恢复的持久化模型——Execution / Gate / Attempt。
依赖:SQLAlchemy Base、ReviewCase、ShippingNotice、Job;状态枚举与 process_gate_contract 对齐。
依赖:SQLAlchemy Base、ReviewCase、ShippingOrderTask、Job;状态枚举与 process_gate_contract 对齐。
逻辑:Execution 为业务恢复真相;Gate 保存当前门禁状态;Attempt 不可变执行尝试并承载租约。
由领域服务独占写入;Job 仅调度。
co8e9f0a1b2c:已移除对 shipping_notice_workflow_* 的硬外键(无历史兼容)。
@@ -74,7 +74,7 @@ class ShippingProcessExecution(Base):
ForeignKey('shipping_order_review_cases.id'), nullable=True,
)
task_id: Mapped[Optional[int]] = mapped_column(
ForeignKey('shipping_notices.id'), nullable=True,
ForeignKey('shipping_order_tasks.id'), nullable=True,
)
# 绑定候选版本,防止旧 callback/job 写入新候选链。
candidate_set_id: Mapped[Optional[int]] = mapped_column(