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

/**
 * Questions for the return process of Spielwaren/Puzzle and other nonbook items.
 *
 * This array defines the sequence and logic flow of questions presented to users
 * when processing returns for toys, puzzles, and other nonbook items. The questions
 * follow a branching structure that adapts based on the customer's responses.
 *
 * The question flow generally starts with item condition assessment, followed by
 * return reason inquiry, and may include additional questions about the delivered
 * item when applicable.
 */
export const nonbookQuestions: ReturnProcessQuestion[] = [
  {
    key: ReturnProcessQuestionKey.ItemCondition,
    description: 'Wie ist der Artikelzustand?',
    type: ReturnProcessQuestionType.Select,
    options: [
      {
        label: 'Neuwertig/Originalverpackt',
        value: ItemConditionAnswer.OVP,
        nextQuestion: ReturnProcessQuestionKey.ReturnReason,
        returnInfo: { itemCondition: 'Neuwertig/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,
  },
];
