feat: add recurring booking management functionality
- Implemented API endpoints for listing and updating recurring booking groups. - Added handlers for listing and updating recurring groups in the backend. - Created frontend components for displaying and editing recurring bookings. - Enhanced booking provider to manage recurring groups and their states. - Updated API client to include new methods for recurring bookings. - Introduced new validation schemas for updating recurring groups. - Added UI elements for managing recurring bookings in the booking interface.
This commit is contained in:
@@ -17,5 +17,7 @@ export {
|
||||
createAdmin,
|
||||
createRecurring,
|
||||
cancelRecurringGroup,
|
||||
listRecurringGroups,
|
||||
updateRecurringGroup,
|
||||
updateStatus,
|
||||
} from './resources/bookings';
|
||||
|
||||
@@ -3,11 +3,13 @@ import type {
|
||||
CancelPublicBookingInput,
|
||||
CreateAdminBookingInput,
|
||||
CreatePublicBookingInput,
|
||||
ListRecurringGroupsResponse,
|
||||
PublicAvailabilityResponse,
|
||||
PublicBooking,
|
||||
PublicBookingConfirmation,
|
||||
RecurringBookingGroup,
|
||||
UpdateAdminBookingStatusInput,
|
||||
UpdateRecurringGroupInput,
|
||||
} from '@repo/api-contract';
|
||||
import type { CreateRecurringBookingInput } from '@repo/api-contract';
|
||||
import { http } from '../http';
|
||||
@@ -69,6 +71,21 @@ export async function cancelRecurringGroup(groupId: string) {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function listRecurringGroups(complexId: string) {
|
||||
const response = await http.get<ListRecurringGroupsResponse>(
|
||||
`/api/admin-bookings/complex/${complexId}/recurring`
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function updateRecurringGroup(groupId: string, payload: UpdateRecurringGroupInput) {
|
||||
const response = await http.patch<RecurringBookingGroup>(
|
||||
`/api/admin-bookings/recurring/${groupId}`,
|
||||
payload
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function cancelPublic(complexSlug: string, payload: CancelPublicBookingInput) {
|
||||
const response = await http.post<PublicBooking>(
|
||||
`/api/public-bookings/complex/${complexSlug}/cancel`,
|
||||
|
||||
Reference in New Issue
Block a user