mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
Ticket generation issue resolution
This commit is contained in:
@@ -32,17 +32,6 @@ export class TicketsController {
|
||||
return this.service.generate(bookingId);
|
||||
}
|
||||
|
||||
@Post('force-generate/:bookingId')
|
||||
@PassengerStaff(PASSENGER_PERMS.tickets.generate)
|
||||
@ApiBearerAuth('IAM-auth')
|
||||
@ApiOperation({
|
||||
summary: 'Force-generate ticket for booking (staff only)',
|
||||
description: 'Staff override: regenerates tickets for a confirmed booking regardless of prior state.'
|
||||
})
|
||||
forceGenerateTicket(@Param('bookingId') bookingId: string) {
|
||||
return this.service.generate(bookingId);
|
||||
}
|
||||
|
||||
@Patch('update-seats/:bookingId')
|
||||
@SetMetadata('isPublic', true)
|
||||
@ApiOperation({
|
||||
|
||||
@@ -81,15 +81,6 @@ function BookingsPageContent() {
|
||||
const forceConfirmMutation = useMutation({
|
||||
mutationFn: ({ bookingId, data }: { bookingId: string; data: { paymentReference?: string; paymentMethod?: string; notes?: string } }) =>
|
||||
bookingsApi.forceConfirm(bookingId, data),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['bookings'] });
|
||||
setSuccessMessage('Payment confirmed and ticket generated successfully');
|
||||
setTimeout(() => setSuccessMessage(''), 4000);
|
||||
setSelectedBooking(null);
|
||||
setGenerateTicketBooking(null);
|
||||
setGenerateTicketForm({ paymentReference: '', paymentMethod: '', notes: '' });
|
||||
setGenerateTicketTouched({ paymentReference: false, paymentMethod: false });
|
||||
},
|
||||
});
|
||||
|
||||
const deleteMutation = useMutation({
|
||||
@@ -649,7 +640,13 @@ function BookingsPageContent() {
|
||||
setGenerateTicketTouched({ paymentReference: true, paymentMethod: true });
|
||||
if (!generateTicketForm.paymentReference || !generateTicketForm.paymentMethod) return;
|
||||
forceConfirmMutation.reset();
|
||||
smartAssignMutation.mutate(generateTicketBooking.id);
|
||||
smartAssignMutation.reset();
|
||||
forceConfirmMutation.mutate(
|
||||
{ bookingId: generateTicketBooking.id, data: { paymentReference: generateTicketForm.paymentReference, paymentMethod: generateTicketForm.paymentMethod, notes: generateTicketForm.notes } },
|
||||
{
|
||||
onSuccess: () => smartAssignMutation.mutate(generateTicketBooking.id),
|
||||
},
|
||||
);
|
||||
}}
|
||||
disabled={forceConfirmMutation.isPending || smartAssignMutation.isPending}
|
||||
>
|
||||
|
||||
@@ -48,8 +48,6 @@ export const bookingsApi = {
|
||||
apiClient.post<any>(`/payments/${bookingId}/force-confirm`, data),
|
||||
smartAssign: (bookingId: string) =>
|
||||
apiClient.post<any>(`/tickets/smart-assign/${bookingId}`, {}),
|
||||
forceGenerate: (bookingId: string) =>
|
||||
apiClient.post<any>(`/tickets/force-generate/${bookingId}`, {}),
|
||||
};
|
||||
|
||||
// Passengers API
|
||||
|
||||
Reference in New Issue
Block a user