Hi guys, i'm doing a restaurant reservation plattform and i'm using Keystone for the backend. I've been using the SydJS and keystone demo for guide and i think things are going along. In a simple way, users browse a list of restaurants in their area, pick one and choose, the day and hour when they want to go to that restaurant. I have the restaurant page done, at the bottom i have a form with some selects for how many people, the day and hours they want to book.
What i want to do now is that when submiting the reservation a couple of things should happen:
- create a DB entry of a reservation
- email restaurant asking for availability (update DB with status - email sent)
- wait for response, get response from restaurant
- if positive (update status - confirmed) collect fee €
- if negative (update status - declinned) recommend similar restaurant
I'm using the contact model and route from the demo website to try and process this but i'm stuck on how can i do things as i described above. I understand that on post, a new DB entry must be created, then with getUpdateHandler fill the initial data.
Can someone please give me some help on this?