import { FastifyReply } from "fastify"; import { AbstractService } from "../../core/neo4j/abstracts/abstract.service"; /** * Standard query parameters for list operations */ export interface ListQueryParams { query: any; search?: string; fetchAll?: boolean; orderBy?: string; } /** * Creates handler functions for standard CRUD operations. * Controllers call these from their decorated methods, delegating * the actual logic while retaining their route and cross-cutting decorators. * * @param getService - Lambda returning the service instance (for DI compatibility) * @returns Object with findAll, findById, create, update, patch, delete handlers * * @example * ```typescript * @Controller() * export class CullController { * private readonly crud = createCrudHandlers(() => this.cullService); * * constructor(private readonly cullService: CullService) {} * * @Get(endpoint) * async findAll(@Res() reply, @Query() query, @Query("search") search?, ...) { * return this.crud.findAll(reply, { query, search, fetchAll, orderBy }); * } * * @Put(`${endpoint}/:id`) * @ValidateId("id") * @CacheInvalidate(meta, "id") * async update(@Res() reply, @Body() body: PutDTO) { * return this.crud.update(reply, body); * } * } * ``` */ export declare function createCrudHandlers>(getService: () => TService): { /** * Handle findAll requests with standard pagination/search */ findAll(reply: FastifyReply, params: ListQueryParams): Promise; /** * Handle findById requests */ findById(reply: FastifyReply, id: string): Promise; /** * Handle create requests from JSON:API DTO * * Forwards `body.included` (JSON:API sidepost resources) to the service so * that subclass overrides of `createFromDTO` / `create` can consume them. * Existing callers that send no `included` receive `undefined`, which the * abstract implementation silently ignores — fully backward-compatible. */ create(reply: FastifyReply, body: { data: any; included?: any[]; }): Promise; /** * Handle update (PUT) requests from JSON:API DTO * * Forwards `body.included` (JSON:API sidepost resources) to the service so * that subclass overrides of `putFromDTO` / `put` can consume them. * Existing callers that send no `included` receive `undefined`, which the * abstract implementation silently ignores — fully backward-compatible. */ update(reply: FastifyReply, body: { data: any; included?: any[]; }): Promise; /** * Handle partial update (PATCH) requests from JSON:API DTO */ patch(reply: FastifyReply, body: { data: any; }): Promise; /** * Handle delete requests */ delete(reply: FastifyReply, id: string): Promise; }; //# sourceMappingURL=crud.handlers.d.ts.map