import metadata from './metadata';
import candidateMetadata from './candidateMetadata';
const combinedMetadata = function combinedMetadata(data) {
  const {
    contest,
    candidates
  } = data;
  return {
    contest: metadata(contest),
    candidates: Object.fromEntries(Object.values(candidates).map(candidate => {
      const candMeta = candidateMetadata(candidate);
      return [candMeta.id, candMeta];
    }))
  };
};
export default combinedMetadata;