/* eslint-disable */
/**
 * This file was automatically generated by json-schema-to-typescript.
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
 * and run json-schema-to-typescript to regenerate this file.
 */

export type DynamicFormFieldSchema =
  | ShortTextField
  | LongTextField
  | NumberField
  | EmailField
  | DropdownField
  | ChoiceField
  | ChoicesField
  | YesNoField;
export type ShortTextField = FieldBaseType &
  TextFieldCommon & {
    type: "short_text";
    [k: string]: unknown;
  };
export type LongTextField = FieldBaseType &
  TextFieldCommon & {
    type: "long_text";
    [k: string]: unknown;
  };
export type NumberField = FieldBaseType &
  TextFieldCommon & {
    type: "number";
    [k: string]: unknown;
  };
export type EmailField = FieldBaseType &
  TextFieldCommon & {
    type: "email";
    [k: string]: unknown;
  };
export type DropdownField = FieldBaseType &
  TextFieldCommon &
  OptionFieldCommon & {
    type: "dropdown";
    [k: string]: unknown;
  };
export type ChoiceField = FieldBaseType &
  OptionFieldCommon &
  OrientationFieldCommon & {
    type: "choice";
    [k: string]: unknown;
  };
export type ChoicesField = FieldBaseType &
  OptionFieldCommon &
  OrientationFieldCommon & {
    type: "choices";
    [k: string]: unknown;
  };
export type YesNoField = FieldBaseType & {
  type: "yes_no";
  [k: string]: unknown;
};

/**
 * JSON 스키마 for DynamicForm 컴포넌트
 */
export interface DynamicFormSchema {
  /**
   * 폼 필드 정의 배열
   */
  fields: DynamicFormFieldSchema[];
  [k: string]: unknown;
}
export interface FieldBaseType {
  name: string;
  type: string;
  label: string;
  description?: string;
  required?: boolean;
  validation?: ValidationRule;
  [k: string]: unknown;
}
export interface ValidationRule {
  min?: number;
  max?: number;
  pattern?: string;
  message?: string;
  oneOf?: unknown[];
  [k: string]: unknown;
}
export interface TextFieldCommon {
  placeholder?: string;
  [k: string]: unknown;
}
export interface OptionFieldCommon {
  options: FieldOption[];
  [k: string]: unknown;
}
export interface FieldOption {
  label: string;
  value: string | number;
  [k: string]: unknown;
}
export interface OrientationFieldCommon {
  orientation?: "horizontal" | "vertical";
  [k: string]: unknown;
}
