2023-07-03 00:46:20 +02:00
|
|
|
import { AssetFaceId } from '@app/domain';
|
|
|
|
import { AssetEntity, AssetFaceEntity, PersonEntity } from '@app/infra/entities';
|
2023-05-17 19:07:17 +02:00
|
|
|
export const IPersonRepository = 'IPersonRepository';
|
|
|
|
|
|
|
|
export interface PersonSearchOptions {
|
|
|
|
minimumFaceCount: number;
|
|
|
|
}
|
|
|
|
|
2023-07-11 23:52:41 +02:00
|
|
|
export interface UpdateFacesData {
|
|
|
|
oldPersonId: string;
|
|
|
|
newPersonId: string;
|
|
|
|
}
|
|
|
|
|
2023-05-17 19:07:17 +02:00
|
|
|
export interface IPersonRepository {
|
|
|
|
getAll(userId: string, options: PersonSearchOptions): Promise<PersonEntity[]>;
|
|
|
|
getAllWithoutFaces(): Promise<PersonEntity[]>;
|
|
|
|
getById(userId: string, personId: string): Promise<PersonEntity | null>;
|
2023-07-11 23:52:41 +02:00
|
|
|
|
|
|
|
getAssets(userId: string, personId: string): Promise<AssetEntity[]>;
|
|
|
|
prepareReassignFaces(data: UpdateFacesData): Promise<string[]>;
|
|
|
|
reassignFaces(data: UpdateFacesData): Promise<number>;
|
2023-05-17 19:07:17 +02:00
|
|
|
|
|
|
|
create(entity: Partial<PersonEntity>): Promise<PersonEntity>;
|
|
|
|
update(entity: Partial<PersonEntity>): Promise<PersonEntity>;
|
|
|
|
delete(entity: PersonEntity): Promise<PersonEntity | null>;
|
|
|
|
deleteAll(): Promise<number>;
|
2023-07-03 00:46:20 +02:00
|
|
|
|
|
|
|
getFaceById(payload: AssetFaceId): Promise<AssetFaceEntity | null>;
|
2023-05-17 19:07:17 +02:00
|
|
|
}
|