import type {
  ChatStyleLanguageMode,
  ChatStyleManualLanguage,
} from "@shared/types.js";

export type EffectiveDefault<T> = {
  effective: T;
  default: T;
};

export type ModelValues = EffectiveDefault<string> & {
  scorer: string;
  tailoring: string;
  projectSelection: string;
  llmProvider: string;
  llmBaseUrl: string;
  llmApiKeyHint: string | null;
};

export type WebhookValues = EffectiveDefault<string>;
export type DisplayValues = {
  showSponsorInfo: EffectiveDefault<boolean>;
  renderMarkdownInJobDescriptions: EffectiveDefault<boolean>;
};
export type ChatValues = {
  tone: EffectiveDefault<string>;
  formality: EffectiveDefault<string>;
  constraints: EffectiveDefault<string>;
  doNotUse: EffectiveDefault<string>;
  languageMode: EffectiveDefault<ChatStyleLanguageMode>;
  manualLanguage: EffectiveDefault<ChatStyleManualLanguage>;
};

export type EnvSettingsValues = {
  readable: {
    ukvisajobsEmail: string;
    adzunaAppId: string;
    basicAuthUser: string;
  };
  private: {
    ukvisajobsPasswordHint: string | null;
    adzunaAppKeyHint: string | null;
    basicAuthPasswordHint: string | null;
    webhookSecretHint: string | null;
  };
  basicAuthActive: boolean;
};

export type BackupValues = {
  backupEnabled: EffectiveDefault<boolean>;
  backupHour: EffectiveDefault<number>;
  backupMaxCount: EffectiveDefault<number>;
};

export type ScoringValues = {
  penalizeMissingSalary: EffectiveDefault<boolean>;
  missingSalaryPenalty: EffectiveDefault<number>;
  autoSkipScoreThreshold: EffectiveDefault<number | null>;
  blockedCompanyKeywords: EffectiveDefault<string[]>;
  blockedCountries: EffectiveDefault<string[]>;
  scoringInstructions: EffectiveDefault<string>;
};

export type JobSourcesValues = {
  ashbyCompanies: EffectiveDefault<string[]>;
  greenhouseCompanies: EffectiveDefault<string[]>;
  leverCompanies: EffectiveDefault<string[]>;
  smartrecruitersCompanies: EffectiveDefault<string[]>;
  teamtailorCompanies: EffectiveDefault<string[]>;
  huntflowTenants: EffectiveDefault<string[]>;
  factorialTenants: EffectiveDefault<string[]>;
  workdayTenants: EffectiveDefault<string[]>;
  careersPageUrls: EffectiveDefault<string[]>;
  icimsTenants: EffectiveDefault<string[]>;
  elutaRssLocations: EffectiveDefault<string[]>;
};
