openWa / src /common /interfaces /response.interface.ts
harsh
Deploy: Initial commit without binaries
525d39f
Raw History Blame Contribute Delete
512 Bytes
// Common response interface for all API endpoints
export interface ApiResponse<T = any> {
success: boolean;
data?: T;
error?: ApiError;
meta?: ApiMeta;
}
export interface ApiError {
code: string;
message: string;
details?: Record<string, any>;
}
export interface ApiMeta {
timestamp: string;
requestId?: string;
}
export interface PaginatedResponse<T = any> extends ApiResponse<T[]> {
pagination?: {
page: number;
limit: number;
total: number;
totalPages: number;
};
}