model

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDuration

func FormatDuration(d time.Duration) string

func ParseEditTime added in v0.10.0

func ParseEditTime(s string) (time.Time, error)

ParseEditTime parses a time given on the command line: RFC3339 (what scripts and the bar-widget plugin send) or the TUI's own local "YYYY-MM-DD HH:MM" form.

Types

type Client

type Client struct {
	ID         int64
	Name       string
	HourlyRate float64
	CreatedAt  time.Time
}

type Entry

type Entry struct {
	ID        int64
	ProjectID int64
	Project   *Project
	Task      string
	StartTime time.Time
	EndTime   *time.Time
	Invoiced  bool
	Paid      bool
	Notes     string
	CreatedAt time.Time
}

func (*Entry) Duration

func (e *Entry) Duration() time.Duration

func (*Entry) Earnings

func (e *Entry) Earnings(hourlyRate float64) float64

func (*Entry) IsRunning

func (e *Entry) IsRunning() bool

type Project

type Project struct {
	ID        int64
	ClientID  int64
	Client    *Client
	Name      string
	CreatedAt time.Time
}

type RecentTask

type RecentTask struct {
	ProjectID    int64
	ProjectName  string
	ClientName   string
	Task         string
	TotalSeconds int64
	LastUsed     time.Time
	// Billing status across the task's finished entries, so a picker can
	// show "2/3 invoiced" without listing every entry. Paid implies
	// invoiced, so PaidCount <= InvoicedCount <= EntryCount.
	EntryCount    int
	InvoicedCount int
	PaidCount     int
}

RecentTask is one distinct (project, task) pairing that's been tracked before, with its accumulated time across every finished entry -- for pickers that want to resume a specific named task rather than just start a bare project (see db.ListRecentTasks).

type ReportRow

type ReportRow struct {
	ClientName  string
	ProjectName string
	ClientID    int64
	ProjectID   int64
	HourlyRate  float64
	TotalHours  float64
	Earnings    float64
	EntryCount  int
	Invoiced    int
	Paid        int
	Entries     []*Entry // populated after load
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL