Designing a menu ordering app. However, my customer wants to limit how many orders they can take in a given date. Would I start with the calendar so that the customer picks the date and in that collection it is connected to orders and if the count of all orders would be higher for this date no menu items would show and a different message would something like “sorry we are not accepting any more orders for this date”. Ideally, it should be based around the day of the week too. Meaning, if the restaurant is closed the max orders that can be posted for that date would be 0.
As for me, you’ve described the flow quite correctly. You can have an “Orders” table, with “Date” property for each order. Then, on the “Order” screen, you either
show “Make an order” button, which is conditionally visible: if Orders → Count, filtered by user-selected-date, is less then order limit.
make a “sorry no orders accepted” tag, which is conditionally visible: if Orders → Count, filtered by user-selected-date, is equal then or greater then order limit.