package parser

import (
	"git.mchus.pro/mchus/logpile/internal/models"
)

// VendorParser interface for vendor-specific parsers
type VendorParser interface {
	// Name returns human-readable parser name
	Name() string

	// Vendor returns vendor identifier (e.g., "inspur", "dell", "h3c_g6")
	Vendor() string

	// Version returns parser version string
	// IMPORTANT: Increment version when modifying parser logic!
	Version() string

	// Detect checks if this parser can handle the given files
	// Returns confidence score 0-100 (0 = cannot parse, 100 = definitely this format)
	Detect(files []ExtractedFile) int

	// Parse parses the extracted files and returns analysis result
	Parse(files []ExtractedFile) (*models.AnalysisResult, error)
}

// FileParser interface for parsing specific file types within vendor module
type FileParser interface {
	// CanParse checks if this parser can handle the file
	CanParse(file ExtractedFile) bool

	// Parse parses the file content
	Parse(content []byte) error
}
