package model

import "time"

type WithdrawalRequest struct {
	ID               uint64     `gorm:"primaryKey" json:"id"`
	WithdrawNo       string     `gorm:"size:64;not null;uniqueIndex" json:"withdraw_no"`
	UserID           uint64     `gorm:"not null;index" json:"user_id"`
	AmountCent       int64      `gorm:"not null;default:0" json:"-"`
	FeeCent          int64      `gorm:"not null;default:0" json:"-"`
	ActualAmountCent int64      `gorm:"not null;default:0" json:"-"`
	PaymentAccountID *uint64    `json:"payment_account_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:128;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"`
	Status           string     `gorm:"size:32;not null;default:'pending'" json:"status"`
	ReviewedBy       *uint64    `json:"reviewed_by"`
	ReviewedAt       *time.Time `json:"reviewed_at"`
	ReviewRemark     string     `gorm:"size:255;not null;default:''" json:"review_remark"`
	PaidBy           *uint64    `json:"paid_by"`
	PaidAt           *time.Time `json:"paid_at"`
	PaymentProofURL  string     `gorm:"size:512;not null;default:''" json:"payment_proof_url"`
	PaymentRemark    string     `gorm:"size:255;not null;default:''" json:"payment_remark"`
	CreatedAt        time.Time  `json:"created_at"`
	UpdatedAt        time.Time  `json:"updated_at"`
}

func (WithdrawalRequest) TableName() string {
	return "withdrawal_requests"
}
