mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 23:35:42 +00:00
Adding seat blocking revenue loss dashboard
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
Post,
|
||||
Patch,
|
||||
Query,
|
||||
Req,
|
||||
SetMetadata,
|
||||
UseGuards,
|
||||
} from "@nestjs/common";
|
||||
@@ -20,7 +21,8 @@ import {
|
||||
ApiBody,
|
||||
} from "@nestjs/swagger";
|
||||
import { SeatsService } from "./seats.service";
|
||||
import { HoldSeatsDto, ReleaseHoldDto } from "./seats.dto";
|
||||
import { BlockSeatDto, HoldSeatsDto, ReleaseHoldDto, SetMaintenanceDto } from "./seats.dto";
|
||||
import { resolveActingUser, RequestWithActingUser } from "../../common/acting-user";
|
||||
import { GetDuplicateSeatsQuery, ResolveDuplicatesDto } from "./duplicate-seats.dto";
|
||||
import { JwtGuard } from "../../common/jwt.guard";
|
||||
import { PassengerStaff } from "../../common/passenger-guards";
|
||||
@@ -220,11 +222,22 @@ This makes it clear which segment of the route each seat is held for, enabling s
|
||||
@Post(":seatId/block")
|
||||
@PassengerStaff([PASSENGER_PERMS.seats.manage, PASSENGER_PERMS.admin])
|
||||
@ApiBearerAuth("IAM-auth")
|
||||
@ApiOperation({ summary: "Block a seat (e.g., maintenance, damage)" })
|
||||
@ApiOperation({
|
||||
summary: "Block a seat (e.g., maintenance, damage)",
|
||||
description:
|
||||
"The authenticated staff member is recorded as the blocker — their IAM id in `blockedBy` and their " +
|
||||
"display name in `blockedByName` — so the Blocked Seat Revenue Loss report can attribute the block " +
|
||||
"without a cross-service lookup.",
|
||||
})
|
||||
@ApiParam({ name: "seatId", description: "Seat UUID" })
|
||||
@ApiBody({ type: BlockSeatDto })
|
||||
@ApiResponse({ status: 200, description: "Seat blocked" })
|
||||
blockSeat(@Param("seatId") seatId: string, @Body() body: { reason: string; scheduleId?: string }) {
|
||||
return this.service.blockSeat(seatId, body.reason, body.scheduleId);
|
||||
blockSeat(
|
||||
@Param("seatId") seatId: string,
|
||||
@Body() body: BlockSeatDto,
|
||||
@Req() req: RequestWithActingUser,
|
||||
) {
|
||||
return this.service.blockSeat(seatId, body, resolveActingUser(req));
|
||||
}
|
||||
|
||||
@Delete(":seatId/block")
|
||||
@@ -243,9 +256,14 @@ This makes it clear which segment of the route each seat is held for, enabling s
|
||||
@ApiBearerAuth("IAM-auth")
|
||||
@ApiOperation({ summary: "Set seat status to Under Maintenance" })
|
||||
@ApiParam({ name: "seatId", description: "Seat UUID" })
|
||||
@ApiBody({ type: SetMaintenanceDto })
|
||||
@ApiResponse({ status: 200, description: "Seat set to under maintenance" })
|
||||
setMaintenance(@Param("seatId") seatId: string, @Body() body: { reason: string }) {
|
||||
return this.service.setMaintenance(seatId, body.reason);
|
||||
setMaintenance(
|
||||
@Param("seatId") seatId: string,
|
||||
@Body() body: SetMaintenanceDto,
|
||||
@Req() req: RequestWithActingUser,
|
||||
) {
|
||||
return this.service.setMaintenance(seatId, body.reason, resolveActingUser(req));
|
||||
}
|
||||
|
||||
@Delete(":seatId/maintenance")
|
||||
|
||||
Reference in New Issue
Block a user