I need help in the logic section of my app

my app is shift schedule maker and i need help
before you scroll down i know that this is alot but all i need is simple explanation on how to do it or hint and anything you can help with
simple i have a table that i need to be filled with employee that is stored in my database
and the table consist of 4 column which are dynamically generated and the the important thing to mention about the schedule table is that two column date and date are dynamic and the values i got it from two time pickers an end and start
and the part that i need help with is basically as follows
1-i want every employee the appropriate number of shifts that i already stored in a custom state
2-i want every employee the appropriate number of shifts for weekends that i already stored in a custom state
3- making sure that the assigned shifts for employee does not conflict with his vacation

4- and other things like he should work in two section at the same time and he should not take two shifts in a row and stuff like that

Employee scheduling is an optimization problem that can’t be solved easily by using the tools Bubble provided. It has many constraints usually (like you mentioned vacation times, no double-shifts, weekends, number of shifts violation etc.) I think you will need custom coding in some part of this process: Programação de funcionários  |  OR-Tools  |  Google for Developers

My suggestion would be, first try to solve it on paper (if you are really into it :slight_smile:). Here is an example to solve in Excel: https://www.youtube.com/watch?v=A5Nz0fqIpdw

Google also provides an API to solve this problem: কর্মশক্তি সময়সূচী সমাধানকারী  |  Operations Research API  |  Google for Developers In this case, you should format your data according to the API parameters and then get the result and transform it into your data formats.

Of course, you should be ready to model your data accordingly, like there are nurses, each nurse has vacations, shift requirements, max number of shifts etc etc.

Good luck :vulcan_salute: