mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 21:15:41 +00:00
Seats report, supplementary change for bookings added
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user