import { IAbstractEntity } from '../../../../domain'; import { EntityTarget } from '../entity-target.type'; import { ObjectLiteral } from '../object-literal.interface'; export interface ITransaction { startTransaction(): Promise; rollbackTransaction(): Promise; commitTransaction(): Promise; save(entity: T): Promise; saveMany(entities: T[]): Promise; update(entity: EntityTarget, id: string, obj: T): Promise; findOneBy(entity: EntityTarget, options: FindOptionsWhere): Promise; } export type FindOptionsWhere = { [P in keyof Entity]?: P extends 'toString' ? unknown : any; };