As a user, I want to clock out by typing /clock out when I'm done working, so I can move on with my life resting assured that my time is logged.
Solution design
A TimeEntry__c object will be created to store time entries. Each time entry will have at minimum four fields.
Start Time
End Time
Slack User ID
Slack Team ID
It's important to note that trying to clock out without having first clocked in (see #1) should cause an error to be generated along the lines of "You forgot to clock in!"
Conditions of satisfaction
Not clocked in scenario...
Given a Slack user who is not clocked in;
When the Slack user types /clock out;
Then the user should get an error message saying, "You forgot to clock in!"
Clocked in scenario...
Given a Slack user who has already clocked in;
When the Slack user types /clock out;
Then the open Time Entry record should be updated for the user, and a confirmation message sent to user saying, "You have clocked out."
Implementing was quick, but... Typing /clock out twice resulted in two success messages, whereas I was expecting the second command to result in an error.
As a user, I want to clock out by typing
/clock out
when I'm done working, so I can move on with my life resting assured that my time is logged.Solution design
A
TimeEntry__c
object will be created to store time entries. Each time entry will have at minimum four fields.It's important to note that trying to clock out without having first clocked in (see #1) should cause an error to be generated along the lines of "You forgot to clock in!"
Conditions of satisfaction
Not clocked in scenario...
/clock out
;Clocked in scenario...
/clock out
;