diff options
Diffstat (limited to 'internal/models')
| -rw-r--r-- | internal/models/atom.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/internal/models/atom.go b/internal/models/atom.go index 3d9ce54..967b489 100644 --- a/internal/models/atom.go +++ b/internal/models/atom.go @@ -14,6 +14,7 @@ const ( SourceMeal AtomSource = "plantoeat" SourceGTasks AtomSource = "gtasks" SourceClaudomator AtomSource = "claudomator" + SourceDoot AtomSource = "doot" ) type AtomType string @@ -102,6 +103,31 @@ func TaskToAtom(t Task) Atom { } } +// NativeTaskToAtom converts a native doot Task to an Atom. +func NativeTaskToAtom(t Task) Atom { + priority := t.Priority + if priority < 1 { + priority = 1 + } + if priority > 4 { + priority = 4 + } + + return Atom{ + ID: t.ID, + Title: t.Content, + Description: t.Description, + Source: SourceDoot, + Type: TypeTask, + DueDate: t.DueDate, + CreatedAt: t.CreatedAt, + Priority: priority, + SourceIcon: "✅", + ColorClass: "border-green-500", + Raw: t, + } +} + // CardToAtom converts a Trello Card to an Atom func CardToAtom(c Card) Atom { // Trello doesn't have explicit priority, default to medium (2) |
