2025-01-15 22:01:28 +01:00
|
|
|
import { Insertable, Updateable } from 'kysely';
|
|
|
|
|
import { Libraries } from 'src/db';
|
2024-03-20 23:53:07 +01:00
|
|
|
import { LibraryStatsResponseDto } from 'src/dtos/library.dto';
|
2024-05-20 18:09:10 -04:00
|
|
|
import { LibraryEntity } from 'src/entities/library.entity';
|
2023-09-20 13:16:33 +02:00
|
|
|
|
|
|
|
|
export const ILibraryRepository = 'ILibraryRepository';
|
|
|
|
|
|
|
|
|
|
export interface ILibraryRepository {
|
2024-05-20 18:09:10 -04:00
|
|
|
getAll(withDeleted?: boolean): Promise<LibraryEntity[]>;
|
2023-09-20 13:16:33 +02:00
|
|
|
getAllDeleted(): Promise<LibraryEntity[]>;
|
2025-01-15 22:01:28 +01:00
|
|
|
get(id: string, withDeleted?: boolean): Promise<LibraryEntity | undefined>;
|
|
|
|
|
create(library: Insertable<Libraries>): Promise<LibraryEntity>;
|
2023-09-20 13:16:33 +02:00
|
|
|
delete(id: string): Promise<void>;
|
|
|
|
|
softDelete(id: string): Promise<void>;
|
2025-01-15 22:01:28 +01:00
|
|
|
update(id: string, library: Updateable<Libraries>): Promise<LibraryEntity>;
|
2024-05-25 06:15:07 -04:00
|
|
|
getStatistics(id: string): Promise<LibraryStatsResponseDto | undefined>;
|
2023-09-20 13:16:33 +02:00
|
|
|
}
|