feat(server): add POST /attachment/box with real-evidence flip + cap
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
16
app/main.py
16
app/main.py
@@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user