import { FormFields } from './NCIRCCNotificationForm/types';
import { EIncidentStatusLabel } from 'types/default';

export type TUsers = {
  value: number;
  label: string;
  first_name: string;
}[];

export type TStatusOption = {
  value: number;
  label: string;
};

export type TStatusOptionMessage = {
  notAssigned: string;
  assigned: string;
  delayed: string;
  resolve: string;
  falseAlarm: string;
};

export type TypeSmallFormItemMessage = {
  importance: string;
  title: string;
  events: string;
  assignedTo: string;
  status: string;
  deadline: string;
  groups: string;
  created: string;
  comment: string;
  assignedToError: string;
  statusOptionMessage: TStatusOptionMessage;
};

export type TEventsTableMessage = {
  created: string;
  message: string;
  product: string;
  sourceIp: string;
  destinationIp: string;
};

export type TypeRecommendationAndEffectsTableMessage = {
  name: string;
  description: string;
};

export type TypeLargeFormItemMessage = {
  main: {
    name: string;
    title: string;
    created: string;
    deadline: string;
    importance: string;
    comment: string;
    groups: string;
  };
  details: {
    name: string;
    assignedToError: string;
    assignedTo: string;
    status: string;
    statusOptionMessage: TStatusOptionMessage;
  };
  recommendation: {
    name: string;
  };
  effects: {
    name: string;
  };
  events: {
    name: string;
  };
  eventsTable: TEventsTableMessage;
  recommendationAndEffectsTable: TypeRecommendationAndEffectsTableMessage;
};

export type TFormItemMessage = {
  smallCardMessages: TypeSmallFormItemMessage;
  largeCardMessages: TypeLargeFormItemMessage;
};

export type TIncidentCardInfoMessages = {
  edit: string;
  resolve: string;
  resolved: string;
  save: string;
  formItem: TFormItemMessage;
  drawerButtonOpen: TypeDrawerCloseConfirmModal;
  notification: {
    failedPatchIncident: string;
    failedFetchCompanyInfo: string;
  };
};

export type TypeDrawerConfirmModal = {
  title: string;
  subTitle: string;
  okText: string;
  cancelText: string;
};

export type TypeFormFieldsMessages = {
  [FormFields.CATEGORY]: string;
  [FormFields.IDENTIFIER]: string;
  [FormFields.TYPE]: string;
  [FormFields.ACTIVITY_STATUS]: string;
  [FormFields.TLP]: string;
  [FormFields.AFFECTED_SYSTEM_NAME]: string;
  [FormFields.AFFECTED_SYSTEM_CATEGORY]: string;
  [FormFields.EVENT_DESCRIPTION]: string;
  [FormFields.AFFECTED_SYSTEM_CONNECTION]: string;
  [FormFields.ASSISTANCE]: string;
  [FormFields.INTEGRITY_IMPACT]: string;
  [FormFields.AVAILABILITY_IMPACT]: string;
  [FormFields.CONFIDENTIALITY_IMPACT]: string;
  [FormFields.CUSTOM_IMPACT]: string;
  [FormFields.VULNERABILITY_ID]: string;
  [FormFields.PRODUCT_CATEGORY]: string;
  [FormFields.ADDITIONAL]: string;
  [FormFields.EFFECTS]: string;
  [FormFields.NOTIFICATION_STATUS]: string;
};

export type TypeIncidentTypeOptionMessages = {
  involvementOfAControlledResource: string;
  resourceSlowdown: string;
  malwareInfection: string;
  capturingNetworkTraffic: string;
  accountCompromise: string;
  unauthorizedChangeOfInformation: string;
  unauthorizedDisclosureOfInformation: string;
  publicationOfProhibitedInformationOnTheResource: string;
  sendingSpamMessages: string;
  successfulExploitationOfAVulnerability: string;
};

export type TypeAttackTypeOptionMessages = {
  failedAuthorizationAttempts: string;
  attemptsToExploitTheVulnerability: string;
  attemptsToIntroduceMalware: string;
  publicationOfFraudulentInformation: string;
  dDoSAttack: string;
  socialEngineering: string;
  networkScanning: string;
};

export type TypeVulnerabilityTypeOptionMessages = {
  vulnerableResource: string;
};
export type TypeActivityStatusOptionsMessages = {
  actionTaken: string;
  responseActivitiesAreUnderway: string;
  responseActivitiesResumed: string;
};

