UNPKG

@alecslab/nestjs-crud-kit

Version:

Base clases of CRUD operations for NestJs

13 lines (12 loc) 651 B
import { IService } from '@app/crud-kit/service'; import { IRepository } from '@app/crud-kit/repository'; export declare abstract class BaseService<DTO, MODEL> implements IService<DTO, MODEL> { private readonly repository; private readonly baseServiceLogger; protected constructor(repository: IRepository<MODEL>); create(item: DTO): Promise<MODEL>; findAll(options?: unknown): Promise<MODEL[]>; findOne(id: number | string | object, options?: unknown): Promise<MODEL>; update(id: number | string | object, item: Partial<DTO>): Promise<boolean | MODEL>; remove(id: number | string | object): Promise<boolean | MODEL>; }