package model

import (
	"time"

	"gorm.io/datatypes"
)

type UserPaymentAccount struct {
	ID               uint64         `gorm:"primaryKey" json:"id"`
	UserID           uint64         `gorm:"not null;index" json:"user_id"`
	AccountType      string         `gorm:"size:32;not null" json:"account_type"`
	AccountName      string         `gorm:"size:128;not null" json:"account_name"`
	AccountNo        string         `gorm:"size:255;not null" json:"account_no"`
	BankName         string         `gorm:"size:128;not null;default:''" json:"bank_name"`
	BankBranch       string         `gorm:"size:255;not null;default:''" json:"bank_branch"`
	CertificateURLs  datatypes.JSON `json:"certificate_urls"`
	IsDefault        bool           `gorm:"not null;default:0" json:"is_default"`
	Status           string         `gorm:"size:32;not null;default:'active'" json:"status"`
	CreatedAt        time.Time      `json:"created_at"`
	UpdatedAt        time.Time      `json:"updated_at"`
}

func (UserPaymentAccount) TableName() string {
	return "user_payment_accounts"
}
