mirror of
https://gitlab.com/mobicoop/v3/service/matcher.git
synced 2025-12-31 04:32:40 +00:00
refactor to ddh, first commit
This commit is contained in:
4
old/modules/database/interfaces/collection.interface.ts
Normal file
4
old/modules/database/interfaces/collection.interface.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export interface ICollection<T> {
|
||||
data: T[];
|
||||
total: number;
|
||||
}
|
||||
18
old/modules/database/interfaces/repository.interface.ts
Normal file
18
old/modules/database/interfaces/repository.interface.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { ICollection } from './collection.interface';
|
||||
|
||||
export interface IRepository<T> {
|
||||
findAll(
|
||||
page: number,
|
||||
perPage: number,
|
||||
params?: any,
|
||||
include?: any,
|
||||
): Promise<ICollection<T>>;
|
||||
findOne(where: any, include?: any): Promise<T>;
|
||||
findOneByUuid(uuid: string, include?: any): Promise<T>;
|
||||
create(entity: Partial<T> | any, include?: any): Promise<T>;
|
||||
update(uuid: string, entity: Partial<T>, include?: any): Promise<T>;
|
||||
updateWhere(where: any, entity: Partial<T> | any, include?: any): Promise<T>;
|
||||
delete(uuid: string): Promise<T>;
|
||||
deleteMany(where: any): Promise<void>;
|
||||
healthCheck(): Promise<boolean>;
|
||||
}
|
||||
Reference in New Issue
Block a user