added validation; DB is global now

This commit is contained in:
$(pass /github/name)
2024-07-11 20:59:52 +02:00
parent e4475e2400
commit 03a2b3bdc5
22 changed files with 287 additions and 218 deletions

View File

@@ -5,12 +5,12 @@ import "time"
type BankAccount struct {
CreatedAt time.Time
UpdatedAt time.Time
MandateDateSigned time.Time `gorm:"not null" json:"mandate_date_signed"`
Bank string `json:"bank_name"`
AccountHolderName string `json:"account_holder_name"`
IBAN string `gorm:"not null" json:"iban"`
BIC string `json:"bic"`
MandateReference string `gorm:"not null" json:"mandate_reference"`
MandateDateSigned time.Time `gorm:"not null"` // json:"mandate_date_signed"`
Bank string //`json:"bank_name" validate:"omitempty,alphanumunicode"`
AccountHolderName string //`json:"account_holder_name" validate:"omitempty,alphaunicode"`
IBAN string `gorm:"not null" json:"iban" validate:"required,iban"`
BIC string //`json:"bic" validate:"omitempty,bic"`
MandateReference string `gorm:"not null"` //json:"mandate_reference"`
ID int64 `gorm:"primaryKey"`
UserID int64 `json:"user_id"`
UserID int64 //`json:"user_id"`
}