import { DateField } from '@dvn/core/doldurma/src/fields/date';
import { TextField } from '@dvn/core/doldurma/src/fields/text';
import { Comparison } from '@dvn/core/models/filter';
import { TableListViewConfig } from '@dvn/core/models/table-list-view-config';
import { AppViewType } from '@dvn/core/models/view-config';
import { spaces } from '../spaces';
import { dataConfigs } from '../data-configs';
import { tableListViewUIConfigScheduledJobsNextDaySummary } from './table-list-view-scheduled-job-next-day-summary';
export const ID = 'table-list-view-scheduled-job-daily-summary';
export const viewConfig = TableListViewConfig.decode({
  _id: ID,
  type: AppViewType.ListViewTable,
  base: 'mentornity',
  title: 'Daily Events Summary Jobs',
  space: spaces['mentornity'],
  table: dataConfigs['scheduledjobs'],
  query: {
    fields: [
      new TextField('name', 'Name'),
      new TextField('status', 'Status'),
      new DateField('scheduledAt', 'Created At'),
      new DateField('createdAt', 'Created At'),
    ],
    filter: {
      filters: [
        {
          comparison: Comparison.Eq,
          id: 'name',
          value: 'NotificationDailyEventSummary',
        },
      ],
      operator: 'or'
    },
    sort: [{ id: 'createdAt', order: -1 }]
  },
  ui: tableListViewUIConfigScheduledJobsNextDaySummary,
});
