import { PaginatedResponse } from '@edr/types';
import { ListYardDistancesQueryDto } from '../dto/list-rule-engine-query.dto';
import { YardDistance } from '../entities/yard-distance.entity';

export interface IYardDistancesRepository {
  findById(id: string): Promise<YardDistance | null>;
  /** Exact or reverse pair — distances are symmetric (A→B serves B→A). */
  findBetween(fromYardId: string, toYardId: string): Promise<YardDistance | null>;
  /** All rows touching any of the given yards, for batch segment lookups. */
  findTouchingYards(yardIds: string[]): Promise<YardDistance[]>;
  findPaged(query: ListYardDistancesQueryDto): Promise<PaginatedResponse<YardDistance>>;
  create(data: Partial<YardDistance>): Promise<YardDistance>;
  update(id: string, data: Partial<YardDistance>): Promise<YardDistance | null>;
  softDelete(id: string): Promise<void>;
}

export const YARD_DISTANCES_REPOSITORY = Symbol('YARD_DISTANCES_REPOSITORY');
