influenzanet / user-management-service

Backend service to managing user related logic
0 stars 7 forks source link

Weekday assignation #12

Closed cturbelin closed 2 years ago

cturbelin commented 2 years ago

Can define a strategy to assign a weekday to user for sending some messages The proposal is to define a weight for each day (weight set to zero makes the day not assignable, expected weight are positive integers), the day is randomly assigned accounting the weights.
Default strategy (if env is not defined) is to keep the exact old behaviour (pick a random day)

For example "Mon=3, Tue=1,Fri=1" gives a relative weight of 3 to Monday and 1 to Tuesday and Friday. Monday as 3 times chance to be picked compare to Tuesday or Friday, others days are not pickable)