mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 19:28:17 +00:00
Package booking new rules update, cascade delete option updates
This commit is contained in:
@@ -61,6 +61,7 @@ export const passengersApi = {
|
||||
},
|
||||
getById: (id: string) => apiClient.get<any>(`/passengers/${id}`),
|
||||
verify: (nationalId: string) => apiClient.post<any>('/passengers/verify-fayda', { nationalId }),
|
||||
delete: (id: string, cascade?: boolean) => apiClient.delete(`/passengers/${id}${cascade ? '?cascade=true' : ''}`),
|
||||
};
|
||||
// Stations API
|
||||
export const stationsApi = {
|
||||
@@ -79,7 +80,7 @@ export const stationsApi = {
|
||||
getById: (id: string) => apiClient.get<any>(`/stations/${id}`),
|
||||
create: (data: any) => apiClient.post<any>('/stations', data),
|
||||
update: (id: string, data: any) => apiClient.patch<any>(`/stations/${id}`, data),
|
||||
delete: (id: string) => apiClient.delete(`/stations/${id}`),
|
||||
delete: (id: string, cascade?: boolean) => apiClient.delete(`/stations/${id}${cascade ? '?cascade=true' : ''}`),
|
||||
};
|
||||
|
||||
// Fleet API
|
||||
@@ -108,11 +109,11 @@ export const fleetApi = {
|
||||
},
|
||||
createTrain: (data: any) => apiClient.post<any>('/fleet/trains', data),
|
||||
updateTrain: (id: string, data: any) => apiClient.patch<any>(`/fleet/trains/${id}`, data),
|
||||
deleteTrain: (id: string) => apiClient.delete(`/fleet/trains/${id}`),
|
||||
deleteTrain: (id: string, cascade?: boolean) => apiClient.delete(`/fleet/trains/${id}${cascade ? '?cascade=true' : ''}`),
|
||||
restoreTrain: (id: string) => apiClient.patch<any>(`/fleet/trains/${id}/restore`, {}),
|
||||
createCoach: (data: any) => apiClient.post<any>('/fleet/coaches', data),
|
||||
updateCoach: (id: string, data: any) => apiClient.patch<any>(`/fleet/coaches/${id}`, data),
|
||||
deleteCoach: (id: string) => apiClient.delete(`/fleet/coaches/${id}`),
|
||||
deleteCoach: (id: string, cascade?: boolean) => apiClient.delete(`/fleet/coaches/${id}${cascade ? '?cascade=true' : ''}`),
|
||||
generateSeatMap: (data: any) => apiClient.post<any>('/fleet/seatmap/generate', data),
|
||||
};
|
||||
|
||||
@@ -362,7 +363,7 @@ export const seatClassesApi = {
|
||||
getById: (id: string) => apiClient.get<any>(`/fleet/classes/${id}`),
|
||||
create: (data: any) => apiClient.post<any>('/fleet/classes', data),
|
||||
update: (id: string, data: any) => apiClient.patch<any>(`/fleet/classes/${id}`, data),
|
||||
delete: (id: string) => apiClient.delete(`/fleet/classes/${id}`),
|
||||
delete: (id: string, cascade?: boolean) => apiClient.delete(`/fleet/classes/${id}${cascade ? '?cascade=true' : ''}`),
|
||||
};
|
||||
|
||||
// Food & Dining API
|
||||
@@ -409,7 +410,7 @@ export const packagesApi = {
|
||||
update: (id: string, data: any) => apiClient.patch<any>(`/packages/${id}`, data),
|
||||
activate: (id: string) => apiClient.patch<any>(`/packages/${id}/activate`, {}),
|
||||
deactivate: (id: string) => apiClient.patch<any>(`/packages/${id}/deactivate`, {}),
|
||||
remove: (id: string) => apiClient.delete(`/packages/${id}`),
|
||||
remove: (id: string, cascade?: boolean) => apiClient.delete(`/packages/${id}${cascade ? '?cascade=true' : ''}`),
|
||||
getBookings: async (params?: any) => {
|
||||
const cleanParams = Object.fromEntries(
|
||||
Object.entries(params || {}).filter(([_, value]) => value !== '' && value !== undefined && value !== null)
|
||||
|
||||
@@ -30,8 +30,8 @@ export const routesApi = {
|
||||
return apiClient.patch<Route>(`/routes/${id}`, data);
|
||||
},
|
||||
|
||||
delete: (id: string) => {
|
||||
return apiClient.delete(`/routes/${id}`);
|
||||
delete: (id: string, cascade?: boolean) => {
|
||||
return apiClient.delete(`/routes/${id}${cascade ? '?cascade=true' : ''}`);
|
||||
},
|
||||
|
||||
getFareRules: (routeId: string) => {
|
||||
|
||||
Reference in New Issue
Block a user