fixed minor bugs + added loggin middleware
All checks were successful
Tests / Run Go Tests (push) Successful in 1m26s

This commit is contained in:
2026-01-18 00:07:54 +01:00
parent 502955d32f
commit 560c539b19
6 changed files with 28 additions and 12 deletions

View File

@@ -49,19 +49,16 @@ func GetDays(user User, tsFrom, tsTo time.Time, orderedForward bool) []IWorkDay
}
for _, absentDay := range absences {
// Kurzarbeit should be integrated in workday
// Check if there is already a day
existingDay, ok := allDays[absentDay.Date().Format(time.DateOnly)]
if !ok {
allDays[absentDay.Date().Format(time.DateOnly)] = &absentDay
continue
}
switch {
case absentDay.AbwesenheitTyp.WorkTime < 0:
if workDay, ok := allDays[absentDay.Date().Format(time.DateOnly)].(*WorkDay); ok {
workDay.kurzArbeit = true
workDay.kurzArbeitAbsence = absentDay
}
case !existingDay.IsEmpty():
case ok && !existingDay.IsEmpty():
allDays[absentDay.Date().Format(time.DateOnly)] = NewCompondDay(absentDay.Date(), existingDay, &absentDay)
default:
allDays[absentDay.Date().Format(time.DateOnly)] = &absentDay