export type DashboardWidgetSize = 'S' | 'M' | 'L';

export type RuntimeDashboardLayout = {
  order: string[];
  visibility: Record<string, boolean>;
  size: Record<string, DashboardWidgetSize>;
};

export type RuntimeRoleConfig = {
  roleKey: string;
  displayName: string;
  vertical: 'jobs' | 'marketplace';
  onboardingSchemaId: string;
  enabledModules: string[];
  requiresOnboardingApproval: boolean;
};

export type RuntimeDashboardConfig = {
  roleKey: string;
  sidebar: Array<{ key: string; label: string; route: string }>;
  widgets: Array<{ key: string; title: string; enabled: boolean }>;
  dashboard_layout?: RuntimeDashboardLayout;
};

export type RuntimeOnboardingFieldOption = {
  label: string;
  value: string;
};

export type RuntimeOnboardingValidation = {
  minLength?: number;
  maxLength?: number;
  min?: number;
  max?: number;
  pattern?: string;
};

export type RuntimeOnboardingField = {
  id: string;
  label: string;
  type: 'text' | 'textarea' | 'number' | 'email' | 'tel' | 'date' | 'select' | 'url' | 'file' | 'checkbox';
  required?: boolean;
  placeholder?: string;
  helperText?: string;
  defaultValue?: string | number | boolean | string[];
  readOnly?: boolean;
  multiple?: boolean;
  options?: RuntimeOnboardingFieldOption[];
  accept?: string;
  maxFiles?: number;
  maxSizeMB?: number;
  validation?: RuntimeOnboardingValidation;
};

export type RuntimeOnboardingStep = {
  id: string;
  title: string;
  description?: string;
  fields: RuntimeOnboardingField[];
};

export type RuntimeOnboardingConfig = {
  schemaId: string;
  roleKey: string;
  version: number;
  steps: RuntimeOnboardingStep[];
};

export type RuntimeKBArticle = {
  id: string;
  title: string;
  category: string;
  content: string;
  author: string;
  isPublished: boolean;
  viewCount: number;
  lastUpdated: string;
};

export type RuntimeKBConfig = {
  articles: RuntimeKBArticle[];
};
