feat(server): extend GET /box/info with mixed items and attachment summary

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-08-12 14:18:56 +08:00
parent 4d55420958
commit 5b2106b30d
3 changed files with 121 additions and 2 deletions

View File

@@ -6,12 +6,15 @@ ZONGPAI_PATTERN = re.compile(r"^(\d{2}(B|C|T)\d+|\d{2}(BW|CW)\d{4})$")
class BoxItemDetail(BaseModel):
"""箱号下某个总排号的明细"""
"""箱号下某个总排号的明细(产品或附件)"""
box_item_id: int | None = None
zongpai_no: str
work_order_no: str | None = None
quantity: int
total_quantity: int | None = None
kind: str = "product"
category_id: int | None = None
category_name: str | None = None
class CurrentZongpaiBox(BaseModel):
@@ -27,6 +30,12 @@ class BoxDetail(BaseModel):
items: list[BoxItemDetail]
class AttachmentSummary(BaseModel):
determination: str
all_complete: bool
pending_count: int
class BoxInfoResponse(BaseModel):
"""GET /box/info 响应"""
zongpai_no: str
@@ -37,6 +46,7 @@ class BoxInfoResponse(BaseModel):
existing_boxes: list[BoxDetail]
max_box_no: int
suggested_box_no: int
attachment_summary: AttachmentSummary
class BoxSaveRequest(BaseModel):