import summary from './summary';
const summaryCollection = function summaryCollection(data) {
  const {
    id,
    contests,
    ...restData
  } = data;
  const formattedContests = contests.map(contest => summary(contest));
  return {
    id: `collection:${id}`,
    contests: formattedContests.map(({
      id: contestId
    }) => contestId),
    contestsById: Object.fromEntries(formattedContests.map(contest => [contest.id, contest])),
    ...restData
  };
};
export default summaryCollection;