f1c98ac9e6
* soft delete albums when user gets soft deleted * fix wrong intl openapi version * fix tests * ability to restore albums, automatically restore when user restored * (e2e) tests for shared albums via link and with user * (e2e) test deletion of users and linked albums * (e2e) fix share album with owner test * fix: deletedAt * chore: fix restore order * fix: use timezone date column * chore: cleanup e2e tests * (e2e) fix user delete test --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
import { AlbumEntity } from '@app/infra/entities';
|
|
|
|
export const IAlbumRepository = 'IAlbumRepository';
|
|
|
|
export interface AlbumAssetCount {
|
|
albumId: string;
|
|
assetCount: number;
|
|
}
|
|
|
|
export interface AlbumInfoOptions {
|
|
withAssets: boolean;
|
|
}
|
|
|
|
export interface IAlbumRepository {
|
|
getById(id: string, options: AlbumInfoOptions): Promise<AlbumEntity | null>;
|
|
getByIds(ids: string[]): Promise<AlbumEntity[]>;
|
|
getByAssetId(ownerId: string, assetId: string): Promise<AlbumEntity[]>;
|
|
hasAsset(id: string, assetId: string): Promise<boolean>;
|
|
/** Remove an asset from _all_ albums */
|
|
removeAsset(id: string): Promise<void>;
|
|
getAssetCountForIds(ids: string[]): Promise<AlbumAssetCount[]>;
|
|
getInvalidThumbnail(): Promise<string[]>;
|
|
getOwned(ownerId: string): Promise<AlbumEntity[]>;
|
|
getShared(ownerId: string): Promise<AlbumEntity[]>;
|
|
getNotShared(ownerId: string): Promise<AlbumEntity[]>;
|
|
restoreAll(userId: string): Promise<void>;
|
|
softDeleteAll(userId: string): Promise<void>;
|
|
deleteAll(userId: string): Promise<void>;
|
|
getAll(): Promise<AlbumEntity[]>;
|
|
create(album: Partial<AlbumEntity>): Promise<AlbumEntity>;
|
|
update(album: Partial<AlbumEntity>): Promise<AlbumEntity>;
|
|
delete(album: AlbumEntity): Promise<void>;
|
|
updateThumbnails(): Promise<number | undefined>;
|
|
}
|