import { ComplianceStatus, EmployeeDataCategory, FormElementType, ProcessingPurpose } from '~/.api-client'

export const complianceMap = new Map<ProcessingPurpose, Map<EmployeeDataCategory, ComplianceStatus>>([
  [
    ProcessingPurpose.SystemOperation,
    new Map([
      [EmployeeDataCategory.None, ComplianceStatus.NonCritical],
      [EmployeeDataCategory.NonCritical, ComplianceStatus.NonCritical],
      [EmployeeDataCategory.ReviewRequired, ComplianceStatus.NonCritical],
      [EmployeeDataCategory.Sensitive, ComplianceStatus.NonCritical]
    ])
  ],
  [
    ProcessingPurpose.BusinessProcess,
    new Map([
      [EmployeeDataCategory.None, ComplianceStatus.NonCritical],
      [EmployeeDataCategory.NonCritical, ComplianceStatus.NonCritical],
      [EmployeeDataCategory.ReviewRequired, ComplianceStatus.Warning],
      [EmployeeDataCategory.Sensitive, ComplianceStatus.Critical]
    ])
  ],
  [
    ProcessingPurpose.DataAnalysis,
    new Map([
      [EmployeeDataCategory.None, ComplianceStatus.NonCritical],
      [EmployeeDataCategory.NonCritical, ComplianceStatus.Warning],
      [EmployeeDataCategory.ReviewRequired, ComplianceStatus.Warning],
      [EmployeeDataCategory.Sensitive, ComplianceStatus.Critical]
    ])
  ],
  [
    ProcessingPurpose.None,
    new Map([
      [EmployeeDataCategory.None, ComplianceStatus.NonCritical],
      [EmployeeDataCategory.NonCritical, ComplianceStatus.NonCritical],
      [EmployeeDataCategory.ReviewRequired, ComplianceStatus.NonCritical],
      [EmployeeDataCategory.Sensitive, ComplianceStatus.NonCritical]
    ])
  ]
])

export const complianceCheckableElementTypes: FormElementType[] = [
  FormElementType.Switch,
  FormElementType.Select,
  FormElementType.Checkbox,
  FormElementType.Radiobutton
]
