Files
amcs/internal/types/plan.go
Hein 91239bcf4b
Some checks failed
CI / build-and-test (push) Failing after -31m12s
refactor(store,tools): migrate IDs from UUID to bigserial int64
All internal entity lookups now use bigserial primary keys (int64) while
GUIDs are retained for external/public identification. Updated store
functions (TouchProject, UpdateThoughtMetadata, AddThoughtAttachment) to
query by id instead of guid, added GetThoughtByID, changed semanticSearch
and all tool helpers to use *int64 project IDs, and updated retry/backfill
workers to use int64 thought IDs throughout.
2026-05-03 11:43:34 +02:00

85 lines
2.6 KiB
Go

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 int64 `json:"id"`
GUID uuid.UUID `json:"guid"`
Title string `json:"title"`
Description string `json:"description"`
Status PlanStatus `json:"status"`
Priority PlanPriority `json:"priority"`
ProjectID *int64 `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 *int64 `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 *int64
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 *int64
ClearSupersedesPlanID bool
Tags *[]string // nil = no change; replace when non-nil
}