16 lines
634 B
TypeScript
16 lines
634 B
TypeScript
import { FileEntity, FileStatus } from '../entities/file.entity';
|
|
|
|
/**
|
|
* File Repository Interface
|
|
*/
|
|
export interface IFileRepository {
|
|
save(file: FileEntity): Promise<FileEntity>;
|
|
findById(id: string): Promise<FileEntity | null>;
|
|
findByIdAndUser(id: string, userId: string): Promise<FileEntity | null>;
|
|
findByIdAndUserAndStatus(id: string, userId: string, status: FileStatus): Promise<FileEntity | null>;
|
|
findByUserAndStatus(userId: string, status: FileStatus, conversationId?: string): Promise<FileEntity[]>;
|
|
update(file: FileEntity): Promise<FileEntity>;
|
|
}
|
|
|
|
export const FILE_REPOSITORY = Symbol('IFileRepository');
|