Merge pull request #1276 from Tria-plc/alpha

feat: ( reports ) add fleet seat overview to seat status landing page
This commit is contained in:
Abubeker Yasin
2026-08-13 15:34:25 +03:00
committed by GitHub
4 changed files with 872 additions and 7 deletions

View File

@@ -60,6 +60,23 @@ export class ReportsController {
return this.service.getSeatStatusReport(scheduleId);
}
// Two segments, so `@Get(":reportId")` below cannot shadow it whatever the order.
@Get("seat-status/overview")
@ApiOperation({
summary: "Fleet-wide seat status across a departure window",
description:
"Landing view for the seat status report, shown before a schedule is picked. Returns the same four " +
"counters as the per-schedule report (paid, unpaid, expired holds, blocked) rolled up over a window of " +
"departures, plus per-day buckets and one row per schedule.\n\n" +
"The window is forward-looking — the next `days` days. If nothing is departing in that window, it falls " +
"back to the most recent `days` of departures on record and says so via `window.direction`.\n\n" +
"Counts apply the same rules as `GET /reports/seat-status`, so a schedule's row here equals what the " +
"drill-down shows after selecting it.",
})
getSeatStatusOverview(@Query('days') days?: string) {
return this.service.getSeatStatusOverview(days ? Number(days) : undefined);
}
@Get("boarding")
@ApiOperation({ summary: "Boarding report for a schedule — boarded vs not-boarded passengers" })
getBoardingReport(@Query('scheduleId') scheduleId: string) {