2021-10-26 20:19:12 +02:00
|
|
|
package db
|
|
|
|
|
|
|
|
type View struct {
|
2024-10-05 22:16:25 +02:00
|
|
|
ID int `db:"id" json:"id" backup:"-"`
|
|
|
|
ProjectID int `db:"project_id" json:"project_id" backup:"-"`
|
2021-10-26 20:19:12 +02:00
|
|
|
Title string `db:"title" json:"title"`
|
2021-10-27 18:22:52 +02:00
|
|
|
Position int `db:"position" json:"position"`
|
2021-10-26 20:19:12 +02:00
|
|
|
}
|
2021-10-27 13:43:04 +02:00
|
|
|
|
|
|
|
func (view *View) Validate() error {
|
|
|
|
if view.Title == "" {
|
2021-11-02 20:30:45 +01:00
|
|
|
return &ValidationError{"title can not be empty"}
|
2021-10-27 13:43:04 +02:00
|
|
|
}
|
|
|
|
return nil
|
2024-10-05 22:16:25 +02:00
|
|
|
}
|