added interface for workday and absence + multiday absences closes #38, #39

This commit is contained in:
2025-09-23 12:30:02 +02:00
parent 55b0332600
commit db6fc10c28
19 changed files with 1396 additions and 1034 deletions

View File

@@ -85,6 +85,15 @@ func (u *User) GetAll() ([]User, error) {
return users, nil
}
// Returns the worktime per day rounded to minutes
func (u *User) ArbeitszeitProTag() time.Duration {
return time.Duration(u.ArbeitszeitPerTag * float32(time.Hour)).Round(time.Minute)
}
func (u *User) ArbeitszeitProWoche() time.Duration {
return time.Duration(u.ArbeitszeitPerWoche * float32(time.Hour)).Round(time.Minute)
}
// Returns true if there is a booking 1 for today -> meaning the user is at work
// Returns false if there is no booking today or the user is already booked out of the system
func (u *User) CheckAnwesenheit() bool {