Task: "Create Handle Recurring Bookings Api" Description: "Generate a Node.js…
- User
User: Task: "Create Handle Recurring Bookings Api" Description: "Generate a Node.js Handle Recurring Bookings Api with given dependenceis" Requirements: - Database: mongoose - Output needed: Return only the function code as specified in dependencies
- Dependencies: Create a Api to manage recurring bookings. Export: exports.createRecurringBooking = async () => {...},Accept data from user: startDate, endDate, frequency (e.g., weekly, monthly), roomId., Validate required fields: Ensure startDate, endDate, frequency, and roomId are provided., Use a scheduling library (e.g., node-cron) to generate recurring booking dates based on the frequency., Check availability for each recurring date using the checkAvailability function., Create bookings for each recurring date and link them to the same user or service., Respond to user with a success message containing the booking details for each occurrence., Handle errors like conflicting bookings, invalid parameters, or database issues.
- Supporting data Please generate the code for this task, following the instructions and including comments for clarity. While creating router for specifict file your have to read supporing file data and create for thatUser:
Assistant:
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.