feat(api): fix POST /invoice

This commit is contained in:
2025-08-26 22:40:49 +02:00
parent 788571162d
commit 794558a007
12 changed files with 181 additions and 84 deletions

View File

@@ -5,19 +5,19 @@ import (
"log/slog"
"net/http"
"strings"
"time"
"git.schreifuchs.ch/lou-taylor/accounting/internal/email"
"git.schreifuchs.ch/lou-taylor/accounting/internal/jtype"
"git.schreifuchs.ch/lou-taylor/accounting/pkg/invoice"
"git.schreifuchs.ch/lou-taylor/accounting/pkg/invoice/model"
)
type invoiceReq struct {
Debtor model.Entity `json:"debtor"`
Creditor model.Entity `json:"creditor"`
DurationThreshold time.Duration `json:"durationThreshold"`
HourlyRate float64 `json:"hourlyRate"`
Repos []string `json:"repositories"`
Debtor model.Entity `json:"debtor"`
Creditor model.Entity `json:"creditor"`
DurationThreshold jtype.Duration `json:"durationThreshold"`
HourlyRate float64 `json:"hourlyRate"`
Repos []string `json:"repositories"`
}
func (i invoiceReq) GetRepos() (repos []invoice.Repo, err error) {