xtreamsrl / clockify-nlp-bot

An NLP driven bot for interacting with Clockify timesheet via different channels
MIT License
10 stars 3 forks source link

Added ability to store the working hours to the user profile #120

Open swissbyte opened 2 years ago

swissbyte commented 2 years ago

Hi there

This feature provides the ability to store the target working hours within the user profile. The user can also set its own working hours using LUIS with something like:

"change my work hours to 8 hours".

The important part is, that LUIS only recognizes one time. Cause i am using the WorkedDurationInMinutes method which will fail if a sentence like this will be used:

"my day has 9 hours" cause "WorkedDurationInMinutes" takes the first() element which will be a date instead of hours.

Additionaly to that, i have added two now environment variables:

DEFAULT_WORKING_HOURS MINIMUM_HOURS_FILLED_PERCENTAGE

The idea is the following: one can define a standard workday duration and also a minimum percentage of what needs to be reported till 5 PM.

I wrote the code in a way that the defaults are 8 hours and 75% if no environment variable has been set. This way all existing setups will work also with this code