Boarding, payment methods, journey direction on seat hold, and more updates

This commit is contained in:
Stephanos A
2026-06-29 08:44:38 +03:00
parent 81ae99cee3
commit c6e56d1c4f
65 changed files with 6437 additions and 1425 deletions

View File

@@ -91,6 +91,12 @@ export class ExcessBaggageAgentController {
deleteAllowance(@Param('id') id: string) {
return this.service.deleteAllowance(id);
}
@Delete(':id')
@ApiOperation({ summary: 'Delete excess baggage charge (admin only)' })
deleteCharge(@Param('id') id: string) {
return this.service.deleteCharge(id);
}
}
// ── Public pay-by-token routes (passenger self-service) ──────────────────────

View File

@@ -252,6 +252,15 @@ export class ExcessBaggageService {
};
}
// Mark expired charges before fetching
await this.prisma.excessBaggageCharge.updateMany({
where: {
status: 'PENDING',
expiresAt: { lt: new Date() },
},
data: { status: 'EXPIRED' },
});
const [items, total] = await Promise.all([
this.prisma.excessBaggageCharge.findMany({
where,
@@ -291,4 +300,12 @@ export class ExcessBaggageService {
await this.prisma.baggageAllowance.delete({ where: { id } });
return { deleted: true };
}
async deleteCharge(id: string) {
const charge = await this.prisma.excessBaggageCharge.findUnique({ where: { id } });
if (!charge) throw new NotFoundException('Charge not found');
await this.prisma.excessBaggageCharge.delete({ where: { id } });
return { deleted: true };
}
}