ussd/internal/models/VoucherModel.go

23 lines
500 B
Go
Raw Normal View History

2024-10-14 13:33:33 +02:00
package models
import (
"time"
"github.com/gofrs/uuid"
"gorm.io/gorm"
)
type Voucher struct {
gorm.Model
ID uuid.UUID `gorm:"type:uuid;primary_key;default:uuid_generate_v4()"`
UserID uuid.UUID
ContractAddress string
TokenSymbol string
TokenDecimals int
Balance float64
ActiveVouchers []ActiveVoucher `gorm:"foreignKey:VoucherID"`
Transactions []Transaction `gorm:"foreignKey:VoucherID"`
CreatedAt time.Time
UpdatedAt time.Time
}