@@ -33,10 +33,35 @@ func NewClient(accessToken string) *Client {
}
}
+// Source represents a task source like GitHub or other integrations
+type Source struct {
+ Source string `json:"source"`
+ SourceID string `json:"source_id"`
+}
+
+// Task is only ever used in responses
+type Task struct {
+ ID string `json:"id,omitempty"`
+ AreaID string `json:"area_id,omitempty"`
+ GoalID string `json:"goal_id,omitempty"`
+ Status string `json:"status,omitempty"`
+ PreviousStatus string `json:"previous_status,omitempty"`
+ Estimate int `json:"estimate,omitempty"`
+ Priority int `json:"priority,omitempty"`
+ Progress int `json:"progress,omitempty"`
+ Motivation string `json:"motivation,omitempty"`
+ Eisenhower int `json:"eisenhower,omitempty"`
+ Sources []Source `json:"sources,omitempty"`
+ ScheduledOn string `json:"scheduled_on,omitempty"`
+ CompletedAt string `json:"completed_at,omitempty"`
+ CreatedAt string `json:"created_at,omitempty"`
+ UpdatedAt string `json:"updated_at,omitempty"`
+}
+
// CreateTaskRequest represents the request to create a task in Lunatask
type CreateTaskRequest struct {
- AreaID string `json:"area_id"`
- GoalID string `json:"goal_id,omitempty" validate:"omitempty"`
+ AreaID string `json:"area_id" validate:"omitempty,uuid4"`
+ GoalID string `json:"goal_id,omitempty" validate:"omitempty,uuid4"`
Name string `json:"name" validate:"max=100"`
Note string `json:"note,omitempty" validate:"omitempty"`
Status string `json:"status,omitempty" validate:"omitempty,oneof=later next started waiting completed"`