dwyl / dwyl/app-api

Add timers to capture

Open
#4 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Elixir
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

A capture can have multiple timers.
Timer fields:
- id
- started_at
- stopped_at
- created_at
- updated_at
- id_capture: create association with capture

The `stopped_at` value can be null, in this case it means that the timer is running.
Only one timer can run for a capture and it should be the one created the most recently.

We can calculate the time spend on a capture by
- if the most recent timer is running: sum stopped timers + (now - start_at running timer)
- if all timers are stopped: sum of stopped timers (ie sum of stopped_at - started_at)

If a timer can't be started (e.g. http error) make sure the UI representing the timer is on "stop" and same if a timer can't be stopped

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.