feat/user-templates (#9)
All checks were successful
Go / build (push) Successful in 14s

feat: user templates
This commit was merged in pull request #9.
This commit is contained in:
2025-12-03 21:27:46 +01:00
parent acaece2659
commit 9a5ea229bf
19 changed files with 584 additions and 343 deletions

View File

@@ -31,6 +31,7 @@ func (s Service) createInvoice(w http.ResponseWriter, r *http.Request) {
opts := invoice.DefaultOptions
opts.Mindur = time.Duration(req.DurationThreshold)
opts.CustomTemplate = req.CustomTemplate
invoice, report, err := s.invoice.Generate(req.Creditor, &req.Debtor, req.HourlyRate, repos, &opts)
if err != nil {
s.sendErr(w, http.StatusInternalServerError, "internal server error")
@@ -71,6 +72,7 @@ func (s Service) sendInvoice(w http.ResponseWriter, r *http.Request) {
opts := invoice.DefaultOptions
opts.Mindur = time.Duration(req.Invoice.DurationThreshold)
opts.CustomTemplate = req.Invoice.CustomTemplate
invoice, report, err := s.invoice.Generate(req.Invoice.Creditor, &req.Invoice.Debtor, req.Invoice.HourlyRate, repos, &opts)
if err != nil {
s.sendErr(w, http.StatusInternalServerError, "error while processing invoice:", err)