Compare commits
4 Commits
dev
...
d5f94845e8
| Author | SHA1 | Date | |
|---|---|---|---|
| d5f94845e8 | |||
| 7913e6b900 | |||
| e57185b057 | |||
| 8adff6ade2 |
@@ -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,
|
||||
)
|
||||
|
||||
|
||||
@@ -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) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user