import { GarantiaLite } from 'src/models';
import { ControlCategory } from '../hipotecaWidgets/types';

export const DEFAULT_GARANTIA: GarantiaLite = {
  tipo: '',
  monto: 0,
  detalle: {},
};

export enum TipoGarantia {
  INMUEBLE = 'Propiedad inmobiliaria',
  VEHICULO = 'Vehículo',
  AVAL_PERSONAL = 'Aval personal',
  OTROS = 'Otros',
}

export const TIPOS_GARANTIAS: ControlCategory[] = [
  {
    value: TipoGarantia.INMUEBLE,
    detail: [
      {
        input: 'select',
        options: ['Sí', 'No'],
        label: 'Está hipotecada',
        key: 'hipotecada',
      },
      {
        input: 'input',
        label: 'Importe pendiente a pagar de la hipoteca',
        key: 'importe_hipoteca',
        input_props: {
          currency: true,
        },
        conditions: [
          {
            key: 'hipotecada',
            value: 'Sí',
            operator: '==',
          },
        ],
      },
    ],
  },
  {
    value: TipoGarantia.VEHICULO,
  },
  {
    value: TipoGarantia.AVAL_PERSONAL,
    detail: [
      {
        input: 'input',
        label: 'Nombre del aval',
        key: 'nombre',
      },
      {
        input: 'input',
        label: 'Apellido del aval',
        key: 'apellido',
      },
      {
        input: 'input',
        label: 'DNI del aval',
        key: 'identificacion',
      },
    ],
  },
  {
    value: TipoGarantia.OTROS,
    detail: [
      {
        input: 'input',
        label: 'Especificar',
        key: 'detalle',
      },
    ],
  },
];
