import {
  FILTER_TYPE,
  GlobalSearchFilter,
  StringTypeFilter,
  DateTypeFilter,
} from '@/recruits/utils/global-search-filter';

export class JournalSmevSearchFilter extends GlobalSearchFilter {
  _filter: {
    search: StringTypeFilter;
    lastName: StringTypeFilter;
    firstName: StringTypeFilter;
    middleName: StringTypeFilter;
    externalSystem: StringTypeFilter;
    mzDirection: StringTypeFilter;
    mzName: StringTypeFilter;
    snils: StringTypeFilter;
    createDateFrom: DateTypeFilter;
    createDateTo: DateTypeFilter;
  } = {
    search: {
      type: FILTER_TYPE.string,
      value: '',
    },
    lastName: {
      type: FILTER_TYPE.string,
      value: '',
    },
    firstName: {
      type: FILTER_TYPE.string,
      value: '',
    },
    middleName: {
      type: FILTER_TYPE.string,
      value: '',
    },
    externalSystem: {
      type: FILTER_TYPE.string,
      value: '',
    },
    mzDirection: {
      type: FILTER_TYPE.string,
      value: '',
    },
    mzName: {
      type: FILTER_TYPE.string,
      value: '',
    },
    snils: {
      type: FILTER_TYPE.string,
      value: '',
    },
    createDateFrom: {
      type: FILTER_TYPE.date,
      value: null,
    },
    createDateTo: {
      type: FILTER_TYPE.date,
      value: null,
    },
  };

  get lastName(): StringTypeFilter['value'] {
    return this._filter.lastName.value;
  }

  set lastName(value: StringTypeFilter['value']) {
    this._filter.lastName.value = value;
  }

  get firstName(): StringTypeFilter['value'] {
    return this._filter.firstName.value;
  }

  set firstName(value: StringTypeFilter['value']) {
    this._filter.firstName.value = value;
  }

  get middleName(): StringTypeFilter['value'] {
    return this._filter.middleName.value;
  }

  set middleName(value: StringTypeFilter['value']) {
    this._filter.middleName.value = value;
  }

  get externalSystem(): StringTypeFilter['value'] {
    return this._filter.externalSystem.value;
  }

  set externalSystem(value: StringTypeFilter['value']) {
    this._filter.externalSystem.value = value;
  }

  get mzDirection(): StringTypeFilter['value'] {
    return this._filter.mzDirection.value;
  }

  set mzDirection(value: StringTypeFilter['value']) {
    this._filter.mzDirection.value = value;
  }

  get mzName(): StringTypeFilter['value'] {
    return this._filter.mzName.value;
  }

  set mzName(value: StringTypeFilter['value']) {
    this._filter.mzName.value = value;
  }

  get snils(): StringTypeFilter['value'] {
    return this._filter.snils.value;
  }

  set snils(value: StringTypeFilter['value']) {
    this._filter.snils.value = value;
  }

  get createDateFrom(): DateTypeFilter['value'] {
    return this._filter.createDateFrom.value;
  }

  set createDateFrom(value: DateTypeFilter['value']) {
    this._filter.createDateFrom.value = value;
  }

  get createDateTo(): DateTypeFilter['value'] {
    return this._filter.createDateTo.value;
  }

  set createDateTo(value: DateTypeFilter['value']) {
    this._filter.createDateTo.value = value;
  }
}
