From fad07e7e3ae9e5fa0a9bd7d5c0467adf9905f589 Mon Sep 17 00:00:00 2001 From: Amolith Date: Mon, 22 Dec 2025 08:42:22 -0700 Subject: [PATCH] refactor: move enum types to companion files Move Motivation, TaskStatus, RelationshipStrength types and constants from types.go to their respective files (motivation.go, status.go, relationship.go). types.go now contains only Source and Date. Assisted-by: Claude Sonnet 4 via Crush --- motivation.go | 12 ++++++++++++ relationship.go | 15 +++++++++++++++ status.go | 13 +++++++++++++ types.go | 40 ---------------------------------------- 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/motivation.go b/motivation.go index e30e7a4278f64bceed1d49c0b9ae3ca6a6a0b258..94436ffbeddd8ce2535b242457d6cb8bed1d600f 100644 --- a/motivation.go +++ b/motivation.go @@ -10,6 +10,18 @@ import ( "strings" ) +// Motivation represents why a task matters. +type Motivation string + +// Valid motivation values. +const ( + // MotivationUnknown clears/unsets the motivation (default). + MotivationUnknown Motivation = "unknown" + MotivationMust Motivation = "must" + MotivationShould Motivation = "should" + MotivationWant Motivation = "want" +) + // Errors returned by Motivation operations. var ( // ErrInvalidMotivation is returned when parsing an unknown motivation string. diff --git a/relationship.go b/relationship.go index 6806240a0dc61238f0f1235444e37ea9456c5d81..fc6fa7e0cc05248602d8d1db2b626ebeed9e2e95 100644 --- a/relationship.go +++ b/relationship.go @@ -10,6 +10,21 @@ import ( "strings" ) +// RelationshipStrength categorizes the closeness of a relationship. +type RelationshipStrength string + +// Valid relationship strength values. +const ( + RelationshipFamily RelationshipStrength = "family" + RelationshipIntimateFriend RelationshipStrength = "intimate-friends" + RelationshipCloseFriend RelationshipStrength = "close-friends" + // RelationshipCasualFriend is the default if not specified. + RelationshipCasualFriend RelationshipStrength = "casual-friends" + RelationshipAcquaintance RelationshipStrength = "acquaintances" + RelationshipBusiness RelationshipStrength = "business-contacts" + RelationshipAlmostStranger RelationshipStrength = "almost-strangers" +) + // Errors returned by RelationshipStrength operations. var ( // ErrInvalidRelationshipStrength is returned when parsing an unknown relationship strength string. diff --git a/status.go b/status.go index a58fa915e6e71b056117a1b4eb86d94fefbbe482..c3c861d72021d0e5442b59b6c0a19b918859965a 100644 --- a/status.go +++ b/status.go @@ -10,6 +10,19 @@ import ( "strings" ) +// TaskStatus represents the workflow state of a task. +type TaskStatus string + +// Valid task status values. +const ( + // StatusLater is the default status for new tasks. + StatusLater TaskStatus = "later" + StatusNext TaskStatus = "next" + StatusInProgress TaskStatus = "started" + StatusWaiting TaskStatus = "waiting" + StatusCompleted TaskStatus = "completed" +) + // Errors returned by TaskStatus operations. var ( // ErrInvalidTaskStatus is returned when parsing an unknown task status string. diff --git a/types.go b/types.go index ac1411adf029d0d91494ddb8f018a4e85ae2c46f..3a7371cc551180af8afd2af0d0a5018a921eb7ca 100644 --- a/types.go +++ b/types.go @@ -87,43 +87,3 @@ func ParseDate(s string) (Date, error) { func Today() Date { return NewDate(time.Now()) } - -// RelationshipStrength categorizes the closeness of a relationship. -type RelationshipStrength string - -// Valid relationship strength values. -const ( - RelationshipFamily RelationshipStrength = "family" - RelationshipIntimateFriend RelationshipStrength = "intimate-friends" - RelationshipCloseFriend RelationshipStrength = "close-friends" - // RelationshipCasualFriend is the default if not specified. - RelationshipCasualFriend RelationshipStrength = "casual-friends" - RelationshipAcquaintance RelationshipStrength = "acquaintances" - RelationshipBusiness RelationshipStrength = "business-contacts" - RelationshipAlmostStranger RelationshipStrength = "almost-strangers" -) - -// TaskStatus represents the workflow state of a task. -type TaskStatus string - -// Valid task status values. -const ( - // StatusLater is the default status for new tasks. - StatusLater TaskStatus = "later" - StatusNext TaskStatus = "next" - StatusInProgress TaskStatus = "started" - StatusWaiting TaskStatus = "waiting" - StatusCompleted TaskStatus = "completed" -) - -// Motivation represents why a task matters. -type Motivation string - -// Valid motivation values. -const ( - // MotivationUnknown clears/unsets the motivation (default). - MotivationUnknown Motivation = "unknown" - MotivationMust Motivation = "must" - MotivationShould Motivation = "should" - MotivationWant Motivation = "want" -)