package models

import (
	"fmt"
)

// Paper represents a research paper
type Paper struct {
	Title    string `json:"title"`
	Abstract string `json:"abstract"`
	ArxivID  string `json:"arxiv_id"`
}

// Result represents the evaluation result from the LLM
type Result struct {
	Paper       Paper  `json:"paper"`
	Decision    string `json:"decision"` // ACCEPT, REJECT, or ERROR
	Explanation string `json:"explanation"`
}

// OrganizedResults contains categorized results
type OrganizedResults struct {
	Accepted []Result `json:"accepted"`
	Rejected []Result `json:"rejected"`
	Errors   []Result `json:"errors"`
}

// Validate checks if a Result has valid decision value
func (r *Result) Validate() error {
	if r.Decision != "ACCEPT" && r.Decision != "REJECT" && r.Decision != "ERROR" {
		return fmt.Errorf("invalid decision value: %s", r.Decision)
	}
	return nil
}
