UNPKG

@kenniy/godeye-data-contracts

Version:

Enterprise-grade base repository architecture for GOD-EYE microservices with zero overhead and maximum code reuse

50 lines (49 loc) 1.31 kB
/** * Query DTOs for Clean, Fluent Repository API * Optimized developer experience with type safety */ import { SortDirection } from '../types'; /** * Base Query DTO - Common query parameters */ export declare class BaseQueryDto { limit?: number; page?: number; search?: string; include?: string[]; select?: string[]; } /** * User Query DTO - Auto-typed for User entity */ export declare class UserQueryDto extends BaseQueryDto { status?: 'active' | 'inactive'; userType?: 'business' | 'individual'; email?: string; sortBy?: SortDirection; sortField?: 'createdAt' | 'updatedAt' | 'name'; } /** * File Query DTO - Auto-typed for File entity */ export declare class FileQueryDto extends BaseQueryDto { userId?: string; status?: 'active' | 'deleted'; fileType?: string; minSize?: number; maxSize?: number; } /** * Generic Query Builder for any entity */ export declare class QueryBuilder<T> { private criteria; where(conditions: Partial<T>): this; include(relations: string[]): this; select(fields: string[]): this; sort(field: keyof T, direction?: SortDirection): this; limit(count: number): this; paginate(page: number, limit?: number): this; search(term: string, fields: string[]): this; build(): any; }