mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 08:25:43 +00:00
Adding train delay minutes and also disabling no schedule days in the booking selection
This commit is contained in:
@@ -2,7 +2,7 @@ import { Body, Controller, Post, Get, Query } from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation, ApiResponse, ApiQuery } from '@nestjs/swagger';
|
||||
import { IsPublic } from '@tria-plc/api-common/modules/auth/decorators/public.decorator';
|
||||
import { SearchService } from './search.service';
|
||||
import { SearchTripsDto, FareQuoteDto, FareBreakdownRequestDto } from './search.dto';
|
||||
import { SearchTripsDto, FareQuoteDto, FareBreakdownRequestDto, AvailableDatesQueryDto } from './search.dto';
|
||||
|
||||
@ApiTags('Search')
|
||||
@Controller('search')
|
||||
@@ -67,6 +67,21 @@ Nationality-Based:
|
||||
return this.service.getFareQuote(dto);
|
||||
}
|
||||
|
||||
@Get('available-dates')
|
||||
@ApiOperation({
|
||||
summary: 'Which dates in a range have a bookable schedule for an origin/destination pair',
|
||||
description: `Used to disable schedule-less dates on the search date picker before the user submits a search.
|
||||
|
||||
For each date in the (server-clamped, max 90-day) range, a date is "available" if at least one
|
||||
schedule exists for the origin→destination pair whose status/package/coach state is bookable and
|
||||
whose check-in cutoff has not yet passed. This does not check seat-level availability — a date
|
||||
can be marked available and still turn out fully booked when actually searched.`,
|
||||
})
|
||||
@ApiResponse({ status: 200, description: 'routeExists flag plus a per-date availability list' })
|
||||
getAvailableDates(@Query() dto: AvailableDatesQueryDto) {
|
||||
return this.service.getAvailableDates(dto);
|
||||
}
|
||||
|
||||
@Get('fare-breakdown')
|
||||
@ApiOperation({
|
||||
summary: 'Per-passenger fare breakdown for booking review page',
|
||||
|
||||
Reference in New Issue
Block a user