I’m building a website to connect people to businesses that collect christmas trees.
I’ve managed to setup a large bulk of this project so far, but where I’m a bit confused is the best way to setup the ‘availability’ side of things for businesses.
If you look at this screenshot below, you can see that I’ve come up with a basic interface for the ‘availability’ settings, but because I’m working with a seasonal calendar (27th December to 31st January) I’m not sure how to best set this up.
The current setup (as per the screenshot) is actually all individual groups, and not a repeating group. I had thought about creating a repeating group but wasn’t sure how to add the specific dates I need.
Additionally, I’m not sure the best practice for creating this in the database, i.e. I want to set all days as ‘available for collection’ by default, which would mean that there needs to be a new database entry for each day 27th December through to 31st January for when this user is created. What would be the best way to…
- Setup database for this.
- Input the data for each day into the database (date, available status, capacity, location, business name)
- Setup the interface (e.g. as is now, or by repeating group?)
Kind Regards,
Calum
Availability
- date
- available? (y/n)
- capacity (number)
- location
- business
Location
- name (text)
- business
- etc…
Business
- name (text)
- list of locations
- etc…
Use a backend workflow to create these entries for Dec 27 - Jan 21 for each location with pre-filled fields (defaults)
Set up a repeating group to display these availabilityEntries. Each row can show the date with dropdowns/inputs for users to edit them as needed.
Best of luck with your project! 
This is brilliant, thank you! I managed to setup the repeating group and backend workflow to have the correct dates.
But I do have one additional question…
Where I have the dropdown ‘select a town’ and the input box ‘capacity’… I want to have the ability for users to click ‘+ add another area for this date’ which would allow them to have availability in multiple locations for the date, and capacity for each location on the date.
Firstly, do I need to change the suggested data structure?
Secondly, how can this be achieved? Presumably I need a repeating group, and when ‘+ add another area for this date’ is clicked, create a new database entry?
Thanks!