mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 18:20:57 +00:00
add yard distances management to rule engine
- Introduced new yard distances resource with CRUD operations. - Created migration for yard distances table with necessary constraints. - Implemented service and repository for yard distances handling. - Added controller for API endpoints to manage yard distances. - Updated rule engine configuration to include yard distances. - Enhanced rule engine resource page to support yard distance selection. - Updated contracts and train builder pages to handle new yard distance logic. - Added error handling utility for better error message extraction.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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');
|
||||
Reference in New Issue
Block a user