import { pick } from 'lodash';

export default function (resultCompany, key) {
  if (!resultCompany || Object.keys(resultCompany).length === 0) {
    return;
  }

  const dataFromResult = pick(
    resultCompany,
    ['numCalc', 'premiumSum', 'message'],
    '',
  );

  return {
    key,
    sumType: 'premiumSum',
    sumTitle: 'Премия по договору',
    ...dataFromResult,
  };
}
