feat(location): add paicha overview endpoint

This commit is contained in:
Misaka_Company
2026-05-15 08:45:18 +08:00
parent 5a7e88c3c9
commit d9e6d38466
5 changed files with 272 additions and 3 deletions

View File

@@ -18,7 +18,11 @@ except Exception as e:
from app.api.v1.location import router as location_router
from app.api.v1.box import router as box_router
from app.services.location_service import AlreadyOffShelfError, DuplicateLocationError
from app.services.location_service import (
AlreadyOffShelfError,
DuplicateLocationError,
PaichaNotFoundError,
)
from app.services.box_service import (
BoxItemNotFoundError,
DuplicateBoxItemError,
@@ -137,6 +141,17 @@ async def box_item_not_found_handler(request: Request, exc: BoxItemNotFoundError
)
@app.exception_handler(PaichaNotFoundError)
async def paicha_not_found_handler(request: Request, exc: PaichaNotFoundError):
return JSONResponse(
status_code=404,
content={
"error_code": "PAICHA_NOT_FOUND",
"message": "暂无排产信息",
},
)
@app.exception_handler(InvalidQuantityError)
async def invalid_quantity_handler(request: Request, exc: InvalidQuantityError):
return JSONResponse(