diff options
author | T <t@tjp.lol> | 2025-08-05 11:37:02 -0600 |
---|---|---|
committer | T <t@tjp.lol> | 2025-08-05 11:37:08 -0600 |
commit | 665bd389a0a1c8adadcaa1122e846cc81f5ead31 (patch) | |
tree | f34f9ec77891308c600c680683f60951599429c3 /internal/actions/actions.go | |
parent | dc895cec9d8a84af89ce2501db234dff33c757e2 (diff) |
WIP TUI
Diffstat (limited to 'internal/actions/actions.go')
-rw-r--r-- | internal/actions/actions.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/internal/actions/actions.go b/internal/actions/actions.go new file mode 100644 index 0000000..5e2610a --- /dev/null +++ b/internal/actions/actions.go @@ -0,0 +1,34 @@ +package actions + +import ( + "context" + "punchcard/internal/queries" +) + +// Actions provides high-level business operations for time tracking +type Actions interface { + // Timer operations + PunchIn(ctx context.Context, client, project, description string, billableRate *float64) (*TimerSession, error) + PunchInMostRecent(ctx context.Context, description string, billableRate *float64) (*TimerSession, error) + PunchOut(ctx context.Context) (*TimerSession, error) + + // Client operations + CreateClient(ctx context.Context, name, email string, billableRate *float64) (*queries.Client, error) + FindClient(ctx context.Context, nameOrID string) (*queries.Client, error) + + // Project operations + CreateProject(ctx context.Context, name, client string, billableRate *float64) (*queries.Project, error) + FindProject(ctx context.Context, nameOrID string) (*queries.Project, error) +} + +// New creates a new Actions instance +func New(q *queries.Queries) Actions { + return &actionsImpl{ + queries: q, + } +} + +// actionsImpl implements the Actions interface +type actionsImpl struct { + queries *queries.Queries +}
\ No newline at end of file |