import { DataTransferField } from '@dvn/core/doldurma/src/fields/query-include/data-transfer-field';
import { FormViewConfig } from '@dvn/core/models/form-view-config';
import { AppViewType } from '@dvn/core/models/view-config';
import { dataConfigs } from '../../../../../mentornity-console/src/configs/data-configs';
import { FormHandlerDeleteDomain } from '../../handlers/form-handler-delete-domain';
import { damgaSpace } from '../data-configs';
export const ID = 'form-view-domain-delete';
export const config = (apiDamga) => FormViewConfig.decode({
  _id: ID,
  base: 'devingen-dev',
  title: 'Are you sure to delete the domain?',
  space: damgaSpace,
  table: dataConfigs['damga-domains'],
  type: AppViewType.FormView,
  handler: new FormHandlerDeleteDomain(apiDamga, ID),
  ui: {
    fields: [
      // this field is passed by the parameters. this is a data holder field to pass the data to form handler
      {
        field: new DataTransferField('domainId'),
      },
    ],
    i18n: {
      submit: 'Delete Domain',
    }
  },
  params: {
    domainId: {
      required: true,
    },
    domain: {
      required: true,
    },
    target: {
      required: true,
    },
    overrideHost: {
      required: true,
    },
    useTLS: {
      required: true,
    },
  },
});
