import {
  ReturnProcessQuestion,
  ReturnProcessQuestionKey,
  ReturnProcessQuestionType,
} from '../models';
import { ItemConditionAnswer, ReturnReasonAnswer } from './constants';

/**
 * Questions for the return process of other electronic devices.
 *
 * This array defines the sequence and branching logic of questions presented to users
 * when processing electronic device returns. The question flow adapts dynamically
 * based on the customer's responses to guide them through the appropriate return path.
 *
 * The question sequence typically includes:
 * 1. Item condition assessment (original packaging or opened/damaged)
 * 2. Return reason inquiry for items in original packaging
 * 3. Defect verification for opened/damaged items
 * 4. Collection of information about incorrectly delivered items when applicable
 */
export const elektronischeGeraeteQuestions: ReturnProcessQuestion[] = [
  {
    key: ReturnProcessQuestionKey.ItemCondition,
    description: 'Wie ist der Artikelzustand?',
    type: ReturnProcessQuestionType.Select,
    options: [
      {
        label: 'Originalverpackt',
        value: ItemConditionAnswer.OVP,
        nextQuestion: ReturnProcessQuestionKey.ReturnReason,
        returnInfo: { itemCondition: 'Originalverpackt' },
      },
      {
        label: 'Geöffnet/Defekt',
        value: ItemConditionAnswer.Damaged,
        returnInfo: { itemCondition: 'Geöffnet/Defekt' },
      },
    ],
  },
  {
    key: ReturnProcessQuestionKey.ReturnReason,
    description: 'Warum möchtest du den Artikel zurückgeben?',
    type: ReturnProcessQuestionType.Select,
    options: [
      {
        label: 'Gefällt nicht/Widerruf',
        value: ReturnReasonAnswer.Dislike,
        returnInfo: { returnReason: 'Gefällt nicht/Widerruf' },
      },
      {
        label: 'Fehllieferung',
        value: ReturnReasonAnswer.WrongItem,
        nextQuestion: ReturnProcessQuestionKey.DeliveredItem,
        returnInfo: { returnReason: 'Fehllieferung' },
      },
    ],
  },
  {
    key: ReturnProcessQuestionKey.DeliveredItem,
    description: 'Welcher Artikel wurde geliefert?',
    type: ReturnProcessQuestionType.Product,
  },
];
