feat: updated docs and added description to files
Some checks failed
Tests / Run Go Tests (push) Failing after 1m35s
Arbeitszeitmessung Deploy / Build Webserver (push) Successful in 2m48s

This commit is contained in:
2026-01-29 18:28:28 +01:00
parent 41c34c42cf
commit ba034f1c33
52 changed files with 458 additions and 3413 deletions

View File

@@ -1,5 +1,11 @@
package models
// the user type represents the user of the software
// it has functions to request the bookings and other data based
// on either the "PersonalNummer" or "CardUID"
//
// users and their passwords are stored in the "s_personal_daten" and "user_pass" tables
import (
"arbeitszeitmessung/helper"
"context"
@@ -149,7 +155,7 @@ func (u *User) CheckAnwesenheit() bool {
// Creates a new booking for the user -> check_in_out will be 254 for automatic check out
func (u *User) CheckOut() error {
booking := (*Booking).New(nil, u.CardUID, 0, 254, 1)
booking := (*Booking).NewBooking(nil, u.CardUID, 0, 254, 1)
err := booking.Insert()
if err != nil {
fmt.Printf("Error inserting booking %v -> %v\n", booking, err)
@@ -282,15 +288,6 @@ func (u *User) GetNextWeek() WorkWeek {
}
func parseUser(rows *sql.Rows) (User, error) {
var user User
if err := rows.Scan(&user.PersonalNummer, &user.CardUID, &user.Vorname, &user.Name, &user.ArbeitszeitPerTag); err != nil {
log.Println("Error scanning row!", err)
return user, err
}
return user, nil
}
// returns the start of the week, the last submission was made, submission == first booking or last send wochen_report to team leader
func (u *User) GetLastWorkWeekSubmission() time.Time {
var lastSub time.Time