package entities

type Voucher struct {
	ID           int64  `gorm:"type:bigserial;primary_key;autoIncrement" json:"id"`
	Name         string `gorm:"not null;size:100" json:"name" validate:"required"`
	Email        string `gorm:"not null;size:255" json:"email" validate:"required"`
	PhoneNumber  string `gorm:"not null;size:20" json:"phone_number" validate:"required"`
	VoucherCode  string `gorm:"not null;size:50" json:"voucher_code" validate:"required"`
	WinnerNumber int    `gorm:"not null;default:0" json:"winner_number" validate:"required"`
	IsWinner     bool   `gorm:"not null;default:false" json:"is_winner"`
}

func (Voucher) TableName() string {
	return "vouchers"
}
