buerokratt / Buerokratt-Chatbot

1 stars 17 forks source link

Amend organization's working time settings in BYK admin module #185

Open PaulaMerle opened 1 year ago

PaulaMerle commented 1 year ago

AS AN Administrator I WANT TO be able to set or modify organization's working time SO THAT after working hours chatbot will ask End Users contact information when Bürokratt is not able to reply itself

Functionality has been worked out during phase2 development according to task #15, but needs some amendments to be done:

Acceptance Criteria

DSL

GUI

1AhmedYasser commented 11 months ago

@PaulaMerle @turnerrainer The requested design here is a new design and its currently needs changes to be done in the database and back-end side to achieve it and will require changes in BYK-Admin (MVP) as well in Chatbot (New Back-office)

This is the current design for it in Chatbot

Screenshot 2023-11-07 at 2 29 58 AM

This is the new requested design

Screenshot 2023-11-07 at 2 30 34 AM

Would you like to change to the new design or keep the old one ?

janinakimtrohlev commented 11 months ago

BUG - I put and saves the changes, but the bot does not work. When opening the working hours again , the same clock that you are looking sets the open and closed clock.

1AhmedYasser commented 11 months ago

@turnerrainer Currently when you check if the organization is within working hours, it will check if your current time (UTC) is between the start time (UTC) and end time (UTC) for the current day.

For example here is the Postgress query part that does that for example for thursday

WHEN current_day.current_day = 'thursday' THEN TO_CHAR(CURRENT_TIMESTAMP, 'HH24:MI:SS') BETWEEN
                                                     (SELECT TO_CHAR(value, 'HH24:MI:SS')
                                                      FROM thursday_start_time) AND
                                                     (SELECT TO_CHAR(value, 'HH24:MI:SS')
                                                      FROM thursday_end_time)

There is an edge case

So for example if the current time is 22:00 (10:00 PM) and start time is 21:00 (09:00 PM) & end time is 01:00 (01:00) then it will fail, because 22:00 is not less than 01:00 because 01:00 is a new day time to the data base

But for example if you set the start time from 9:00 AM and end time is (17:00) (05:00 PM), and your current time is for example (13:00) (01:00) then it works fine

So the question here, how can we handle this edge case ?

janinakimtrohlev commented 10 months ago

Tested and done

ValterAro commented 3 months ago

The functionality is currently not working. Mentioned the bug in #682