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

export class LogImportSearchFilter extends GlobalSearchFilter {
  _filter: {
    search: StringTypeFilter;
    initiator: StringTypeFilter;
    nameVK: StringTypeFilter;
    fileName: StringTypeFilter;
    source: StringTypeFilter;
    status: StringTypeFilter;
    dateStartFrom: DateTypeFilter;
    dateStartTo: DateTypeFilter;
    dateEndFrom: DateTypeFilter;
    dateEndTo: DateTypeFilter;
  } = {
    search: {
      type: FILTER_TYPE.string,
      value: '',
    },
    initiator: {
      type: FILTER_TYPE.string,
      value: '',
    },
    nameVK: {
      type: FILTER_TYPE.string,
      value: '',
    },
    fileName: {
      type: FILTER_TYPE.string,
      value: '',
    },
    source: {
      type: FILTER_TYPE.string,
      value: '',
    },
    status: {
      type: FILTER_TYPE.string,
      value: '',
    },
    dateStartFrom: {
      type: FILTER_TYPE.date,
      value: null,
    },
    dateStartTo: {
      type: FILTER_TYPE.date,
      value: null,
    },
    dateEndFrom: {
      type: FILTER_TYPE.date,
      value: null,
    },
    dateEndTo: {
      type: FILTER_TYPE.date,
      value: null,
    },
  };

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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