Files
havenllo/internal/domain/models.go
Hermes afd23ca751
Some checks failed
Build and deploy Havenllo / Verify Go and frontend (push) Failing after 29s
Build and deploy Havenllo / Build and push image (push) Has been skipped
Build and deploy Havenllo / Apply and restart Havenllo (push) Has been skipped
ui overhaul
2026-07-14 11:09:54 -03:00

42 lines
1.0 KiB
Go

package domain
import "errors"
var (
ErrNotFound = errors.New("resource not found")
ErrLastList = errors.New("the last remaining list cannot be deleted")
)
// ValidationError represents a user-correctable domain validation failure.
type ValidationError struct{ Message string }
func (e ValidationError) Error() string { return e.Message }
type List struct {
ID int64 `json:"id"`
Name string `json:"name"`
Position float64 `json:"position"`
CardCount int `json:"card_count,omitempty"`
}
type Card struct {
ID int64 `json:"id"`
ListID int64 `json:"list_id"`
Title string `json:"title"`
Description string `json:"description"`
Position float64 `json:"position"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type ListWithCards struct {
ID int64 `json:"id"`
Name string `json:"name"`
Position float64 `json:"position"`
Cards []Card `json:"cards"`
}
type Snapshot struct {
Lists []ListWithCards `json:"lists"`
}