refactor: move enum types to companion files
Amolith
created 3 weeks ago
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
Change summary
motivation.go | 12 ++++++++++++
relationship.go | 15 +++++++++++++++
status.go | 13 +++++++++++++
types.go | 40 ----------------------------------------
4 files changed, 40 insertions(+), 40 deletions(-)
Detailed changes
@@ -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.
@@ -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.
@@ -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.
@@ -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"
-)