package commands import ( "context" "errors" "punchcard/internal/actions" "punchcard/internal/queries" ) // ErrNoActiveTimer is returned when trying to punch out but no timer is active var ErrNoActiveTimer = errors.New("no active timer found") // Helper functions for commands that need to find clients/projects // These wrap the actions package for backward compatibility func findClient(ctx context.Context, q *queries.Queries, clientRef string) (queries.Client, error) { a := actions.New(q) client, err := a.FindClient(ctx, clientRef) if err != nil { return queries.Client{}, err } return *client, nil } func findProject(ctx context.Context, q *queries.Queries, projectRef string) (queries.Project, error) { a := actions.New(q) project, err := a.FindProject(ctx, projectRef) if err != nil { return queries.Project{}, err } return *project, nil }