Files
schreifuchs 9a5ea229bf
All checks were successful
Go / build (push) Successful in 14s
feat/user-templates (#9)
feat: user templates
2025-12-03 21:27:46 +01:00

30 lines
760 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)
}