ikdekker / autoshift

Creates rosters / shifts / schemes or whatever you want to call it for employes automatically based on some given info.
https://freshcoders.nl/autoshift/
MIT License
0 stars 0 forks source link

Find a way to allow users to enter normalized data easily #2

Open ikdekker opened 4 years ago

ikdekker commented 4 years ago

To allow users to provide their user status, I wan't to use a generic interface model. The expected data structure is as follows: (string) user > (int) year > (int) day > (bool) available The interface, as such has to consist of the following elements. Simplest form: textbox for name; int-box for year; day -> availability mapping (intbox/bool) per day

There are some rules that have to be applied, we can put this into a prioritized ruleset. Such as:

 rules:
     prune-weekend-days: # assumes 6 and 7 are sat, sun
         filter:
         - {weekday}%7>0
         - {weekday}%7<6
         action:
         - remove
     set-default-true:
         filter:
         - *
         action:
         - set_true # or set_data: false
     free-monday:
         filter:
         - {weekday}%7=1
         action:
         - set_false # or set_data: false

Now formatting rules? Each unique output results in a new cluster?

 clustering:
     - year 
         - int({weekday}/7)

We could do something like

1 create normal data: defined by global setting? 2 apply rules 3 apply clustering 4 transform to HTML

ikdekker commented 4 years ago

https://www.youtube.com/watch?v=lm4jEcnWeKI

Maybe implement a DSL to parse human language and create json from it.

Nice post: https://opensource.com/article/20/2/domain-specific-languages