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

package person

import (
	"fmt"

	"git.secluded.site/lune/internal/validate"
	"github.com/spf13/cobra"
)

// TimelineCmd adds a timeline note to a person. Exported for potential use by shortcuts.
var TimelineCmd = &cobra.Command{
	Use:   "timeline ID",
	Short: "Add a timeline note",
	Long: `Add a timeline note to a person's memory timeline.

Use "-" as content flag value to read from stdin.`,
	Args: cobra.ExactArgs(1),
	RunE: func(cmd *cobra.Command, args []string) error {
		id, err := validate.Reference(args[0])
		if err != nil {
			return err
		}

		// TODO: implement timeline note creation
		fmt.Fprintf(cmd.OutOrStdout(), "Adding timeline note to person %s (not yet implemented)\n", id)

		return nil
	},
}

func init() {
	TimelineCmd.Flags().StringP("content", "c", "", "Note content (use - for stdin)")
	TimelineCmd.Flags().StringP("date", "d", "", "Date of interaction (natural language)")
}
