First passenger and back office portal commit

This commit is contained in:
Stephanos A
2026-05-31 13:15:44 +03:00
parent a0b5eb1e92
commit 5059a1fe58
181 changed files with 14249 additions and 13949 deletions

View File

@@ -55,16 +55,16 @@ This makes it clear which segment of the route each seat is held for, enabling s
getHold(@Param('holdId') holdId: string) { return this.service.getHold(holdId); }
@Post('hold')
@UseGuards(JwtGuard) @ApiBearerAuth('JWT-auth')
@ApiOperation({
summary: 'Hold seats for 15 minutes before booking',
summary: 'Hold seats for 15 minutes before booking (Public - Guest booking supported)',
description: `Temporarily reserves seats for a passenger to complete booking.
**Features:**
- 15-minute hold duration
- Auto-release after expiry
- Prevents double booking
- Required before creating booking`
- Required before creating booking
- **Public endpoint** - No authentication required (supports guest booking)`
})
@ApiResponse({ status: 201, description: 'Seats held successfully with holdId' })
@ApiResponse({ status: 409, description: 'One or more seats unavailable' })

View File

@@ -104,7 +104,7 @@ export class SeatsService {
if (new Set(seatIds).size !== seatIds.length)
throw new BadRequestException('Duplicate seatId in passengers list — each seat can only be assigned to one passenger');
const expiresAt = new Date(Date.now() + 15 * 60 * 1000);
const expiresAt = new Date(Date.now() + 5 * 60 * 1000);
const hold = await this.prisma.$transaction(async (tx) => {
// ── 1. Validate seats exist and none are BLOCKED ─────────────────────