mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 00:38:11 +00:00
feat: add pagination to schedule history and consolidation approvals
- Implemented pagination in ScheduleHistoryPanel to manage large history entries. - Updated API to support pagination parameters for schedule history. - Enhanced ConsolidationApprovalsPage with tabbed navigation and pagination for approval rows. - Introduced new types for paginated responses in bookings and train scheduling services. - Added a database migration to create an index on wagon_booking_allocations for performance improvements.
This commit is contained in:
@@ -18,6 +18,30 @@ export class TrainSchedulesRepository extends BaseRepository<TrainSchedule> {
|
||||
return manager ? manager.getRepository(TrainSchedule) : this.repository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Slim consist view for read paths that only need the route stops, the
|
||||
* built train, and slot→allocation existence (e.g. the schedule-yards tab):
|
||||
* skips the booking/company/container branches of the full graph, which
|
||||
* dominate its cost and go unused there.
|
||||
*/
|
||||
findByIdWithConsistLite(id: string): Promise<TrainSchedule | null> {
|
||||
return this.repository.findOne({
|
||||
where: { id },
|
||||
relationLoadStrategy: 'query',
|
||||
relations: {
|
||||
route: { milestones: { yard: true } },
|
||||
trainSet: {
|
||||
train: true,
|
||||
locomotive: true,
|
||||
locomotives: { locomotive: true },
|
||||
wagons: { allocations: true },
|
||||
},
|
||||
originStation: true,
|
||||
destinationStation: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
findByIdWithFullGraph(id: string, manager?: EntityManager): Promise<TrainSchedule | null> {
|
||||
return this.repo(manager).findOne({
|
||||
where: { id },
|
||||
|
||||
Reference in New Issue
Block a user