23 lines
552 B
Go
23 lines
552 B
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type CategoryRule struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
Contain *string `json:"contain"`
|
|
Match *string `json:"match"`
|
|
Amount *float64 `json:"amount"`
|
|
DateFrom *time.Time `json:"date_from"`
|
|
DateTo *time.Time `json:"date_to"`
|
|
BankCategory *string `json:"bank_category"`
|
|
CategoryID int `gorm:"not null" json:"-"`
|
|
Category *Category
|
|
}
|
|
|
|
func NewCategoryRule(label, color string) *CategoryRule {
|
|
rule := CategoryRule{}
|
|
|
|
return &rule
|
|
}
|