How to queryRecordType with gouping by date range and offset (hours) and also include quantity counters
Hello everyone,
I have 3 record types. "Orders", "Products" and "Order Product Variations" (relationship).
Orders (id, createdOn)
Products(id, categoryId) *category must be equal to 5
Order Product Variations (id, productId, quantity, createdOn)
I want to create an interface that shows which products are ordered for each day.
- The orders products that are included for each day are from the previous date at 09:30:01 to current day at 09:30:00
- I want to have a counter for each product (including the quantity)
I want to ask what is the best way to proceed with this.
This interface will be used by the Canteen Manager to prepare lunch orders for employees.
At a later stage I will try to show which employees ordered each food.
Case scenarios:
##########Case No1###################
Today: 23 Feb 2024 08:00 AM
1st list el:
--------------------------------------------
Orders for 23/02/2024
- Food A qty: 7
- Food B qty: 4
- Food C qty: 2
--------------------------------------------
2nd list el:
--------------------------------------------
Orders for 22/02/2024
- Food A qty: 9
- Food D qty: 4
- Food F qty: 3
--------------------------------------------
##################################
###########Case No2##################
Today: 23 Feb 2024 09:31 AM
1st list el:
--------------------------------------------
Orders for 24/02/2024
- Food B qty: 1
--------------------------------------------
2nd list el:
--------------------------------------------
Orders for 23/02/2024
- Food A qty: 7
- Food B qty: 4
- Food C qty: 2
--------------------------------------------
3rd list el:
--------------------------------------------
Orders for 22/02/2024
- Food A qty: 9
- Food D qty: 4
- Food F qty: 3
--------------------------------------------
##################################
