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

export class AnalyticalUnitsFilter extends GlobalSearchFilter {
  _filter: {
    search: StringTypeFilter;
    dateFrom: DateTypeFilter;
    dateTo: DateTypeFilter;
  } = {
    search: {
      type: FILTER_TYPE.string,
      value: '',
    },
    dateFrom: {
      type: FILTER_TYPE.date,
      value: null,
    },
    dateTo: {
      type: FILTER_TYPE.date,
      value: null,
    },
  };


  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;
  }
}
