diff options
author | T <t@tjp.lol> | 2025-08-07 13:11:24 -0600 |
---|---|---|
committer | T <t@tjp.lol> | 2025-08-07 23:14:00 -0600 |
commit | a7ee7f7280d593481501446008acc05e32abcd22 (patch) | |
tree | f056bd9c72934a9e04aa5af872e836bc43d3739f /internal/actions/timer.go | |
parent | 4843deb9cfa6d91282c5124ec025c636137e9e94 (diff) |
entry edit and delete
Diffstat (limited to 'internal/actions/timer.go')
-rw-r--r-- | internal/actions/timer.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/internal/actions/timer.go b/internal/actions/timer.go index 5235a0a..9f29c51 100644 --- a/internal/actions/timer.go +++ b/internal/actions/timer.go @@ -58,7 +58,7 @@ func (a *actions) PunchIn(ctx context.Context, client, project, description stri // Verify project belongs to client if both specified if resolvedProject != nil && resolvedProject.ClientID != clientID { - return nil, fmt.Errorf("%w: project %q does not belong to client %q", + return nil, fmt.Errorf("%w: project %q does not belong to client %q", ErrProjectClientMismatch, project, client) } } else if resolvedProject != nil { @@ -262,6 +262,18 @@ func (a *actions) PunchOut(ctx context.Context) (*TimerSession, error) { }, nil } +func (a *actions) EditEntry(ctx context.Context, entry queries.TimeEntry) error { + return a.queries.EditTimeEntry(ctx, queries.EditTimeEntryParams{ + StartTime: entry.StartTime, + EndTime: entry.EndTime, + Description: entry.Description, + ClientID: entry.ClientID, + ProjectID: entry.ProjectID, + HourlyRate: entry.BillableRate, + EntryID: entry.ID, + }) +} + // Helper functions func (a *actions) createTimeEntry(ctx context.Context, clientID int64, projectID sql.NullInt64, description string, billableRate *float64) (*queries.TimeEntry, error) { |