2025-01-13 22:22:03 -06:00
|
|
|
import { Insertable, Updateable } from 'kysely';
|
|
|
|
|
import { MoveHistory } from 'src/db';
|
2024-09-27 10:28:42 -04:00
|
|
|
import { MoveEntity } from 'src/entities/move.entity';
|
|
|
|
|
import { PathType } from 'src/enum';
|
2023-10-11 04:14:44 +02:00
|
|
|
|
|
|
|
|
export const IMoveRepository = 'IMoveRepository';
|
|
|
|
|
|
|
|
|
|
export type MoveCreate = Pick<MoveEntity, 'oldPath' | 'newPath' | 'entityId' | 'pathType'> & Partial<MoveEntity>;
|
|
|
|
|
|
|
|
|
|
export interface IMoveRepository {
|
2025-01-13 22:22:03 -06:00
|
|
|
create(entity: Insertable<MoveHistory>): Promise<MoveEntity>;
|
|
|
|
|
getByEntity(entityId: string, pathType: PathType): Promise<MoveEntity | undefined>;
|
|
|
|
|
update(id: string, entity: Updateable<MoveHistory>): Promise<MoveEntity>;
|
|
|
|
|
delete(id: string): Promise<MoveEntity>;
|
2023-10-11 04:14:44 +02:00
|
|
|
}
|