class TermsAndConditionsModelPopulator implements CompetitionSetupSectionModelPopulator {

    @Override
    public CompetitionSetupViewModel populateModel(GeneralSetupViewModel generalViewModel,
                                                   CompetitionResource competitionResource) {

        List<GrantTermsAndConditionsResource> termsAndConditionsList = termsAndConditionsRestService
                .getLatestVersionsForAllTermsAndConditions()
                .getSuccess();

        GrantTermsAndConditionsResource termsAndConditions = termsAndConditionsRestService.getById(
                competitionResource.getTermsAndConditions().getId()).getSuccess();

        boolean termsAndConditionsDocUploaded = competitionResource.isCompetitionTermsUploaded();

        return new TermsAndConditionsViewModel(generalViewModel, termsAndConditionsList,
                termsAndConditions, termsAndConditionsDocUploaded);
    }

}