Problem
API responses have no consistent shape. Some handlers return raw structs, others return ad-hoc maps. Clients (web, mobile) have to handle each endpoint differently.
Proposed shape
// success
{ "data": { ... } }
// error
{ "error": { "code": "NOT_FOUND", "message": "user not found" } }
Acceptance criteria
Problem
API responses have no consistent shape. Some handlers return raw structs, others return ad-hoc maps. Clients (web, mobile) have to handle each endpoint differently.
Proposed shape
Acceptance criteria
Response[T]" andErrorResponsetypes in a shared package (e.g.internal/transport/handlers/response.go`)JSON(c, data)" andJSONError(c, status, code, message)`backend/docs/