export enum SurveyQuestionType {
  COMMENT = 'COMMENT',
  SINGLE_SELECTION = 'SINGLE_SELECTION',
  RATING = 'RATING',
}

export enum SurveyStatus {
  ENABLED = 'ENABLED',
  DISABLED = 'DISABLED',
}

export type CommentQuestion = {
  id: string;
  title: string;
  type: SurveyQuestionType.COMMENT;
  required: boolean;
  value?: string;
};

export type RatingQuestion = {
  id: string;
  title: string;
  type: SurveyQuestionType.RATING;
  required: boolean;
  minChoice: number;
  maxChoice: number;
  value?: string;
};

export type SingleSelectionQuestion = {
  id: string;
  title: string;
  type: SurveyQuestionType.SINGLE_SELECTION;
  required: boolean;
  choices: string[];
  value?: string;
};

export type SurveyQuestion =
  | CommentQuestion
  | RatingQuestion
  | SingleSelectionQuestion;

export type CsatSurveyTemplate = {
  id: string;
  createdAt: string;
  status: SurveyStatus;
  csatQuestions: SurveyQuestion[];
};

export type CsatSurveyResponseBody = {
  taskId: string;
  catalogItemId: string;
  csatTemplateKey: string;
  csatQuestionAnswers: CsatQuestionResponse[];
};

export type CsatQuestionResponse = {
  csatQuestionId: string;
  value: string;
  csatQuestionType: SurveyQuestionType;
};
