fix: Hourly Rate + Formatting#6
Merged
Merged
Conversation
Introduce an optional hourly rate to time entries, storing it in the database and exposing it via the TimeEntry model. Update the start command to use the configured hourly rate if available, and enhance stats reporting to estimate and display earnings per project and in total. Update all relevant database queries and models to support the new hourly_rate field.
Updated time formatting in log command to use '03:04 PM' instead of '3:04 PM', ensuring times are displayed with a leading zero for single-digit hours.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds support for tracking and reporting hourly rates and estimated earnings for time entries in the time tracking application. It introduces a new
hourly_ratefield to the database, updates the data model, and enhances the statistics output to include estimated earnings by project and in total. Several user-facing messages and formatting details are also improved.Hourly Rate and Earnings Tracking
hourly_ratecolumn to thetime_entriestable and updated theTimeEntrymodel to include an optionalHourlyRatefield. All database access methods now handle this field, allowing each entry to store an hourly rate if available. [1] [2]cmd/start.goto load the hourly rate from config (if set) and store it with each new entry.CreateEntry,GetEntry,GetEntries,GetEntriesByProject,GetEntriesByDateRange, etc.) to read and write thehourly_ratefield, and to properly set it on theTimeEntrystruct if present. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]Statistics and Reporting Enhancements
statscommand to display total and per-project estimated earnings when any entries have an hourly rate. This is shown in both period and all-time statistics. [1] [2]User Experience and Output Improvements
cmd/start.go. [1] [2]Codebase Cleanup
configpackage fromcmd/stats.go.