From eba09c73ae4f6408679d967e943213bca9d72b09 Mon Sep 17 00:00:00 2001 From: Nathnael Date: Mon, 24 Aug 2026 08:21:29 +0000 Subject: [PATCH] fix: locomotive filtering --- .../reports/definitions/locomotive-fleet-status.report.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/edr-freight-api/src/modules/reports/definitions/locomotive-fleet-status.report.ts b/apps/edr-freight-api/src/modules/reports/definitions/locomotive-fleet-status.report.ts index cf971cf2c..a9e74039d 100644 --- a/apps/edr-freight-api/src/modules/reports/definitions/locomotive-fleet-status.report.ts +++ b/apps/edr-freight-api/src/modules/reports/definitions/locomotive-fleet-status.report.ts @@ -12,7 +12,10 @@ function baseQuery(ctx: ReportContext): SelectQueryBuilder { .createQueryBuilder() .from(Locomotive, 'l') .leftJoin(Yard, 'y', 'y.id = l.current_yard_id') - .where('l.deleted_at IS NULL'); + .where('l.deleted_at IS NULL') + // Names ending '#' are excluded from the fleet report by request; the + // marker is a roster convention, not a column the schema tracks. + .andWhere("COALESCE(l.name, '') NOT LIKE '%#'"); const statuses = params.statuses as string[] | null; if (statuses) qb.andWhere('l.status IN (:...statuses)', { statuses });