nikurasu
123f9c5957
The waiting list is now saved in the db because before doing so the wating list was calculated on each request on the ui AFTER getting only the attendies that allowed the display which leads to false results. And it is now possible to get if an attendie is on the waiting list even if we only want do get one attendie via the API
24 lines
371 B
Go
24 lines
371 B
Go
package entities
|
|
|
|
type AttendiesList []Db_Attendies
|
|
|
|
func (a AttendiesList) CountByRole(role Role) int {
|
|
var count int
|
|
for _, attendie := range a {
|
|
if attendie.Role == role {
|
|
count++
|
|
}
|
|
}
|
|
return count
|
|
}
|
|
|
|
func (a AttendiesList) CountWaitingList() int {
|
|
var count int
|
|
for _, attendie := range a {
|
|
if attendie.OnWaitingList {
|
|
count++
|
|
}
|
|
}
|
|
return count
|
|
}
|