// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
/**
 * Функция подготовки данных для отправки на бэк в разрезе
 * запросов типа "search", используемых в разделах
 * @param ob
 */
export function prepareApiParams(ob: Record<string, any>) {
  return {
    pagination: {
      sortBy: ob.sortby,
      descending: ob.descending,
      page: Number(ob.page),
      rowsPerPage: Number(ob.perpage),
    },
    search: {
      search: ob.search,
      lastName: ob.lastName,
      firstName: ob.firstName,
      middleName: ob.middleName,
      birthDateFrom: ob.birthDateFrom,
      birthDateTo: ob.birthDateTo,
      inn: ob.inn ? Number(ob.inn) : undefined,
      snils: ob.snils,
      idERN: ob.idERN,
      documentType: ob.documentType,
      documentSeries: ob.documentSeries,
      documentNumber: ob.documentNumber,
      statuses: ob.statuses,
      causes: ob.causes,
      dateStartFrom: ob.dateStartFrom,
      dateStartTo: ob.dateStartTo,
      dateEndFrom: ob.dateEndFrom,
      dateEndTo: ob.dateEndTo,
      source: ob.source,
      status: ob.status,
      fullName: ob.fullName,
      nameVK: ob.nameVK,
      fileName: ob.fileName,
      result: ob.result,
      initiator: ob.initiator,
      genders: ob.genders,
      reason: ob.reason,
      createDateFrom: ob.createDateFrom,
      createDateTo: ob.createDateTo,
      listNumber: ob.listNumber,
      summonObjective: ob.summonObjective,
      summonsDateFrom: ob.summonsDateFrom,
      summonsDateTo: ob.summonsDateTo,
      formationDateFrom: ob.formationDateFrom,
      requester: ob.requester,
      requestDateTo: ob.requestDateTo,
      requestDateFrom: ob.requestDateFrom,
      formationDateTo: ob.formationDateTo,
      registrationReasons: ob.registrationReasons,
      militaryRegistrationDateFrom: ob.militaryRegistrationDateFrom,
      militaryRegistrationDateTo: ob.militaryRegistrationDateTo,
      series: ob.series,
      number: ob.number,
      sendingDateFrom: ob.sendingDateFrom,
      sendingDateTo: ob.sendingDateTo,
      turnoutDateFrom: ob.turnoutDateFrom,
      turnoutDateTo: ob.turnoutDateTo,
      resolveDateFrom: ob.resolveDateFrom,
      resolveDateTo: ob.resolveDateTo,
      registeredDateFrom: ob.registeredDateFrom,
      registeredDateTo: ob.registeredDateTo,
      incidentProvider: ob.incidentProvider,
      sourceCode: ob.sourceCode,
      sendDateFrom: ob.sendDateFrom,
      sendDateTo: ob.sendDateTo,
      receiveDateFrom: ob.receiveDateFrom,
      receiveDateTo: ob.receiveDateTo,
      type: ob.type,
      conscriptionExemptAbsent: ob.conscriptionExemptAbsent,
      medExemptAbsent: ob.medExemptAbsent,

    },
  };
}
