mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 04:08:11 +00:00
Boarding, payment methods, journey direction on seat hold, and more updates
This commit is contained in:
@@ -33,7 +33,7 @@ export class SeatsController {
|
||||
@SetMetadata('isPublic', true)
|
||||
@ApiOperation({
|
||||
summary: "Get seat map filtered by coach type",
|
||||
description: `Returns all coaches of the given coachTypeId assigned to the schedule, each with their full seat list and real-time availability. Origin and destination are derived from the schedule. Omit coachTypeId to get all coaches.`,
|
||||
description: `Returns all coaches of the given coachTypeId assigned to the schedule, each with their full seat list and real-time availability. Origin and destination are derived from the schedule. Omit coachTypeId to get all coaches. Use journeyDirection to filter seat holds (OUTBOUND vs RETURN for round-trip bookings).`,
|
||||
})
|
||||
@ApiParam({ name: "scheduleId", description: "TrainSchedule UUID" })
|
||||
@ApiQuery({
|
||||
@@ -42,6 +42,23 @@ export class SeatsController {
|
||||
description:
|
||||
"Filter by CoachType UUID — returns all coaches of that type (e.g. all Economy coaches)",
|
||||
})
|
||||
@ApiQuery({
|
||||
name: "journeyDirection",
|
||||
required: false,
|
||||
enum: ['ONE_WAY', 'OUTBOUND', 'RETURN'],
|
||||
description:
|
||||
"Journey direction for round-trip bookings. Filters seat holds to show only conflicting holds. Use OUTBOUND for outbound leg, RETURN for return leg. Defaults to ONE_WAY (shows all holds).",
|
||||
})
|
||||
@ApiQuery({
|
||||
name: "originStationId",
|
||||
required: false,
|
||||
description: "Origin station UUID for segment-specific seat availability",
|
||||
})
|
||||
@ApiQuery({
|
||||
name: "destinationStationId",
|
||||
required: false,
|
||||
description: "Destination station UUID for segment-specific seat availability",
|
||||
})
|
||||
@ApiResponse({
|
||||
status: 200,
|
||||
description:
|
||||
@@ -50,8 +67,17 @@ export class SeatsController {
|
||||
getSeatMap(
|
||||
@Param("scheduleId") scheduleId: string,
|
||||
@Query("coachTypeId") coachTypeId?: string,
|
||||
@Query("journeyDirection") journeyDirection?: string,
|
||||
@Query("originStationId") originStationId?: string,
|
||||
@Query("destinationStationId") destinationStationId?: string,
|
||||
) {
|
||||
return this.service.getSeatMap(scheduleId, coachTypeId);
|
||||
return this.service.getSeatMap(
|
||||
scheduleId,
|
||||
coachTypeId,
|
||||
journeyDirection as any,
|
||||
originStationId,
|
||||
destinationStationId
|
||||
);
|
||||
}
|
||||
|
||||
// ── Hold / Release ────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user