export type TypeTlpStatusOptionsMessages = {
  WHITE: string;
  GREEN: string;
  AMBER: string;
  RED: string;
};

export type TypeImpactOptionMessages = {
  high: string;
  low: string;
  missing: string;
};

export type TypeOptionsNcirccNotificationMessages = {
  computerIncidentNotification: string;
  computerAttackNotification: string;
  vulnerabilityNotification: string;
};

export type TypeAffectedSystemCategoryMessages = {
  informationResourceIsNotAnObjectOfCii: string;
  ciiObjectWithoutSignificanceCategory: string;
  ciiObjectOfTheThirdCategoryOfSignificance: string;
  ciiObjectOfTheSecondCategoryOfSignificance: string;
  ciiObjectOfTheFirstCategoryOfSignificance: string;
};

export type TypeFormOptionsLabelMessages = {
  incidentTypeOptionMessages: TypeIncidentTypeOptionMessages;
  attackTypeOptionsMessages: TypeAttackTypeOptionMessages;
  vulnerabilityTypeOptionMessages: TypeVulnerabilityTypeOptionMessages;
  activityStatusOptionsMessages: TypeActivityStatusOptionsMessages;
  tlpStatusOptionsMessages: TypeTlpStatusOptionsMessages;
  impactOptionMessages: TypeImpactOptionMessages;
  optionsNcirccNotificationMessages: TypeOptionsNcirccNotificationMessages;
  affectedSystemCategoryMessages: TypeAffectedSystemCategoryMessages;
};

export type TypeDrawerCloseConfirmModal = {
  send: string;
  show: string;
  additional: string;
  correctTime: (time: string) => string;
  invalidTime: string;
  ifNoSend: string;
  createCompany: string;
};

export type TypeNCIRCCNotificationMessage = {
  title: string;
  submit: string;
  notification: {
    postNotification: {
      success: {
        title: string;
      };
      error: {
        title: string;
        subTitle: string;
      };
    };
    patchNotification: {
      success: {
        title: string;
      };
      error: {
        title: string;
        subTitle: string;
      };
    };
  };

  drawerCloseConfirmModal: TypeDrawerConfirmModal;
  formFieldsMessages: TypeFormFieldsMessages;
  formOptionsLabelMessages: TypeFormOptionsLabelMessages;
  formItemsRules: {
    [FormFields.TYPE]: string;
    [FormFields.ACTIVITY_STATUS]: string;
    [FormFields.TLP]: string;
    [FormFields.AFFECTED_SYSTEM_NAME]: string;
    [FormFields.EVENT_DESCRIPTION]: string;
    [FormFields.INTEGRITY_IMPACT]: string;
    [FormFields.AVAILABILITY_IMPACT]: string;
    [FormFields.CONFIDENTIALITY_IMPACT]: string;
  };
};

export type TypeIncidentDashboardTableMessages = {
  columns: {
    id: string;
    importance: {
      title: string;
      low: string;
      middle: string;
      high: string;
    };
    title: string;
    status: {
      title: string;
      type: {
        [EIncidentStatusLabel.Not_Assigned]: string;
        [EIncidentStatusLabel.Assigned]: string;
        [EIncidentStatusLabel.Resolved]: string;
        [EIncidentStatusLabel.False_Alarm]: string;
        [EIncidentStatusLabel.Delayed]: string;
      };
    };
    events: string;
    group: string;
    info: string;
    updated: string;
    actions: {
      title: string;
      edit: string;
      resolveIncident: string;
    };
  };
};

export type TypeIncidentDashboardMessage = {
  leftSidebar: {
    title: string;
    list: string;
  };
  table: TypeIncidentDashboardTableMessages;
  incidentsCardInfo: TIncidentCardInfoMessages;
  ncircc: TypeNCIRCCNotificationMessage;
};

export enum DefaultFields {
  MAIN = 'main',
  DETAILS = 'details',
  RECOMMENDATION = 'recommendation',
  EFFECTS = 'effects',
  EVENTS = 'events',
}

export type TUseCardInfoEventsTableColumns = {
  title: string;
  dataIndex: string;
  checked: boolean;
  key: string;
  disabled?: boolean;
};
