package models

import "time"

type User struct {
	ID                      uint       `gorm:"primaryKey"`
	Name                    string     `gorm:"column:name"`
	Email                   string     `gorm:"column:email"`
	Password                string     `gorm:"column:password"`
	ContactNo               string     `gorm:"column:contactNo"`
	CountryCode             string     `gorm:"column:countryCode"`
	BirthDate               string     `gorm:"column:birthDate"`
	BirthTime               string     `gorm:"column:birthTime"`
	BirthPlace              string     `gorm:"column:birthPlace"`
	AddressLine1            string     `gorm:"column:addressLine1"`
	// addressLine2 has always existed on the table but had no field, so the
	// second line could be neither read nor written.
	AddressLine2            string     `gorm:"column:addressLine2"`
	Location                string     `gorm:"column:location"`
	State                   string     `gorm:"column:state"`
	Country                 string     `gorm:"column:country"`
	Pincode                 string     `gorm:"column:pincode"`
	Gender                  string     `gorm:"column:gender"`
	MobileVerified          bool       `gorm:"column:mobile_verified"`
	EmailVerified           bool       `gorm:"column:email_verified"`
	Token                   string     `gorm:"column:jwt_token"`
	JwtToken                string     `gorm:"column:jwt_token"`
	RefreshToken            string     `gorm:"column:refresh_token"`
	ReferralCode            string     `gorm:"column:referral_code"`
	DeviceToken             string     `gorm:"column:device_token"`
	LastLogin               *time.Time `gorm:"column:last_login"`
	IsActive                bool       `gorm:"column:isActive"`
	IsDelete                bool       `gorm:"column:isDelete"`
	Profile                 string     `gorm:"column:profile"`
	RoleID                  uint       `gorm:"column:role_id"`
	UserRole                string     `gorm:"column:role"`
	ProfileCompleted        bool       `gorm:"column:profile_completed"`
	AstrologerProfileStatus string     `gorm:"column:astrologer_status"`
	LoginAllowed            bool       `gorm:"column:login_allowed"`
	Payments                []Payment
	Tickets                 []Ticket

	UserWallet   UserWallet               `gorm:"foreignKey:UserID"`
	WaitingQueue []AstrologerWaitingQueue `gorm:"foreignKey:UserID"`
}

func (User) TableName() string {
	return "users"
}
