import {
  Anstallningsform,
  EducationLength,
  EducationLevel,
  Omfattning,
  StillUnemployedReason,
} from '@msfa-models/slutredovisning.model';

export interface SlutredovisningRequestMainOccupationWorkDetails {
  yrkesomrade: string;
  yrkesgrupp: string;
  anstallningsform: Anstallningsform;
  otherExplanation: string;
  omfattning: Omfattning;
  omfattningPercent: number;
}

export interface SlutredovisningRequestMainOccupationWork {
  type: 'arbete';
  work: SlutredovisningRequestMainOccupationWorkDetails[];
}

export interface SlutredovisningRequestMainOccupationEducationDetails {
  educationLevel: EducationLevel;
  otherExplanation: string;
  educationLength: EducationLength;
  educationSpecification: string;
}

export type SlutredovisningRequestMainOccupationType =
  | 'arbete'
  | 'utbildning'
  | 'annat'
  | 'fortsatt arbetssökande'
  | 'byte till ny leverantör i rusta och matcha';

interface SlutredovisningRequestMainOccupationEducationBase {
  type: SlutredovisningRequestMainOccupationType;
}

export interface SlutredovisningRequestMainOccupationEducation
  extends SlutredovisningRequestMainOccupationEducationBase {
  type: 'utbildning';
  education: SlutredovisningRequestMainOccupationEducationDetails;
}

export interface SlutredovisningRequestMainOccupationOtherDetails {
  otherExplanation: string;
}

export interface SlutredovisningRequestMainOccupationOther extends SlutredovisningRequestMainOccupationEducationBase {
  other: SlutredovisningRequestMainOccupationOtherDetails;
}

export interface SlutredovisningRequestMainOccupationStillUnemployedDetails {
  reasonsGoalNotReached: StillUnemployedReason[];
  otherExplanation: string;
}

export interface SlutredovisningRequestMainOccupationStillUnemployed
  extends SlutredovisningRequestMainOccupationEducationBase {
  stillUnemployed: SlutredovisningRequestMainOccupationStillUnemployedDetails;
}
export type SlutredovisningRequestMainOccupationChangeVendor = SlutredovisningRequestMainOccupationEducationBase;

export type SlutredovisningRequestMainOccupationDetails =
  | SlutredovisningRequestMainOccupationWork
  | SlutredovisningRequestMainOccupationEducation
  | SlutredovisningRequestMainOccupationOther
  | SlutredovisningRequestMainOccupationStillUnemployed
  | SlutredovisningRequestMainOccupationChangeVendor;

export interface SlutredovisningRequest {
  genomforandereferens: number;
  mainOccupation: SlutredovisningRequestMainOccupationDetails;
  activities: { id: string; whatHasBeenDone: string }[];
  progressDescription: string;
  nextStepDescription: string;
  otherInformation: string;
}
