4 Commits

Author SHA1 Message Date
d5f94845e8 feat: better debug logs
All checks were successful
Go / build (pull_request) Successful in 1m11s
2025-12-03 20:45:48 +01:00
7913e6b900 feat: tests 2025-11-09 16:39:29 +01:00
e57185b057 feat: custom template 2025-11-09 13:04:23 +01:00
8adff6ade2 feat: use tailwind css 2025-11-06 21:36:57 +01:00
2 changed files with 8 additions and 10 deletions

View File

@@ -9,7 +9,7 @@ import (
"git.schreifuchs.ch/lou-taylor/accounting/pkg/invoice/report"
)
func (s *Service) Generate(creditor model.Entity, debtor *model.Entity, rate float64, repos []Repo, config *Options) (document io.ReadCloser, r report.Report, err error) {
func (s *Service) Generate(creditor model.Entity, deptor *model.Entity, rate float64, repos []Repo, config *Options) (document io.ReadCloser, r report.Report, err error) {
if config == nil {
config = &DefaultOptions
}
@@ -20,7 +20,6 @@ func (s *Service) Generate(creditor model.Entity, debtor *model.Entity, rate flo
repo.Repo,
gitea.ListIssueOption{
ListOptions: gitea.ListOptions{Page: 0, PageSize: 99999},
Type: gitea.IssueTypeIssue,
Since: config.Since,
Before: config.Before,
State: config.IssueState,
@@ -47,7 +46,7 @@ func (s *Service) Generate(creditor model.Entity, debtor *model.Entity, rate flo
r = report.New(
issues,
creditor,
debtor,
deptor,
rate,
)

View File

@@ -41,7 +41,7 @@ func TestGenerate(t *testing.T) {
creditor := model.Entity{
Name: "creditor",
}
debtor := model.Entity{
deptor := model.Entity{
Name: "deptor",
}
rate := 100.0
@@ -140,7 +140,7 @@ func TestGenerate(t *testing.T) {
tc.setupMocks(giteaClient, pdfGenerator)
service := New(slog.Default(), giteaClient, pdfGenerator)
doc, _, err := service.Generate(creditor, &debtor, rate, repos, tc.config)
doc, _, err := service.Generate(creditor, &deptor, rate, repos, tc.config)
if tc.expectedError != "" {
if err == nil {
@@ -160,4 +160,3 @@ func TestGenerate(t *testing.T) {
})
}
}