2024-08-01 23:02:55 +02:00
|
|
|
package db
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"gorm.io/gorm"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Debt struct {
|
|
|
|
gorm.Model
|
2024-08-03 07:05:46 +02:00
|
|
|
CardID uint
|
|
|
|
Card *Card
|
2024-08-03 14:49:58 +02:00
|
|
|
Comment string
|
2024-08-03 07:05:46 +02:00
|
|
|
Value uint64
|
|
|
|
IOwe bool
|
|
|
|
Date time.Time
|
|
|
|
DateEnd time.Time
|
|
|
|
Finished bool
|
2024-08-08 19:14:50 +02:00
|
|
|
UserID uint
|
|
|
|
User *User
|
2024-08-01 23:02:55 +02:00
|
|
|
}
|
2024-11-01 23:05:28 +01:00
|
|
|
|
|
|
|
// Implements db.UserIdentifiable:1
|
|
|
|
func (d Debt) GetID() uint {
|
|
|
|
return d.ID
|
|
|
|
}
|
|
|
|
|
|
|
|
// Implements db.UserIdentifiable:2
|
|
|
|
func (d Debt) GetUserID() uint {
|
|
|
|
return d.UserID
|
|
|
|
}
|
|
|
|
|
|
|
|
// Implements db.UserIdentifiable:3
|
|
|
|
func (d *Debt) SetUserID(id uint) {
|
|
|
|
d.UserID = id
|
|
|
|
}
|