MayGo / tockler

An application that tracks your time by monitoring your active window title and idle time.
http://maygo.github.io/tockler/
GNU General Public License v2.0
878 stars 103 forks source link

Automatically create user worklogs #154

Closed richardguerre closed 3 years ago

richardguerre commented 3 years ago

This PR adds the "Automatically create user worklogs" feature. What it does:

  1. Queries all user's activity from that has not yet been summarized into worklogs
  2. Fetches all possible entities that the automatic worklogs could link to (i.e. tasks, tickets, projects, and clients). It fetches tasks even if the user is not the developer as to allow automatic time logging of PR reviews on tasks/tickets.
  3. Summarizes all the user's activities into worklogs. Each summary/worklog is about 300 seconds (5 minutes), or the length of the entire user_event if its longer than 300 seconds.
  4. Groups adjacent summaries/worklogs together
  5. If the first summary item is the same as the last saved summary in the db and they are 5 minutes apart, then update the last worklog in the DB.
  6. For the rest, insert new user_work_logs.
  7. set isSummarized to true to all user activities that have been summarized during the save.