xtablo-source/backend/templates/tasks_forms.go
2026-05-15 22:40:25 +02:00

49 lines
1.4 KiB
Go

package templates
import "backend/internal/db/sqlc"
// TaskColumns defines the canonical left-to-right column order for the kanban board.
var TaskColumns = []sqlc.TaskStatus{
sqlc.TaskStatusTodo,
sqlc.TaskStatusInProgress,
sqlc.TaskStatusInReview,
sqlc.TaskStatusDone,
}
// TaskColumnLabels maps each TaskStatus to its human-readable column header label.
var TaskColumnLabels = map[sqlc.TaskStatus]string{
sqlc.TaskStatusTodo: "To do",
sqlc.TaskStatusInProgress: "In progress",
sqlc.TaskStatusInReview: "In review",
sqlc.TaskStatusDone: "Done",
}
// TaskCreateForm carries submitted field values back to the template for
// repopulation on validation failure.
type TaskCreateForm struct {
Title string
Status string // holds the column status value, e.g. "todo"
EtapeID string
}
// TaskCreateErrors holds per-field and general error messages for the task
// create form. An empty string means "no error for this field".
type TaskCreateErrors struct {
Title string
General string
}
// TaskUpdateForm carries submitted field values back to the template for
// repopulation on validation failure.
type TaskUpdateForm struct {
Title string
Description string
}
// TaskUpdateErrors holds per-field and general error messages for the task
// update/edit form. An empty string means "no error for this field".
type TaskUpdateErrors struct {
Title string
Description string
General string
}