import { DateField } from '@dvn/core/doldurma/src/fields/date';
import { DetailViewConfig } from '@dvn/core/models/detail-view-config';
import { AppViewType } from '@dvn/core/models/view-config';
import { dataConfigs } from '../data-configs';
import { spaces } from '../spaces';
export const ID = 'detail-view-scheduled-job-send-email';
export const viewConfig = DetailViewConfig.decode({
  _id: ID,
  base: 'mentornity',
  space: spaces['mentornity'],
  table: dataConfigs['scheduledjobs'],
  title: 'Send Email Job',
  ui: {
    cardConfig: {
      body: {
        fields: [
          {
            fieldId: 'name',
          },
          {
            fieldId: 'createdAt',
          },
          {
            fieldId: 'status',
          },
          {
            fieldDisplay: new DateField('metadata.sent', 'Sent On').setDateFormat('DD MMM YYYY, HH:mm'),
          },
          {
            fieldDisplay: new DateField('metadata.delivered', 'Delivered On').setDateFormat('DD MMM YYYY, HH:mm'),
          },
          {
            fieldDisplay: new DateField('metadata.opened', 'Opened On').setDateFormat('DD MMM YYYY, HH:mm'),
          },
          {
            fieldDisplay: new DateField('metadata.clicked', 'Clicked On').setDateFormat('DD MMM YYYY, HH:mm'),
          },
          {
            fieldId: 'output',
          },
          {
            fieldId: 'parameters',
          },
        ]
      },
    }
  },
  type: AppViewType.DetailView,
  params: {
    itemId: {
      required: true,
    },
  },
});
