Skip to content

Add shared API response envelope type #107

Description

@therealjhay

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:

  1. Add to shared/types/index.ts
  2. Export from @bettapay/shared-types
  3. Use as return types in service route handlers

Example commit message:

feat(types): add shared API response envelope and pagination types

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions