File size: 563 Bytes
4e83772 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | export interface IBaseRepository<T> {
create(data: Partial<T>): Promise<T>;
findAll(): Promise<T[]>;
findById(id: string): Promise<T | null>;
update(id: string, updateData: Partial<T>): Promise<T | null>;
delete(id: string): Promise<boolean>;
findOne(filter: Partial<Record<keyof T, any>>): Promise<T | null>;
findMany(filter: Partial<Record<keyof T, any>>): Promise<T[]>;
findOneAndUpdate(filter: Partial<Record<keyof T, any>>, updateData: Partial<T>): Promise<T | null>;
findOneAndDelete(filter: Partial<Record<keyof T, any>>): Promise<T | null>;
}
|