Adding train delay minutes and also disabling no schedule days in the booking selection

This commit is contained in:
Muluhabt
2026-07-27 14:42:57 +03:00
parent d175514f85
commit d71f6dc1b3
19 changed files with 845 additions and 54 deletions

View File

@@ -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',