From 11e8cc5b1d5ee46eafe89f8a49eb2465ad945af9 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 17 Apr 2025 22:22:50 +0200 Subject: [PATCH] feat(certificate): Add SepaConfig to certificate generation and CombinedGroupName to runners --- handlers/certificate.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/handlers/certificate.go b/handlers/certificate.go index fb32700..7171bc2 100644 --- a/handlers/certificate.go +++ b/handlers/certificate.go @@ -58,6 +58,12 @@ func (h *DefaultHandler) GenerateCertificate(c *fiber.Ctx) error { Footer: h.Config.CertificateFooter, CurrencySymbol: h.Config.CurrencySymbol, Locale: certificateRequest.Locale, + SepaConfig: &models.SepaConfig{ + BIC: h.Config.SepaBic, + HolderName: h.Config.SepaName, + IBAN: h.Config.SepaIban, + CurrencyIdentifier: h.Config.CurrencyIdentifier, + }, } logger.Info("Generating certificate html") @@ -90,6 +96,13 @@ func addUpRunnerDonations(runners []models.RunnerWithDonations) []models.RunnerW runners[i].TotalDonations += runners[i].DistanceDonations[j].Amount runners[i].TotalPerDistance += runners[i].DistanceDonations[j].AmountPerDistance } + if runners[i].Group.ParentGroup.Name != "" { + runners[i].CombinedGroupName = runners[i].Group.ParentGroup.Name + " - " + runners[i].Group.Name + } else { + runners[i].CombinedGroupName = runners[i].Group.Name + + } + } return runners }