parcoursmob/utils/sorting/beneficiaries.go

14 lines
430 B
Go
Raw Permalink Normal View History

2022-11-01 10:32:13 +00:00
package sorting
import (
mobilityaccountsstorage "git.coopgo.io/coopgo-platform/mobility-accounts/storage"
)
type BeneficiariesByName []mobilityaccountsstorage.Account
func (e BeneficiariesByName) Len() int { return len(e) }
func (e BeneficiariesByName) Less(i, j int) bool {
return e[i].Data["first_name"].(string) < e[j].Data["first_name"].(string)
}
func (e BeneficiariesByName) Swap(i, j int) { e[i], e[j] = e[j], e[i] }