import convertEltResult from './convertEltResult';

export const resultCompany = {
  requestId: '1364968',
  skCalcId: '66758382',
  product: '',
  program: '',
  productId: '',
  programId: '1',
  comment: null,
  message: 'Комментарий альфы',
  error: '',
  errorType: null,
  premiumSum: 0,
  kaskoSum: 0,
  doSum: 0,
  goSum: 0,
  nsSum: 0,
  gapSum: 0,
  paymentPeriods: [
    {
      num: 1,
      PremiumSum: 55555,
      KASKOSum: 1111,
      GOSum: 4444,
      NSSum: 8888,
    },
  ],
  kbmOsago: null,
  totalFranchise: 0,
  totalFranchiseSpecified: false,
  insuranceCompanyFranchise: null,
  insuranceCompanyGo: null,
  policyNumber: null,
  programCode: null,
  calcInfo: null,
  options: null,
  unicusGUID: null,
};

const entityCompany = {
  accountid: '0df9ccfb-1407-eb11-af50-00155d088a01',
  name: 'Альфа',
  evo_id_elt: 'Alfa',
};

it('ELT/Kasko/convertKaskoResultToRow', () => {
  expect(convertEltResult(resultCompany, entityCompany, '0')).toEqual({
    key: '0',
    evo_id_elt: 'Alfa',
    name: 'Альфа',
    sumType: 'premiumSum',
    sumTitle: 'Премия по договору',
    PremiumSum: 55555,
    KASKOSum: 1111,
    GOSum: 4444,
    NSSum: 8888,
    message: 'Комментарий альфы',
    requestId: '1364968',
    skCalcId: '66758382',
    children: [
      {
        key: '0',
        sumTitle: 'КАСКО',
        premiumSum: 1111,
      },
      {
        key: '0',
        sumTitle: 'ДГО',
        premiumSum: 4444,
      },
      {
        key: '0',
        sumTitle: 'НС',
        premiumSum: 8888,
      },
    ],
  });
});
