fix: refactored sql request for get days + highlight invalid bookings and ignore them for calculation
Some checks failed
Tests / Run Go Tests (push) Failing after 1m14s

fixed #77
This commit is contained in:
2026-02-06 17:54:16 +01:00
parent 38322a64cf
commit 2d8747c971
4 changed files with 220 additions and 154 deletions

View File

@@ -77,10 +77,13 @@ templ newBookingComponent(d models.IWorkDay) {
templ bookingComponent(booking models.Booking) {
<div>
<p class="text-neutral-500 edit-box">
<p class={ "text-neutral-500 edit-box", templ.KV("text-red-500", !booking.Valid) }>
<span class="text-black group-[.edit]:hidden inline">{ booking.Timestamp.Format("15:04") }</span>
<input disabled name={ "booking_" + strconv.Itoa(booking.CounterId) } type="time" value={ booking.Timestamp.Format("15:04") } class="text-neutral-700 group-[.edit]:inline hidden bg-neutral-100 text-sm px-3 py-2 cursor-pointer"/>
{ booking.GetBookingType() }
if !booking.Valid {
fehlerhafte Buchung, wird nicht zur Berechnung verwendet!
}
</p>
if booking.IsSubmittedAndChecked() {
<p>submitted</p>
@@ -89,10 +92,10 @@ templ bookingComponent(booking models.Booking) {
}
templ workdayComponent(workDay *models.WorkDay) {
if len(workDay.Bookings) < 1 {
if workDay.IsEmpty() && !workDay.IsKurzArbeit() {
<p class="text group-[.edit]:hidden">Keine Buchung gefunden. Bitte Arbeitsstunden oder Grund der Abwesenheit eingeben!</p>
} else {
if workDay.IsKurzArbeit() && len(workDay.Bookings) > 0 {
if workDay.IsKurzArbeit() {
@absenceComponent(workDay.GetKurzArbeit(), true)
}
for _, booking := range workDay.Bookings {