feat: add String methods to enum types

Amolith created

Add String() to Motivation, TaskStatus, and RelationshipStrength for
consistency with Eisenhower.

Assisted-by: Claude Opus 4.5 via Amp

Change summary

motivation.go      |  5 +++++
motivation_test.go | 25 +++++++++++++++++++++++++
relationship.go    |  5 +++++
status.go          |  5 +++++
4 files changed, 40 insertions(+)

Detailed changes

motivation.go 🔗

@@ -28,6 +28,11 @@ var (
 	ErrInvalidMotivation = errors.New("invalid motivation")
 )
 
+// String returns the motivation value as a string.
+func (m Motivation) String() string {
+	return string(m)
+}
+
 // ParseMotivation parses a string to a Motivation value (case-insensitive).
 // Valid values: "unknown", "must", "should", "want".
 func ParseMotivation(str string) (Motivation, error) {

motivation_test.go 🔗

@@ -52,3 +52,28 @@ func TestParseMotivation(t *testing.T) {
 		})
 	}
 }
+
+func TestMotivation_String(t *testing.T) {
+	t.Parallel()
+
+	tests := []struct {
+		name  string
+		value lunatask.Motivation
+		want  string
+	}{
+		{"unknown", lunatask.MotivationUnknown, "unknown"},
+		{"must", lunatask.MotivationMust, "must"},
+		{"should", lunatask.MotivationShould, "should"},
+		{"want", lunatask.MotivationWant, "want"},
+	}
+
+	for _, tc := range tests {
+		t.Run(tc.name, func(t *testing.T) {
+			t.Parallel()
+
+			if got := tc.value.String(); got != tc.want {
+				t.Errorf("Motivation.String() = %q, want %q", got, tc.want)
+			}
+		})
+	}
+}

relationship.go 🔗

@@ -31,6 +31,11 @@ var (
 	ErrInvalidRelationshipStrength = errors.New("invalid relationship strength")
 )
 
+// String returns the relationship strength value as a string.
+func (r RelationshipStrength) String() string {
+	return string(r)
+}
+
 // ParseRelationshipStrength parses a string to a RelationshipStrength value (case-insensitive).
 // Valid values: "family", "intimate-friends", "close-friends", "casual-friends",
 // "acquaintances", "business-contacts", "almost-strangers".

status.go 🔗

@@ -29,6 +29,11 @@ var (
 	ErrInvalidTaskStatus = errors.New("invalid task status")
 )
 
+// String returns the task status value as a string.
+func (s TaskStatus) String() string {
+	return string(s)
+}
+
 // ParseTaskStatus parses a string to a TaskStatus value (case-insensitive).
 // Valid values: "later", "next", "started", "in-progress", "waiting", "completed".
 func ParseTaskStatus(str string) (TaskStatus, error) {