feat(server): add POST /attachment/box with real-evidence flip + cap

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-08-12 14:12:42 +08:00
parent 76d2095117
commit 0ef4f0e990
4 changed files with 300 additions and 1 deletions

View File

@@ -36,6 +36,7 @@ from app.services.attachment_service import (
AlreadyOffShelfAttachmentError,
CategoryHasBoxesError,
CategoryNotFoundError,
DuplicateAttachmentBoxItemError,
DuplicateAttachmentLocationError,
)
@@ -231,6 +232,21 @@ async def already_off_shelf_attachment_handler(
)
@app.exception_handler(DuplicateAttachmentBoxItemError)
async def duplicate_attachment_box_handler(
request: Request, exc: DuplicateAttachmentBoxItemError
):
return JSONResponse(
status_code=409,
content={
"error_code": "DUPLICATE_BOX_NO",
"message": f"排产号 {exc.paichan_no} 下箱号 {exc.box_no} 已存在",
"paichan_no": exc.paichan_no,
"box_no": exc.box_no,
},
)
@app.get("/")
async def root():
return {"message": "Welcome to CargoTrace API"}