class AssessorsFormPopulator implements CompetitionSetupFormPopulator {

	@Override
	public CompetitionSetupForm populateForm(CompetitionResource competitionResource) {
		CompetitionAssessmentConfigResource competitionAssessmentConfigResource = competitionAssessmentConfigRestService.findOneByCompetitionId(competitionResource.getId()).getSuccess();

		AssessorsForm competitionSetupForm = new AssessorsForm();

		competitionSetupForm.setAssessorCount(competitionAssessmentConfigResource.getAssessorCount());
		competitionSetupForm.setAssessorPay(competitionAssessmentConfigResource.getAssessorPay() != null ? competitionAssessmentConfigResource.getAssessorPay() : BigDecimal.ZERO);
		competitionSetupForm.setHasAssessmentPanel(competitionAssessmentConfigResource.getHasAssessmentPanel());
		competitionSetupForm.setHasInterviewStage(competitionAssessmentConfigResource.getHasInterviewStage());
		competitionSetupForm.setAssessorFinanceView(competitionAssessmentConfigResource.getAssessorFinanceView());
		competitionSetupForm.setAverageAssessorScore(competitionAssessmentConfigResource.getIncludeAverageAssessorScoreInNotifications());

		return competitionSetupForm;
	}

}