Files
projet_gestion_commande/backend/gestion/models/client.go
T
2026-06-14 17:50:35 +02:00

29 lines
2.1 KiB
Go

// models/client.go
package models
import "time"
type Client struct {
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"`
PointsExtra map[string]int `gorm:"-" json:"points_extra"`
PointsRedeemed map[string]int `gorm:"-" json:"points_redeemed"`
Parrain string `gorm:"column:parrain" json:"parrain"`
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
TwoFAEnabled bool `gorm:"column:two_fa_enabled;default:false" json:"two_fa_enabled"`
}
func (Client) TableName() string { return "clients" }