Description: API responses have no consistent envelope. A shared generic response type would make it easy to type route handlers.
Requirements:
- Define
ApiResponse<T> type: { data: T } | { error: ErrorResponse }
- Define
PaginatedResponse<T> type: { data: T[]; pagination: { total: number; limit: number; offset: number; hasMore: boolean } }
- Export both types
Suggested execution steps:
- Add to
shared/types/index.ts
- Export from
@bettapay/shared-types
- Use as return types in service route handlers
Example commit message:
feat(types): add shared API response envelope and pagination types
Description: API responses have no consistent envelope. A shared generic response type would make it easy to type route handlers.
Requirements:
ApiResponse<T>type:{ data: T } | { error: ErrorResponse }PaginatedResponse<T>type:{ data: T[]; pagination: { total: number; limit: number; offset: number; hasMore: boolean } }Suggested execution steps:
shared/types/index.ts@bettapay/shared-typesExample commit message: