Skip to content

fix: Hourly Rate + Formatting#6

Merged
DylanDevelops merged 2 commits into
mainfrom
ravel/small-bug-fixes
Dec 15, 2025
Merged

fix: Hourly Rate + Formatting#6
DylanDevelops merged 2 commits into
mainfrom
ravel/small-bug-fixes

Conversation

@DylanDevelops
Copy link
Copy Markdown
Owner

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_rate field 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

  • Added a new hourly_rate column to the time_entries table and updated the TimeEntry model to include an optional HourlyRate field. All database access methods now handle this field, allowing each entry to store an hourly rate if available. [1] [2]
  • Modified the entry creation logic in cmd/start.go to load the hourly rate from config (if set) and store it with each new entry.
  • Updated all relevant database queries and methods (CreateEntry, GetEntry, GetEntries, GetEntriesByProject, GetEntriesByDateRange, etc.) to read and write the hourly_rate field, and to properly set it on the TimeEntry struct if present. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]

Statistics and Reporting Enhancements

  • Enhanced the output of the stats command 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]
  • Improved period naming and formatting for statistics output (e.g., "This Week" instead of "This week").

User Experience and Output Improvements

  • Standardized user-facing output messages for config source information and error messages in cmd/start.go. [1] [2]
  • Changed time formatting in log output to use zero-padded hours for consistency (e.g., "03:04 PM" instead of "3:04 PM").

Codebase Cleanup

  • Removed unused import of the config package from cmd/stats.go.

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.
@DylanDevelops DylanDevelops merged commit 0e675c0 into main Dec 15, 2025
3 checks passed
@DylanDevelops DylanDevelops deleted the ravel/small-bug-fixes branch December 15, 2025 05:01
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