mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 00:10:57 +00:00
Refactor business logic for train,schedule,coach,seat and search modules
This commit is contained in:
@@ -32,12 +32,12 @@ export class SegmentSeatsController {
|
||||
@ApiResponse({ status: 409, description: 'Seats not available for requested segments' })
|
||||
async holdSeats(@Body() dto: HoldSeatsDto) {
|
||||
return this.enhancedSeatsService.holdSeats({
|
||||
tripId: dto.tripId,
|
||||
scheduleId: dto.scheduleId,
|
||||
seatIds: dto.seatIds,
|
||||
passengerId: dto.passengerId,
|
||||
originStationId: dto.originStationId,
|
||||
destinationStationId: dto.destinationStationId,
|
||||
fareQuoteId: dto.fareQuoteId
|
||||
fareQuoteId: dto.fareQuoteId,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ export class SegmentSeatsController {
|
||||
}
|
||||
})
|
||||
async releaseSeats(@Body() dto: ReleaseSeatsDto) {
|
||||
return this.enhancedSeatsService.releaseSeats(dto.tripId, dto.currentStationId);
|
||||
return this.enhancedSeatsService.releaseSeats(dto.scheduleId, dto.currentStationId);
|
||||
}
|
||||
|
||||
@Get('availability')
|
||||
@@ -100,19 +100,15 @@ export class SegmentSeatsController {
|
||||
{ fromName: 'Adama', toName: 'Awash', fromSequence: 1, toSequence: 2 }
|
||||
],
|
||||
availableSeats: [
|
||||
{ id: 'seat_1', label: '1A', coach: 'A', serviceClass: 'ECONOMY', row: 1, col: 'A' },
|
||||
{ id: 'seat_2', label: '1B', coach: 'A', serviceClass: 'ECONOMY', row: 1, col: 'B' }
|
||||
{ id: 'seat_1', label: '1A', coach: 'A', seatClass: 'Economy Regular', row: 1, col: 'A' },
|
||||
{ id: 'seat_2', label: '1B', coach: 'A', seatClass: 'Economy Regular', row: 1, col: 'B' }
|
||||
],
|
||||
totalAvailable: 2
|
||||
}
|
||||
}
|
||||
})
|
||||
async getSeatAvailability(@Query() dto: SeatAvailabilityDto) {
|
||||
return this.enhancedSeatsService.getSeatAvailability(
|
||||
dto.tripId,
|
||||
dto.originStationId,
|
||||
dto.destinationStationId
|
||||
);
|
||||
return this.enhancedSeatsService.getSeatAvailability(dto.scheduleId, dto.originStationId, dto.destinationStationId);
|
||||
}
|
||||
|
||||
@Post('expire-holds')
|
||||
|
||||
Reference in New Issue
Block a user