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

export class SuccessImportSearchFilter extends GlobalSearchFilter {
  _filter: {
    search: StringTypeFilter;
    source: StringTypeFilter;
    result: StringTypeFilter;
    initiator: StringTypeFilter;
    fileName: StringTypeFilter;
    nameVK: StringTypeFilter;
    dateFrom: DateTypeFilter;
    dateTo: DateTypeFilter;
  } = {
    search: {
      type: FILTER_TYPE.string,
      value: '',
    },
    source: {
      type: FILTER_TYPE.string,
      value: '',
    },
    result: {
      type: FILTER_TYPE.string,
      value: '',
    },
    initiator: {
      type: FILTER_TYPE.string,
      value: '',
    },
    fileName: {
      type: FILTER_TYPE.string,
      value: '',
    },
    nameVK: {
      type: FILTER_TYPE.string,
      value: '',
    },
    dateFrom: {
      type: FILTER_TYPE.date,
      value: null,
    },
    dateTo: {
      type: FILTER_TYPE.date,
      value: null,
    },
  };

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

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

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

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

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

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

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

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

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

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

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

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

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

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