Skip to content

Commit

Permalink
wip: model validation
Browse files Browse the repository at this point in the history
  • Loading branch information
katallaxie authored May 1, 2024
1 parent 8ab9cea commit dab43e3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/api/models/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ import (

// System ...
type System struct {
ID uuid.UUID `json:"id" gorm:"type:uuid;default:gen_random_uuid()"`
Name string `json:"name" gorm:"unique"`
Description string `json:"description"`
// ID is the unique identifier for the system.
ID uuid.UUID `json:"id" gorm:"type:uuid;default:gen_random_uuid()"`
// Name is the name of the system.
Name string `json:"name" gorm:"unique" validate:"required,min=3,max=128"`
// Description is the description of the system.
Description string `json:"description" validate:"max=1024"`

// Operator is the operator this is associated with this system to operate.
Operator Operator `json:"operator" gorm:"foreignKey:OperatorID"`
Expand Down

0 comments on commit dab43e3

Please sign in to comment.