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 });