Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
/**
|
|
|
|
|
* Common API response and utility types used across the CRM.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/** Generic wrapper for all API responses */
|
|
|
|
|
export interface ApiResponse<T> {
|
|
|
|
|
data: T;
|
|
|
|
|
success: true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Wrapper for API error responses */
|
|
|
|
|
export interface ApiErrorResponse {
|
|
|
|
|
success: false;
|
|
|
|
|
error: ApiError;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Paginated list response */
|
|
|
|
|
export interface PaginatedResponse<T> {
|
|
|
|
|
data: T[];
|
|
|
|
|
pagination: {
|
|
|
|
|
page: number;
|
|
|
|
|
pageSize: number;
|
|
|
|
|
total: number;
|
|
|
|
|
totalPages: number;
|
|
|
|
|
hasNextPage: boolean;
|
|
|
|
|
hasPreviousPage: boolean;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Standard API error shape */
|
|
|
|
|
export interface ApiError {
|
|
|
|
|
code: string;
|
|
|
|
|
message: string;
|
|
|
|
|
field?: string;
|
|
|
|
|
details?: Record<string, unknown>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Sort configuration for list queries */
|
|
|
|
|
export interface SortConfig<T extends string = string> {
|
|
|
|
|
field: T;
|
|
|
|
|
direction: 'asc' | 'desc';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Filter configuration for list queries */
|
|
|
|
|
export interface FilterConfig {
|
|
|
|
|
field: string;
|
2026-05-11 13:01:47 +02:00
|
|
|
operator:
|
|
|
|
|
| 'eq'
|
|
|
|
|
| 'neq'
|
|
|
|
|
| 'gt'
|
|
|
|
|
| 'gte'
|
|
|
|
|
| 'lt'
|
|
|
|
|
| 'lte'
|
|
|
|
|
| 'like'
|
|
|
|
|
| 'in'
|
|
|
|
|
| 'notIn'
|
|
|
|
|
| 'isNull'
|
|
|
|
|
| 'isNotNull';
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
value: string | number | boolean | string[] | number[] | null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Standard list query parameters */
|
|
|
|
|
export interface ListQueryParams {
|
|
|
|
|
page?: number;
|
|
|
|
|
pageSize?: number;
|
|
|
|
|
sort?: SortConfig;
|
|
|
|
|
filters?: FilterConfig[];
|
|
|
|
|
search?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Standard mutation response */
|
|
|
|
|
export interface MutationResponse {
|
|
|
|
|
success: boolean;
|
|
|
|
|
id?: string;
|
|
|
|
|
message?: string;
|
|
|
|
|
}
|