feat: extra properties dynamiques, filtrage meta_status et alertes retard
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 2m37s

This commit is contained in:
Arnaud Delcasse
2026-02-27 16:40:46 +01:00
parent 95365ff8ce
commit 039111c36c
7 changed files with 562 additions and 47 deletions

View File

@@ -170,6 +170,14 @@ func IsGuaranteedTripMotivation(globalConfig *viper.Viper) func(string) bool {
}
}
// IsPast returns true if the given time is before the current time
func IsPast(d any) bool {
if date, ok := d.(time.Time); ok {
return date.Before(time.Now())
}
return false
}
// GetTemplateFuncMap returns the common template functions for rendering
func GetTemplateFuncMap(group groupsstorage.Group, globalConfig *viper.Viper, fileStorage filestorage.FileStorage) template.FuncMap {
return template.FuncMap{
@@ -191,6 +199,7 @@ func GetTemplateFuncMap(group groupsstorage.Group, globalConfig *viper.Viper, fi
"beneficiaryValidatedProfile": validatedprofile.ValidateProfile(globalConfig.Sub("modules.beneficiaries.validated_profile")),
"solidarityDriverValidatedProfile": validatedprofile.ValidateProfile(globalConfig.Sub("modules.solidarity_transport.drivers.validated_profile")),
"carpoolDriverValidatedProfile": validatedprofile.ValidateProfile(globalConfig.Sub("modules.organized_carpool.drivers.validated_profile")),
"isPast": IsPast,
"isGuaranteedTripMotivation": IsGuaranteedTripMotivation(globalConfig),
"beneficiaryDocuments": func(id string) []filestorage.FileInfo {
return fileStorage.List(filestorage.PREFIX_BENEFICIARIES + "/" + id)