export type SelectableFieldTypes = 'SHORT_TEXT' | 'NUMBER' | 'BOOLEAN' | 'DATE';

export type ValidationRule = 'required' | 'charactersLimit';

export interface FieldProperties {
  type: SelectableFieldTypes;
  name: string;
  isPii: boolean;
  helpText: string;
}

export interface FieldRules {
  validationRules: Partial<Record<ValidationRule, unknown>>;
}

// `type` is optional here because it starts undefined until the user picks one,
// while all other fields are always present. Keeping `type` required on FieldProperties
// preserves the stricter type everywhere else.
export type FieldPropertiesState = Omit<FieldProperties, 'type'> & {
  type?: FieldProperties['type'];
};
