refactor(server): move filters to getByDayOfYear query (#14628)

move filters to getByDayOfYear query
This commit is contained in:
Mert 2024-12-10 16:22:47 -05:00 committed by GitHub
parent 25ca3b1124
commit 9eff1c4b34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 55 additions and 38 deletions

View file

@ -146,6 +146,11 @@ export interface UpsertFileOptions {
export type AssetPathEntity = Pick<AssetEntity, 'id' | 'originalPath' | 'isOffline'>;
export interface DayOfYearAssets {
yearsAgo: number;
assets: AssetEntity[];
}
export const IAssetRepository = 'IAssetRepository';
export interface IAssetRepository {
@ -156,7 +161,7 @@ export interface IAssetRepository {
select?: FindOptionsSelect<AssetEntity>,
): Promise<AssetEntity[]>;
getByIdsWithAllRelations(ids: string[]): Promise<AssetEntity[]>;
getByDayOfYear(ownerIds: string[], monthDay: MonthDay): Promise<AssetEntity[]>;
getByDayOfYear(ownerIds: string[], monthDay: MonthDay): Promise<DayOfYearAssets[]>;
getByChecksum(options: { ownerId: string; checksum: Buffer; libraryId?: string }): Promise<AssetEntity | null>;
getByChecksums(userId: string, checksums: Buffer[]): Promise<AssetEntity[]>;
getUploadAssetIdByChecksum(ownerId: string, checksum: Buffer): Promise<string | undefined>;