mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
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<Rate | null>;
|
|
findLiveRates(): Promise<Rate[]>;
|
|
/**
|
|
* 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<Rate[]>;
|
|
findByPattern(pattern: {
|
|
rateType: string;
|
|
rateUnit: string;
|
|
containerTypeId?: string | null;
|
|
cargoTypeId?: string | null;
|
|
tradeDirection?: string | null;
|
|
originYardId?: string | null;
|
|
destinationYardId?: string | null;
|
|
}): Promise<Rate | null>;
|
|
findAll(options?: FindManyOptions<Rate>): Promise<Rate[]>;
|
|
findAndCount(options?: FindManyOptions<Rate>): Promise<[Rate[], number]>;
|
|
findPaged(query: ListRatesQueryDto): Promise<PaginatedResponse<Rate>>;
|
|
create(data: Partial<Rate>): Promise<Rate>;
|
|
update(id: string, data: Partial<Rate>): Promise<Rate | null>;
|
|
softDelete(id: string): Promise<void>;
|
|
}
|
|
|
|
export const RATES_REPOSITORY = Symbol('RATES_REPOSITORY');
|