const getDefaultProps = (index = 1) => ({
  status: 'active',
  name: `Relation ${index} Name`,
  short_name: `Relation ${index} Short Name`,
  url: 'https://test-site.com',
  logo_url: 'rizk-logopng7ed316ac19-original.png',
  iframe: 'https://www.youtube.com/embed/DU1Pio4n_N0',
  extra_fields: {
    summary_background: 'fe63f69ca1618cf2e7ff810197001dec.png',
    summary: 'Summary',
  },
  bonus: {
    one_liners: { main: { one_liner: 'Oneliner' } },
    deposit_methods: {},
  },
  one_liners: {
    main: { one_liner: '100% Bonus + 50 free spins' },
  },
});

const getTemplateProps = (template) =>
  ({
    operator: {
      relation_type: 'casino',
      ribbons: [],
      bonus: { deposit_methods: [{ id: 1 }] },
      extra_fields: { ribbon_text: 'Recommended,New Casino' },
    },
    game: {
      relation_type: 'game',
      game_provider: { id: 1 },
    },
    author: {
      relation_type: 'author',
    },
  }[template] || {});

export default function getRealationList({ template, count = 1, id = 1, ...customProps } = {}) {
  const realationList = [];
  // eslint-disable-next-line no-plusplus
  for (let index = id; index < id + count; index++) {
    realationList[index] = {
      id: index,
      ...getDefaultProps(index),
      ...getTemplateProps(template),
      ...customProps,
    };
  }
  return realationList;
}
