I’m looking to create a booking system using GraphQL, Prisma, Postgres, and React that allows a user to rent a property from date A to date B. When the due date, B, arrives, I want the database to do two things:
- Trigger an event updating its
Overduefield from false to true when the due date is passed. My current workaround solution is to have a query that fetches the due date, compares it to the current date and if the current date is passed the due date, mutate the
Overduefield from false to true. But, the problem with this solution is that it only works when the query is performed, which means the user has to necessarily visit the website.
- This second thing is tied into the first one, but how do I send a proactive alert from the database to the user with email notifying the overdue date?