import type {
  QuestionType,
  LogicConditionType,
  LogicAction,
  WelcomeScreenConfig,
  ThankYouScreenConfig,
  QuestionOptionsConfig,
  QuestionValidationConfig,
} from "@/types";

export interface FillerLogicRule {
  id: string;
  conditionType: LogicConditionType;
  conditionValue: string | null;
  action: LogicAction;
  targetQuestionId: string | null;
}

export interface FillerQuestion {
  id: string;
  type: QuestionType;
  title: string;
  position: number;
  isRequired: boolean;
  optionsConfig: QuestionOptionsConfig | null;
  validationConfig: QuestionValidationConfig | null;
  randomizeOptions: boolean;
  logicRules: FillerLogicRule[];
}

export interface FillerSurveyData {
  collectorId: string;
  surveyId: string;
  slug: string;
  title: string;
  welcomeScreenConfig: WelcomeScreenConfig | null;
  thankYouScreenConfig: ThankYouScreenConfig | null;
  redirectUrl: string | null;
  displayConfig: import("@/lib/utils/survey-display").SurveyDisplayConfig;
  questions: FillerQuestion[];
}

export type FillerAnswerValue =
  | string
  | number
  | string[]
  | Record<string, string>
  | null;

export type FillerAnswers = Record<string, FillerAnswerValue>;

export interface CollectorRow {
  id: string;
  type: string;
  slug: string;
  isActive: boolean;
  config: Record<string, unknown> | null;
  createdAt: Date;
}
