refactor(api): unify typed error contract across draft pricing and publish flows
standardize typed error responses across draft, pricing and publish endpoints reduce contract drift between related flows keep client-side handling more predictable and consistent
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from fastapi import HTTPException, status
|
||||
|
||||
from app.repositories.scheme_seats import (
|
||||
bulk_remap_scheme_version_seats,
|
||||
list_scheme_version_seats,
|
||||
)
|
||||
from app.services.api_errors import raise_unprocessable
|
||||
from app.services.editor_validation import validate_remap_target_references
|
||||
|
||||
|
||||
@@ -35,9 +34,9 @@ async def preview_remap(
|
||||
to_group_id: str | None,
|
||||
) -> list[dict]:
|
||||
if not any([seat_record_ids, from_sector_id, from_group_id]):
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
|
||||
detail="At least one remap filter must be provided",
|
||||
raise_unprocessable(
|
||||
code="remap_filter_required",
|
||||
message="At least one remap filter must be provided",
|
||||
)
|
||||
|
||||
await validate_remap_target_references(
|
||||
|
||||
Reference in New Issue
Block a user