package model import ( "time" ) type SavingAccount struct { ID uint `gorm:"primaryKey" json:"id"` Label string `gorm:"unique;not null" json:"label"` BlockedAmount float64 `json:"blocked_amount"` ReleasedAmount float64 `json:"released_amount"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } func NewSavingAccount(label string, blockedAmount, releasedAmount float64) *SavingAccount { account := SavingAccount{ Label: label, BlockedAmount: blockedAmount, ReleasedAmount: releasedAmount, } return &account }