Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add attach notes command to allow adding of notes of a record #249

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

davidchua
Copy link

@davidchua davidchua commented Jun 28, 2024

Problem

When viewing timetrace report at the end of the month in preparation to bill clients, the current information displayed may not provide enough context to what actually happened during each time chunk. And because a full month may have occurred, the memory is no longer fresh to remember what you've did specifically.

Solution

When adding a timetrace record, it would be good to be able to leave a note attached to the record to briefly describe what was being done for this time chunk so that it will be easier to give a breakdown to the clients if they require.

Description

Changes

This PR adds 2 new commands:

  • timetrace attach note
  • timetrace get record last

And also updates the timetrace report and timetrace get record to display the notes as a new column in the table.

Details

This PR adds a new command called attach which the first subcommand attach note. This also allows users to now pull the latest record without searching explicitly for the last and latest record via timetrace get record last

timetrace attach note -m <message> will allow users to be able to leave contemporary notes about the record that was just submitted.

Example:

Attach a note

➜ ./timetrace attach note -m "Test 4"
✔ successfully attached note "Test 4" to record

Get Last Record

➜ ./timetrace get record last
+------------------------+---------+-------+--------------+------------+---------+
|          DATE          |  START  |  END  |   PROJECT    |  BILLABLE  |  NOTES  |
+------------------------+---------+-------+--------------+------------+---------+
| Tuesday, 04. June 2024 | 08:42   | 09:21 | optimization | yes        | Test    |
|                        |         |       |              |            | Test 2  |
|                        |         |       |              |            | Test 3  |
|                        |         |       |              |            | Test 4  |
+------------------------+---------+-------+--------------+------------+---------+

Get Report

+--------------+----------+------------------------+---------+-------+------------+---------+------------+
|   PROJECT    |  MODULE  |          DATE          |  START  |  END  |  BILLABLE  |  NOTES  |   TOTAL    |
+--------------+----------+------------------------+---------+-------+------------+---------+------------+
| optimization |          | Tuesday, 04. June 2024 | 03:09   | 04:05 | yes        |         |            |
+              +----------+------------------------+---------+-------+------------+---------+------------+
|              |          | Tuesday, 04. June 2024 | 08:42   | 09:21 | yes        | Test    |            |
|              |          |                        |         |       |            | Test 2  |            |
|              |          |                        |         |       |            | Test 3  |            |
|              |          |                        |         |       |            | Test 4  |            |
+--------------+----------+------------------------+---------+-------+------------+---------+------------+
|              |          |                        |         |       |            | ∑       | 1h 34min   |
+--------------+----------+------------------------+---------+-------+------------+---------+------------+
|                                                                                   TOTAL   | 1H 34MIN   |
+--------------+----------+------------------------+---------+-------+------------+---------+------------+

Test

➜ go test ./...
?       github.com/dominikbraun/timetrace       [no test files]
?       github.com/dominikbraun/timetrace/config        [no test files]
?       github.com/dominikbraun/timetrace/fs    [no test files]
?       github.com/dominikbraun/timetrace/out   [no test files]
ok      github.com/dominikbraun/timetrace/cli   (cached)
ok      github.com/dominikbraun/timetrace/core  (cached)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant