// SPDX-FileCopyrightText: Amolith <amolith@secluded.site>
//
// SPDX-License-Identifier: AGPL-3.0-or-later

package tasks

// CreateInput is the input for the create_task tool.
type CreateInput struct {
	// AreaID is the area in which to create the task.
	// Must be a valid area_id from the areas resource.
	AreaID string `json:"area_id" jsonschema:"required"`
	// GoalID is an optional goal to associate the task with.
	// Must belong to the specified area.
	GoalID *string `json:"goal_id,omitempty"`
	// Name is the plain text task name using sentence case (max 100 characters).
	Name string `json:"name" jsonschema:"required"`
	// Note contains additional details using Markdown formatting.
	Note *string `json:"note,omitempty"`
	// Estimate is the estimated completion time in minutes (0-720, max 12 hours).
	Estimate *int `json:"estimate,omitempty"`
	// Priority is the task priority level.
	Priority *string `json:"priority,omitempty"`
	// Motivation indicates importance: must (critical), should (important), want (nice-to-have).
	Motivation *string `json:"motivation,omitempty"`
	// Eisenhower is the Eisenhower Matrix quadrant for prioritization.
	// Valid: uncategorized, do-now, delegate, do-later, eliminate.
	Eisenhower *string `json:"eisenhower,omitempty"`
	// Status is the initial task status.
	Status *string `json:"status,omitempty"`
	// ScheduledOn is the scheduled date in YYYY-MM-DD format.
	// Use get_timestamp tool first for natural language dates.
	ScheduledOn *string `json:"scheduled_on,omitempty"`
	// Source is the origin of the task (e.g. "home-assistant").
	Source *string `json:"source,omitempty"`
	// SourceID is the external ID from the source system.
	SourceID *string `json:"source_id,omitempty"`
}

// CreateOutput is the output for the create_task tool.
// When a task already exists (duplicate), TaskID will be empty and Message will indicate this.
type CreateOutput struct {
	TaskID   string `json:"task_id,omitempty"`   // ID of the created task (empty if duplicate)
	Message  string `json:"message"`             // Human-readable result message
	DeepLink string `json:"deep_link,omitempty"` // Lunatask deep link to the task
}

// UpdateInput is the input for the update_task tool.
type UpdateInput struct {
	// TaskID is the ID of the task to update.
	TaskID string `json:"task_id" jsonschema:"required"`
	// AreaID is the new area. Only include if moving the task.
	AreaID *string `json:"area_id,omitempty"`
	// GoalID is the new goal. Must belong to the task's area.
	GoalID *string `json:"goal_id,omitempty"`
	// Name is the new task name. Empty string clears the name.
	Name *string `json:"name,omitempty"`
	// Note is the new note content. Empty string clears the note.
	Note *string `json:"note,omitempty"`
	// Estimate is the new time estimate in minutes.
	Estimate *int `json:"estimate,omitempty"`
	// Priority is the new priority level.
	Priority *string `json:"priority,omitempty"`
	// Motivation is the new importance level. Empty string clears.
	Motivation *string `json:"motivation,omitempty"`
	// Eisenhower is the new Eisenhower quadrant.
	// Valid: uncategorized, do-now, delegate, do-later, eliminate.
	Eisenhower *string `json:"eisenhower,omitempty"`
	// Status is the new task status. Empty string clears.
	Status *string `json:"status,omitempty"`
	// ScheduledOn is the new scheduled date in YYYY-MM-DD format.
	ScheduledOn *string `json:"scheduled_on,omitempty"`
}

// UpdateOutput is the output for the update_task tool.
type UpdateOutput struct {
	TaskID   string `json:"task_id"`             // ID of the updated task
	Message  string `json:"message"`             // Human-readable result message
	DeepLink string `json:"deep_link,omitempty"` // Lunatask deep link to the task
}

// DeleteInput is the input for the delete_task tool.
type DeleteInput struct {
	// TaskID is the ID of the task to delete. This action cannot be undone.
	TaskID string `json:"task_id" jsonschema:"required"`
}

// DeleteOutput is the output for the delete_task tool.
type DeleteOutput struct {
	Message string `json:"message"` // Human-readable result message
}
