feat: updated docs and added description to files
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user