import { FindManyOptions } from 'typeorm';
import { ApprovalRule } from '../entities/approval-rule.entity';

export interface IApprovalRulesRepository {
  findById(id: string): Promise<ApprovalRule | null>;
  findChainForCargo(requiresDirectorApproval: boolean): Promise<ApprovalRule[]>;
  findAll(options?: FindManyOptions<ApprovalRule>): Promise<ApprovalRule[]>;
  findAndCount(options?: FindManyOptions<ApprovalRule>): Promise<[ApprovalRule[], number]>;
  create(data: Partial<ApprovalRule>): Promise<ApprovalRule>;
  update(id: string, data: Partial<ApprovalRule>): Promise<ApprovalRule | null>;
  softDelete(id: string): Promise<void>;
}

export const APPROVAL_RULES_REPOSITORY = Symbol('APPROVAL_RULES_REPOSITORY');
