import { PaginatedResponse } from '@edr/types'; import { FindManyOptions } from 'typeorm'; import { ListRatesQueryDto } from '../dto/list-rule-engine-query.dto'; import { Rate } from '../entities/rate.entity'; export interface IRatesRepository { findById(id: string): Promise; findLiveRates(): Promise; /** * LIVE rates with the yard / container / cargo relations eagerly joined, so * lanes can be rendered with human labels (contract rate schedule). Ordered * for a stable, readable schedule table. */ findLiveRatesDetailed(): Promise; findByPattern(pattern: { rateType: string; rateUnit: string; containerTypeId?: string | null; cargoTypeId?: string | null; tradeDirection?: string | null; originYardId?: string | null; destinationYardId?: string | null; }): Promise; findAll(options?: FindManyOptions): Promise; findAndCount(options?: FindManyOptions): Promise<[Rate[], number]>; findPaged(query: ListRatesQueryDto): Promise>; create(data: Partial): Promise; update(id: string, data: Partial): Promise; softDelete(id: string): Promise; } export const RATES_REPOSITORY = Symbol('RATES_REPOSITORY');