"""EX-B2-11: three endpoints, one business condition, inconsistent contracts."""

from fastapi import FastAPI, HTTPException
from fastapi.responses import JSONResponse

app = FastAPI(title="Inconsistent business errors")


@app.post("/areas/a/expedientes")
def create_a() -> dict[str, str]:
    return {"error": "duplicate reference"}


@app.post("/areas/b/expedientes")
def create_b() -> None:
    raise HTTPException(status_code=400, detail={"reason": "already used"})


@app.post("/areas/c/expedientes")
def create_c() -> JSONResponse:
    return JSONResponse(status_code=409, content={"message": "Conflict"})


# TODO: define one stable public envelope and one translation path.
# Do not expose implementation details or parse human prose in a client.
