Code-4-Community / breaktime

1 stars 0 forks source link

Backend Write-up: Attendance Rate Added into Schemas #22

Open izzyconner opened 5 months ago

izzyconner commented 5 months ago

Description

Determine the best way to store attendance rate for a user and add in any necessary fields to the database schemas. Write up the proposed method for attendance rate calculation, including calls and coalescing needed on the backend.

Attendance rate can be calculated for:

Attendance rates should be able to be calculated for a given associate:

Conditions of Satisfaction

neetidesai commented 5 months ago

Don't have a ton to say so I'll put my writeup here.

I wanted to introduce attendance tracking with minimal backend changes. So, I propose adding an list of Attendance enums to the TimesheetEntry schema, which would be a list containing any of ABSENT, ON_TIME, LATE, or EARLY. Then, to find shifts where reports were filed, comments were left, etc. etc. you would filter shifts by 1.) If the attendance list exists and does not only contain ABSENT, and then 2.) If a report was filed, if the employee left late, came early, both, etc. etc. Let me know if I approached this the wrong way or more needs to be done! Link to the branch with the modified schemas here: https://github.com/Code-4-Community/breaktime/tree/22-attendance-rate-ND