feat(shipping-notice): 添加订单文档 Profile 盲测集和样本管理功能,支持创建、执行和批准盲测,增强订单冻结和库存核验功能
This commit is contained in:
1 parent
c35223d49d
commit
abd8fc1e16
98 files changed
+4629
-528
No files matched your search
@@ -8,7 +8,8 @@ backend/app/models/shipping.py
|
||||
Intake/Task/Candidate.business_fingerprint 为业务去重指纹,与文件 content_hash 语义分离;
|
||||
Document/Candidate 承载「一邮件多订单」识别;ShippingTask.source_candidate_id 记录正式建单来源;
|
||||
ShippingTask.supersedes_task_id 唯一约束保证修订链线性;
|
||||
order_data_version 为动态订单 FieldValue 编辑的乐观锁版本;订单事实仅保存于 Extraction。
|
||||
order_data_version 为冻结前 Candidate/Extraction 纠错的乐观锁版本;
|
||||
current_order_extraction_id 追溯解析事实,order_snapshot_id 指向不可变履约事实。
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -18,6 +19,7 @@ from typing import List, Optional
|
||||
|
||||
from sqlalchemy import (
|
||||
Boolean,
|
||||
CheckConstraint,
|
||||
DateTime,
|
||||
Float,
|
||||
ForeignKey,
|
||||
@@ -180,6 +182,17 @@ class ShippingTask(Base):
|
||||
nullable=True,
|
||||
index=True,
|
||||
)
|
||||
# 阶段 1:库存、导出和上传必须通过此指针读取冻结订单快照。
|
||||
order_snapshot_id: Mapped[Optional[int]] = mapped_column(
|
||||
ForeignKey(
|
||||
'shipping_order_snapshots.id',
|
||||
name='fk_shipping_tasks_order_snapshot_id',
|
||||
use_alter=True,
|
||||
),
|
||||
nullable=True,
|
||||
unique=True,
|
||||
index=True,
|
||||
)
|
||||
|
||||
process_status: Mapped[str] = mapped_column(String(32), default='created', index=True)
|
||||
current_step: Mapped[Optional[str]] = mapped_column(String(64), nullable=True)
|
||||
@@ -409,6 +422,10 @@ class ShippingNoticeIntake(Base):
|
||||
|
||||
__tablename__ = 'shipping_notice_intakes'
|
||||
__table_args__ = (
|
||||
CheckConstraint(
|
||||
"purpose IN ('shipping_notice', 'order_document_profile_sample')",
|
||||
name='ck_shipping_notice_intakes_purpose',
|
||||
),
|
||||
UniqueConstraint('intake_no', name='uq_shipping_notice_intakes_intake_no'),
|
||||
UniqueConstraint(
|
||||
'asset_id',
|
||||
|
||||
Reference in new issue
Block a user