package ucca

// NIS2ObligationsConfig is the YAML structure for NIS2/AI Act obligations files.
type NIS2ObligationsConfig struct {
	Regulation        string                 `yaml:"regulation"`
	Name              string                 `yaml:"name"`
	Obligations       []ObligationYAML       `yaml:"obligations"`
	Controls          []ControlYAML          `yaml:"controls"`
	IncidentDeadlines []IncidentDeadlineYAML `yaml:"incident_deadlines"`
}

// ObligationYAML is the YAML structure for an obligation
type ObligationYAML struct {
	ID          string         `yaml:"id"`
	Title       string         `yaml:"title"`
	Description string         `yaml:"description"`
	AppliesWhen string         `yaml:"applies_when"`
	LegalBasis  []LegalRefYAML `yaml:"legal_basis"`
	Category    string         `yaml:"category"`
	Responsible string         `yaml:"responsible"`
	Deadline    *DeadlineYAML  `yaml:"deadline,omitempty"`
	Sanctions   *SanctionYAML  `yaml:"sanctions,omitempty"`
	Evidence    []string       `yaml:"evidence,omitempty"`
	Priority    string         `yaml:"priority"`
	ISO27001    []string       `yaml:"iso27001_mapping,omitempty"`
	HowTo       string         `yaml:"how_to_implement,omitempty"`
}

// LegalRefYAML is the YAML structure for a legal reference
type LegalRefYAML struct {
	Norm    string `yaml:"norm"`
	Article string `yaml:"article,omitempty"`
}

// DeadlineYAML is the YAML structure for a deadline
type DeadlineYAML struct {
	Type     string `yaml:"type"`
	Date     string `yaml:"date,omitempty"`
	Duration string `yaml:"duration,omitempty"`
}

// SanctionYAML is the YAML structure for sanctions info
type SanctionYAML struct {
	MaxFine           string `yaml:"max_fine,omitempty"`
	PersonalLiability bool   `yaml:"personal_liability,omitempty"`
}

// ControlYAML is the YAML structure for a control
type ControlYAML struct {
	ID          string   `yaml:"id"`
	Name        string   `yaml:"name"`
	Description string   `yaml:"description"`
	Category    string   `yaml:"category"`
	WhatToDo    string   `yaml:"what_to_do"`
	ISO27001    []string `yaml:"iso27001_mapping,omitempty"`
	Priority    string   `yaml:"priority"`
}

// IncidentDeadlineYAML is the YAML structure for an incident deadline
type IncidentDeadlineYAML struct {
	Phase      string         `yaml:"phase"`
	Deadline   string         `yaml:"deadline"`
	Content    string         `yaml:"content"`
	Recipient  string         `yaml:"recipient"`
	LegalBasis []LegalRefYAML `yaml:"legal_basis"`
}
