refactor: align backend layout and supabase infra
Consolidate backend modules/tests under the backend package while syncing Supabase compose/env config and related plans.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from http import HTTPStatus
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class ProblemDetails(BaseModel):
|
||||
type: str = "about:blank"
|
||||
title: str
|
||||
status: int
|
||||
detail: str
|
||||
instance: str | None = None
|
||||
|
||||
|
||||
def build_problem_details(
|
||||
*,
|
||||
status_code: int,
|
||||
detail: str,
|
||||
type_value: str = "about:blank",
|
||||
title: str | None = None,
|
||||
instance: str | None = None,
|
||||
) -> ProblemDetails:
|
||||
resolved_title = title or HTTPStatus(status_code).phrase
|
||||
return ProblemDetails(
|
||||
type=type_value,
|
||||
title=resolved_title,
|
||||
status=status_code,
|
||||
detail=detail,
|
||||
instance=instance,
|
||||
)
|
||||
Reference in New Issue
Block a user