Production checklists, issue fixes

This commit is contained in:
Stephanos A
2026-07-01 15:04:38 +03:00
parent 0015f645cf
commit 103117d88b
20 changed files with 100 additions and 200 deletions

View File

@@ -33,8 +33,11 @@ export class StationsService {
where.countryCode = filters.country;
}
// Default to operational stations only; allow explicit override (e.g. back-office)
if (filters.operational !== undefined && filters.operational !== '') {
where.isOperational = filters.operational === 'true';
} else {
where.isOperational = true;
}
return this.prisma.station.findMany({
@@ -46,6 +49,7 @@ export class StationsService {
async findOne(id: string) {
const s = await this.prisma.station.findUnique({ where: { id } });
if (!s) throw new NotFoundException('Station not found');
if (!s.isOperational) throw new NotFoundException('Station is not operational');
return s;
}