Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
func ConnectDatabase ¶
func ConnectDatabase()
Types ¶
type CreateExpenseInput ¶
type CreateExpenseInput struct { Name string `json:"name" binding:"required"` Category string `json:"category" binding:"required"` Cost float32 `json:"cost" binding:"required"` Sharing float32 `json:"sharing" binding:"required"` Date string `json:"date"` Notes string `json:"notes"` GroupID uint `json:"group_id"` }
type Expense ¶
type Expense struct { ID uint `json:"id" gorm:"primary_key"` Name string `json:"name" validate:"min=3,max=40"` Category string `json:"category" validate:"min=1,max=20,regexp=^[a-z]*$"` Cost float32 `json:"cost" validate:"min=0.01,max=1000000"` Sharing float32 `json:"sharing" validate:"min=0.00,max=1.00"` Date string `json:"date" validate:"regexp=^(\\d{4}-([0]\\d|1[0-2])-([0-2]\\d|3[01]))?$"` Notes string `json:"notes" validate:"min=0,max=10000"` UserID uint `json:"user_id"` GroupID uint `json:"group_id" validate:"min=0"` }
type UpdateExpenseInput ¶
Click to show internal directories.
Click to hide internal directories.