feat: add one-to-one box mode with duplicate bind check

Add box_mode field to BoxSaveRequest and DuplicateZongpaiBindError
exception. In one-to-one mode, prevent the same zongpai from being
packed into multiple boxes, returning 409 with existing box info.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-05-12 15:44:00 +08:00
parent ee2b2f8f25
commit 25982b12bf
3 changed files with 36 additions and 1 deletions

View File

@@ -32,6 +32,7 @@ class BoxSaveRequest(BaseModel):
zongpai_no: str
box_no: int
quantity: int
box_mode: str | None = None # one-to-one | one-to-many | many-to-one
@field_validator("zongpai_no")
@classmethod