Files
accounting/internal/api/httpinvoce/resource.go
schreifuchs cfbb475a42
Some checks failed
Go / build (push) Failing after 1m16s
feat: more options
2025-11-04 20:16:44 +01:00

30 lines
761 B
Go

package httpinvoce
import (
"io"
"log/slog"
"git.schreifuchs.ch/lou-taylor/accounting/internal/email"
"git.schreifuchs.ch/lou-taylor/accounting/pkg/invoice"
"git.schreifuchs.ch/lou-taylor/accounting/pkg/invoice/model"
"git.schreifuchs.ch/lou-taylor/accounting/pkg/invoice/report"
)
type Service struct {
log *slog.Logger
invoice invoicer
mail mailer
}
func New(log *slog.Logger, invoice invoicer, mail mailer) *Service {
return &Service{log: log, invoice: invoice, mail: mail}
}
type invoicer interface {
Generate(creditor model.Entity, deptor *model.Entity, rate float64, repos []invoice.Repo, opts *invoice.Options) (document io.ReadCloser, report *report.Report, err error)
}
type mailer interface {
Send(m email.Mail) (err error)
}