package response

import "time"

type ResModel struct {
	Vulnerabilities     []VulInfo `json:"vulnerabilities"`
	VulCount            int       `json:"vul_count"`
	IncrementalVulCount int       `json:"incremental_vul_count"`
}

type VulInfo struct {
	Id     string   `json:"id"`
	Title  string   `json:"title"`
	CVSSv3 string   `json:"CVSSv3"`
	Credit []string `json:"credit"`
	Semver struct {
		Vulnerable  []string `json:"vulnerable"`
		HashesRange []string `json:"hashesRange"`
		//VulnerableHashes []string `json:"vulnerableHashes"`
	} `json:"semver"`
	Exploit  string        `json:"exploit"`
	FixedIn  []string      `json:"fixedIn"`
	Patches  []interface{} `json:"patches"`
	Insights struct {
		TriageAdvice interface{} `json:"triageAdvice"`
	} `json:"insights"`
	Language   string        `json:"language"`
	Severity   string        `json:"severity"`
	CVSSScore  float64       `json:"cvssScore"`
	Functions  []interface{} `json:"functions"`
	Malicious  bool          `json:"malicious"`
	ModuleName string        `json:"moduleName"`
	References []struct {
		Url   string `json:"url"`
		Title string `json:"title"`
	} `json:"references"`
	CVSSDetails []struct {
		Assigner         string    `json:"assigner"`
		Severity         string    `json:"severity"`
		CvssV3Vector     string    `json:"cvssV3Vector"`
		CvssV3BaseScore  float64   `json:"cvssV3BaseScore"`
		ModificationTime time.Time `json:"modificationTime"`
	} `json:"cvssDetails"`
	Description string `json:"description"`
	Identifiers struct {
		CVE  []string `json:"CVE"`
		CWE  []string `json:"CWE"`
		GHSA []string `json:"GHSA"`
	} `json:"identifiers"`
	PackageName          string        `json:"packageName"`
	Proprietary          bool          `json:"proprietary"`
	CreationTime         time.Time     `json:"creationTime"`
	FunctionsNew         []interface{} `json:"functions_new"`
	AlternativeIds       []interface{} `json:"alternativeIds"`
	DisclosureTime       time.Time     `json:"disclosureTime"`
	PackageManager       string        `json:"packageManager"`
	PublicationTime      time.Time     `json:"publicationTime"`
	ModificationTime     time.Time     `json:"modificationTime"`
	SocialTrendAlert     bool          `json:"socialTrendAlert"`
	SeverityWithCritical string        `json:"severityWithCritical"`
	From                 []string      `json:"from"`
	UpgradePath          []interface{} `json:"upgradePath"`
	IsUpgradable         bool          `json:"isUpgradable"`
	IsPatchable          bool          `json:"isPatchable"`
	Name                 string        `json:"name"`
	Version              string        `json:"version"`
	IsDirectDependency   bool          `json:"is_direct_dependency"`
	IsFixable            bool          `json:"is_fixable"`
}
