import { AssignmentValidationSettingsApi } from "omsorgcore-client-ts";
import { configFor, callApi } from "./apiClientHelpers";

// Kapselt /api/settings/assignment-validation (FR-EM-3: Warning/Error je Konfliktprüfung bei
// der Mitarbeiterzuweisung, siehe omsorgCore/CLAUDE.md "Prüf-Logik in AssignmentService").
export function getAssignmentValidationSettings(accessToken) {
  const api = new AssignmentValidationSettingsApi(configFor(accessToken));
  return callApi(api.apiSettingsAssignmentValidationGetRaw());
}

export function updateAssignmentValidationSettings(accessToken, payload) {
  const api = new AssignmentValidationSettingsApi(configFor(accessToken));
  return callApi(api.apiSettingsAssignmentValidationPutRaw({ updateAssignmentValidationSettingsRequest: payload }));
}
