///|
pub enum WarningSeverity {
  Info
  Warning
  Critical
} derive(Debug, Eq)

///|
pub enum ResultStatus {
  Normal
  Flagged
  Estimated
} derive(Debug, Eq)

///|
pub enum SectionKind {
  Context
  Method
  Safety
  Notes
} derive(Debug, Eq)

///|
pub enum SourceKind {
  Standard
  Datasheet
  Literature
  Internal
} derive(Debug, Eq)

///|
pub struct ReportMetadata {
  report_id : String
  title : String
  process_unit : String
  scenario : String
  generated_at : String
  tool_version : String
} derive(Debug, Eq)

///|
pub struct Assumption {
  statement : String
  impact : String
} derive(Debug, Eq)

///|
pub struct InputValue {
  name : String
  value : String
  unit : String?
  note : String?
} derive(Debug, Eq)

///|
pub struct FormulaNote {
  name : String
  expression : String
  explanation : String
} derive(Debug, Eq)

///|
pub struct ResultValue {
  name : String
  value : String
  unit : String?
  status : ResultStatus
  note : String?
} derive(Debug, Eq)

///|
pub struct WarningNote {
  code : String
  severity : WarningSeverity
  summary : String
  action : String
} derive(Debug, Eq)

///|
pub struct SourceRef {
  label : String
  kind : SourceKind
  url : String?
  license : String?
  note : String?
} derive(Debug, Eq)

///|
pub struct ReportSection {
  title : String
  kind : SectionKind
  body : String
} derive(Debug, Eq)

///|
pub struct ValidationIssue {
  path : String
  message : String
} derive(Debug, Eq)

///|
pub struct ExportBundle {
  markdown : String
  html : String
  json : String
} derive(Debug, Eq)

///|
pub struct ChemReport {
  metadata : ReportMetadata
  summary : String
  assumptions : Array[Assumption]
  inputs : Array[InputValue]
  formulas : Array[FormulaNote]
  results : Array[ResultValue]
  warnings : Array[WarningNote]
  sources : Array[SourceRef]
  sections : Array[ReportSection]
  tags : Array[String]
} derive(Debug, Eq)

///|
pub fn report(
  metadata : ReportMetadata,
  summary : String,
  assumptions : Array[Assumption],
  inputs : Array[InputValue],
  formulas : Array[FormulaNote],
  results : Array[ResultValue],
  warnings : Array[WarningNote],
  sources : Array[SourceRef],
  sections : Array[ReportSection],
  tags : Array[String],
) -> ChemReport {
  {
    metadata,
    summary,
    assumptions,
    inputs,
    formulas,
    results,
    warnings,
    sources,
    sections,
    tags,
  }
}