Documentation
¶
Overview ¶
Package report aggregates time entries and renders them in various output formats.
Index ¶
- type CustomerProject
- type RateTotal
- type Report
- func (r *Report) CalculateStatistics() *Statistics
- func (r *Report) GenerateHTMLReport(w io.Writer)
- func (r *Report) GenerateMarkdownReport(w io.Writer)
- func (r *Report) GeneratePDFReport(outputPath string) error
- func (r *Report) GenerateTextReport() string
- func (r *Report) GenerateTypstReport(w io.Writer)
- type Sort
- type Statistics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomerProject ¶
CustomerProject represents a unique customer/project combination
type Report ¶
type Report struct {
StartDate types.Date
EndDate types.Date
Config *config.Config
// Aggregated data: Customer/Project -> TaskID -> Description -> []*TimeEntry
AggregatedTime map[CustomerProject]map[timeentry.TaskID]map[string][]*timeentry.TimeEntry
DayStats map[types.Date]time.Duration
RateTotals map[CustomerProject]RateTotal
// Filter options
Customer timeentry.Customer
Project timeentry.Project
// Display options
Sort Sort
Reverse bool
TaskGrain bool
DescriptionGrain bool
// Cache for resolving work item metadata (formatted ID, link, description).
Cache *resolver.ItemDetailCache
// contains filtered or unexported fields
}
Report holds aggregated time entry data and statistics
func New ¶
func New(ctx context.Context, config *config.Config, start, end types.Date, customer timeentry.Customer, project timeentry.Project, sort Sort, reverse, taskGrain, descriptionGrain bool) (*Report, error)
New creates a new Report by aggregating time entries over the date range
func (*Report) CalculateStatistics ¶
func (r *Report) CalculateStatistics() *Statistics
CalculateStatistics computes statistics from day stats
func (*Report) GenerateHTMLReport ¶
GenerateHTMLReport generates an HTML report by converting markdown to HTML
func (*Report) GenerateMarkdownReport ¶
GenerateMarkdownReport generates a markdown-formatted report
func (*Report) GeneratePDFReport ¶
GeneratePDFReport generates a PDF report by compiling Typst to PDF
func (*Report) GenerateTextReport ¶
GenerateTextReport generates a plain text report matching Python's output format
func (*Report) GenerateTypstReport ¶
GenerateTypstReport generates a Typst-formatted report