Skip to content

Time Tracking

Chetan Khandla edited this page Jul 9, 2020 · 10 revisions

Schema

Note : Date and time will be in UTC timezone.

TimeSheet

id
employeeId
approvedById
duration
keyboard
mouse
overall
startedAt
stoppedAt
approvedAt
submittedAt
lockedAt
isBilled
status
  • Timesheet is Weekly weekly time sheet. It has average of the keyboard, mouse and activity.
  • Timesheet has status like pending, approved, rejected and etc...

TimeLogs

id
employeeId
timesheetId
projectId
taskId
clientId
startedAt
stoppedAt
logType
source -> In the column save source of the time log Like (Web Timer, Desktop, Mobile, third-party app name and etc...)
description
isBillable
deletedAt
duration -> This is not column, it will virtually calculated when fetch
  • Timelogs is logs when start timer and when stop timer. Timelog store priorities like bailable, project, task, client, description and employee

I.e: 2020-05-27 10:00:00 to 2020-05-27 13:00:00, 2020-05-27 14:00:00 to 2020-05-27 18:00:00 ...

TimeSlotTimeLogs

id	
timeSlotId
timeLogsId
  • Many to many relation between Timelogs and Timeslots.

TimeSlots

id
employeeId
duration
keyboard
mouse
overall
startedAt
stoppedAt -> This is not column, it will virtually calculated when fetch, Will add 10 minutes in startedAt.
  • Timeslots is 10 min slot for the time taking.

    I.e: 2020-05-27 10:00:00 to 2020-05-27 10:10:00, 2020-05-27 10:10:00 to 2020-05-27 10:20:00, 2020-05-27 10:20:00 to 2020-05-27 10:30:00 ...

  • We have not defined relation between timeslots and timelogs because maybe possible one timeslot has multiple logs. I.e: Assume below is the timelogs. So in this case the timeslot 2020-05-27 10:00:00 - 2020-05-27 10:10:00 has two timelogs.

    2020-05-27 09:00:00 - 2020-05-27 10:04:00 2020-05-27 10:06:00 - 2020-05-27 11:00:00

  • Timeslot has keyboard, mouse, screenshots, and activity.

TimeSlotMinutes

id
timeslotId
mouse
keyboard
datetime
  • Store minutes activity of the timeslots.

Screenshots

id
timeSlotId
fullUrl
thumbUrl
recordedAt
deletedAt
  • Store path of the screenshot and it has many to one relation with Timeslot.

Activity

id
employeeId
projectId
taskId
title
date
duration
type
source
deletedAt
  • app and url activity will be store in two different rows.
  • it has many to one relation with Timeslot.
  • Percentage or number of activity store in data,
  • type will be app or url
  • title will be name of website or app.