added feiertage to database + endpoint to insert every year

This commit is contained in:
2025-12-23 12:21:03 +01:00
parent f562ef2a33
commit 3439fff841
11 changed files with 245 additions and 88 deletions

View File

@@ -23,11 +23,11 @@ type WorkDay struct {
worktimeAbsece Absence
}
type WorktimeBase string
type WorktimeBase int
const (
WorktimeBaseWeek WorktimeBase = "week"
WorktimeBaseDay WorktimeBase = "day"
WorktimeBaseWeek WorktimeBase = 5
WorktimeBaseDay WorktimeBase = 1
)
func (d *WorkDay) GetWorktimeAbsence() Absence {
@@ -126,6 +126,10 @@ func (d *WorkDay) Date() time.Time {
return d.Day
}
func (d *WorkDay) Type() DayType {
return DayTypeWorkday
}
func (d *WorkDay) GenerateKurzArbeitBookings(u User) (time.Time, time.Time) {
var timeFrom, timeTo time.Time
if d.GetWorktime(u, WorktimeBaseDay, false) >= u.ArbeitszeitProTag() {