fix: remove redundant code in processing logic
Some checks failed
CI / build-and-test (push) Failing after -31m35s
Some checks failed
CI / build-and-test (push) Failing after -31m35s
This commit is contained in:
83
internal/types/plan.go
Normal file
83
internal/types/plan.go
Normal file
@@ -0,0 +1,83 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type PlanStatus string
|
||||
|
||||
const (
|
||||
PlanStatusDraft PlanStatus = "draft"
|
||||
PlanStatusActive PlanStatus = "active"
|
||||
PlanStatusBlocked PlanStatus = "blocked"
|
||||
PlanStatusCompleted PlanStatus = "completed"
|
||||
PlanStatusCancelled PlanStatus = "cancelled"
|
||||
PlanStatusSuperseded PlanStatus = "superseded"
|
||||
)
|
||||
|
||||
type PlanPriority string
|
||||
|
||||
const (
|
||||
PlanPriorityLow PlanPriority = "low"
|
||||
PlanPriorityMedium PlanPriority = "medium"
|
||||
PlanPriorityHigh PlanPriority = "high"
|
||||
PlanPriorityCritical PlanPriority = "critical"
|
||||
)
|
||||
|
||||
type Plan struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Status PlanStatus `json:"status"`
|
||||
Priority PlanPriority `json:"priority"`
|
||||
ProjectID *uuid.UUID `json:"project_id,omitempty"`
|
||||
Owner string `json:"owner,omitempty"`
|
||||
DueDate *time.Time `json:"due_date,omitempty"`
|
||||
CompletedAt *time.Time `json:"completed_at,omitempty"`
|
||||
ReviewedBy string `json:"reviewed_by,omitempty"`
|
||||
LastReviewedAt *time.Time `json:"last_reviewed_at,omitempty"`
|
||||
SupersedesPlanID *uuid.UUID `json:"supersedes_plan_id,omitempty"`
|
||||
Tags []string `json:"tags"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// PlanDetail enriches Plan with all related records, returned by get_plan.
|
||||
type PlanDetail struct {
|
||||
Plan
|
||||
DependsOn []Plan `json:"depends_on"`
|
||||
Blocks []Plan `json:"blocks"`
|
||||
RelatedPlans []Plan `json:"related_plans"`
|
||||
Skills []AgentSkill `json:"skills"`
|
||||
Guardrails []AgentGuardrail `json:"guardrails"`
|
||||
}
|
||||
|
||||
type PlanFilter struct {
|
||||
Limit int
|
||||
ProjectID *uuid.UUID
|
||||
Status string
|
||||
Priority string
|
||||
Owner string
|
||||
Tag string
|
||||
Query string
|
||||
}
|
||||
|
||||
// PlanUpdate describes a partial update; nil pointer fields are not touched.
|
||||
type PlanUpdate struct {
|
||||
Title *string
|
||||
Description *string
|
||||
Status *string
|
||||
Priority *string
|
||||
Owner *string // "" to clear
|
||||
DueDate *time.Time // nil = no change
|
||||
ClearDueDate bool // true = set NULL (takes priority over DueDate)
|
||||
CompletedAt *time.Time
|
||||
ClearCompletedAt bool
|
||||
ReviewedBy *string // "" to clear
|
||||
MarkReviewed bool // sets last_reviewed_at = now()
|
||||
SupersedesPlanID *uuid.UUID
|
||||
ClearSupersedesPlanID bool
|
||||
Tags *[]string // nil = no change; replace when non-nil
|
||||
}
|
||||
Reference in New Issue
Block a user