Files
havenllo/internal/domain/models.go
Hermes 041c3fab4b
Some checks failed
Build and deploy Havenllo / Verify Go and frontend (push) Failing after 7s
Build and deploy Havenllo / Build and push image (push) Has been skipped
Build and deploy Havenllo / Apply and restart Havenllo (push) Has been skipped
feat: implement Havenllo single-board kanban (Go+SQLite backend, Preact/Vite frontend)
- Single fixed 'Haven' board: lists (To do/In progress/Done) + cards, no multi-board
- Go 1.24 backend, CGO-free modernc.org/sqlite, embedded SPA, REST /api
- Preact + Vite + TS frontend, native HTML5 drag-and-drop, optimistic UI, dark Haven theme
- PVC (nfs-client) for SQLite, root container on NFS, simple nginx ingress havenllo.haven
- Dockerfile multi-arch build, Gitea CI via pipeline-actions@main
2026-07-14 10:13:51 -03:00

43 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"`
Done bool `json:"done"`
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"`
}