chore: refacto
This commit is contained in:
@@ -4,20 +4,23 @@ package models
|
||||
import "time"
|
||||
|
||||
type Client struct {
|
||||
ID int `gorm:"primaryKey;autoIncrement" json:"id"`
|
||||
Username string `gorm:"column:username" json:"username"`
|
||||
Password string `gorm:"column:password" json:"-"`
|
||||
Nom string `gorm:"column:nom" json:"nom"`
|
||||
Prenom string `gorm:"column:prenom" json:"prenom"`
|
||||
Telephone string `gorm:"column:telephone" json:"telephone"`
|
||||
Command int `gorm:"column:command" json:"command"`
|
||||
PointsExtra map[string]int `gorm:"-" json:"points_extra"`
|
||||
Amende float64 `gorm:"column:amende" json:"amende"`
|
||||
CancellationsCount int `gorm:"column:cancellations_count" json:"cancellations_count"`
|
||||
LastPenaltyReason string `gorm:"column:last_penalty_reason" json:"last_penalty_reason"`
|
||||
MustChangePassword bool `gorm:"column:must_change_password" json:"must_change_password"`
|
||||
ReferralBalance float64 `gorm:"column:referral_balance" json:"referral_balance"`
|
||||
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
||||
ID int `gorm:"primaryKey;autoIncrement" json:"id"`
|
||||
Username string `gorm:"column:username;not null" json:"username"`
|
||||
Password string `gorm:"column:password" json:"-"`
|
||||
Nom string `gorm:"column:nom" json:"nom"`
|
||||
Prenom string `gorm:"column:prenom" json:"prenom"`
|
||||
Telephone string `gorm:"column:telephone;not null" json:"telephone"`
|
||||
Command int `gorm:"column:command;default:0" json:"command"`
|
||||
CancelCommande int `gorm:"column:cancel_commande;default:0" json:"cancel_commande"`
|
||||
Amende float64 `gorm:"column:amende;default:0" json:"amende"`
|
||||
CancellationsCount int `gorm:"column:cancellations_count;not null;default:0" json:"cancellations_count"`
|
||||
LastPenaltyReason string `gorm:"column:last_penalty_reason" json:"last_penalty_reason"`
|
||||
MustChangePassword bool `gorm:"column:must_change_password;default:false" json:"must_change_password"`
|
||||
ReferralBalance float64 `gorm:"column:referral_balance;default:0" json:"referral_balance"`
|
||||
// points_extra est un JSONB géré manuellement (type non supporté nativement par GORM)
|
||||
PointsExtra map[string]int `gorm:"-" json:"points_extra"`
|
||||
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
|
||||
}
|
||||
|
||||
func (Client) TableName() string { return "clients" }
|
||||
|
||||
Reference in New Issue
Block a user