diff options
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) { |