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
This commit is contained in:
42
internal/domain/models.go
Normal file
42
internal/domain/models.go
Normal file
@@ -0,0 +1,42 @@
|
||||
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"`
|
||||
}
|
||||
Reference in New Issue
Block a user