auto deployment und tests

This commit is contained in:
Christoph K.
2026-03-20 07:07:38 +01:00
parent 0e7aa3e7f2
commit 8163f906cc
12 changed files with 500 additions and 66 deletions

View File

@@ -18,6 +18,8 @@ type Task struct {
Done bool `json:"done"`
CreatedAt time.Time `json:"created_at"`
DoneAt *time.Time `json:"done_at,omitempty"`
DueDate *time.Time `json:"due_date,omitempty"`
Priority string `json:"priority,omitempty"` // "hoch", "mittel", "niedrig"
}
// Store verwaltet tasks.json mit atomischen Schreiboperationen.
@@ -69,7 +71,7 @@ func (s *Store) save(tasks []Task) error {
}
// Add fügt einen neuen Task hinzu.
func (s *Store) Add(text string) (Task, error) {
func (s *Store) Add(text, priority string, dueDate *time.Time) (Task, error) {
s.mu.Lock()
defer s.mu.Unlock()
@@ -83,6 +85,8 @@ func (s *Store) Add(text string) (Task, error) {
Text: text,
Done: false,
CreatedAt: time.Now(),
Priority: priority,
DueDate: dueDate,
}
tasks = append(tasks, t)