mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 09:58:12 +00:00
Enhance DTOs and services to support sequence and operational status for coaches and stations
This commit is contained in:
@@ -298,6 +298,7 @@ export class FleetService {
|
||||
arrangement: dto.arrangement,
|
||||
capacity: dto.capacity,
|
||||
status: dto.status,
|
||||
sequence: dto.sequence,
|
||||
},
|
||||
include: { coachType: true },
|
||||
});
|
||||
@@ -306,6 +307,10 @@ export class FleetService {
|
||||
async deleteCoach(id: string) {
|
||||
const coach = await this.prisma.coach.findUnique({ where: { id } });
|
||||
if (!coach) throw new NotFoundException('Coach not found');
|
||||
|
||||
// Delete related seats first
|
||||
await this.prisma.seat.deleteMany({ where: { coachId: id } });
|
||||
|
||||
return this.prisma.coach.delete({ where: { id } });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user