package unmarshal

import (
	"io"

	govex "github.com/openvex/go-vex/pkg/vex"
)

type AnnotatedOpenVEXVulnerability struct {
	Document govex.Statement       `json:"document"`
	Fixes    []AnnotatedOpenVEXFix `json:"fixes"`
}

type AnnotatedOpenVEXFix struct {
	Available AnnotatedOpenVEXFixAvailability `json:"available"`
	Product   string                          `json:"product"`
}

type AnnotatedOpenVEXFixAvailability struct {
	Date string `json:"date"`
	Kind string `json:"kind"`
}

func AnnotatedOpenVEXVulnerabilityEntries(reader io.Reader) ([]AnnotatedOpenVEXVulnerability, error) {
	return unmarshalSingleOrMulti[AnnotatedOpenVEXVulnerability](reader)
}
