Seats report, supplementary change for bookings added

This commit is contained in:
Stephanos A
2026-07-16 11:43:04 +03:00
parent 3bc492ea83
commit a852b4e619
15 changed files with 1392 additions and 176 deletions

View File

@@ -184,6 +184,25 @@ export const paymentsApi = {
addMethod: (data: any) => apiClient.post('/payments/methods', data),
updateMethod: (id: string, data: any) => apiClient.patch(`/payments/methods/${id}`, data),
deleteMethod: (id: string) => apiClient.delete(`/payments/methods/${id}`),
supplementary: {
create: (data: { bookingRef: string; amountMinor: number; reason: string; notes?: string }) =>
apiClient.post<any>('/payments/supplementary', data),
getAll: async (params?: any) => {
const cleanParams = Object.fromEntries(
Object.entries(params || {}).filter(([, v]) => v !== '' && v !== undefined && v !== null)
) as Record<string, string>;
const query = new URLSearchParams(cleanParams).toString();
const response = await apiClient.get<any>(`/payments/supplementary${query ? `?${query}` : ''}`);
if ((response as any)?.data) return (response as any).data;
return response;
},
markPaid: (id: string, providerTxnId?: string) =>
apiClient.post<any>(`/payments/supplementary/${id}/mark-paid`, { providerTxnId }),
waive: (id: string, notes?: string) =>
apiClient.post<any>(`/payments/supplementary/${id}/waive`, { notes }),
resend: (id: string) =>
apiClient.post<any>(`/payments/supplementary/${id}/resend`, {}),
},
};
// Tickets API