Tour package booking, app release, new endpoints, more updates and fixes

This commit is contained in:
Stephanos A
2026-07-05 00:28:06 +03:00
parent 868639084c
commit 595be6e123
68 changed files with 2773 additions and 787 deletions

View File

@@ -1,6 +1,7 @@
import {
Body,
Controller,
Delete,
Get,
HttpStatus,
Param,
@@ -42,6 +43,14 @@ import { PASSENGER_PERMS } from "../../seed/passenger-permissions.registry";
export class PaymentsController {
constructor(private service: PaymentsService) {}
@Delete(":id")
@PassengerStaff([PASSENGER_PERMS.admin])
@ApiBearerAuth("IAM-auth")
@ApiOperation({ summary: "Delete a payment intent record (admin only)" })
deletePayment(@Param("id") id: string) {
return this.service.deletePayment(id);
}
@Get("all")
@PassengerStaff([PASSENGER_PERMS.payments.viewAll, PASSENGER_PERMS.admin])
@ApiBearerAuth("IAM-auth")

View File

@@ -55,6 +55,13 @@ export class PaymentsService {
private currencyService: CurrencyService,
) {}
async deletePayment(id: string) {
const intent = await this.prisma.paymentIntent.findUnique({ where: { id } });
if (!intent) throw new NotFoundException('Payment intent not found');
await this.prisma.paymentIntent.delete({ where: { id } });
return { deleted: true, id };
}
async getAll(filters: {
search?: string;
status?: string;