class AcademicCostViewModelPopulator {

    public AcademicCostViewModel populate(long organisationId, long applicationId, long sectionId, boolean applicant) {

        ApplicationResource application = applicationRestService.getApplicationById(applicationId).getSuccess();

        CompetitionResource competition = competitionRestService.getCompetitionById(application.getCompetition()).getSuccess();

        List<Long> completedSectionIds = sectionService.getCompleted(applicationId, organisationId);

        OrganisationResource organisation = organisationRestService.getOrganisationById(organisationId).getSuccess();

        ApplicationFinanceResource finance = applicationFinanceRestService.getFinanceDetails(applicationId, organisationId).getSuccess();

        boolean includeVat = STANDARD_WITH_VAT.equals(competition.getApplicationFinanceType());

        boolean complete = completedSectionIds.contains(sectionId);

        boolean open = applicant && competition.isOpen() && application.isOpen();

        return new AcademicCostViewModel(
                getYourFinancesUrl(applicationId, organisationId, applicant),
                application.getName(),
                competition.getName(),
                organisation.getName(),
                applicationId,
                sectionId,
                organisationId,
                finance.getId(),
                applicant,
                includeVat,
                open,
                complete);
    }

      AcademicCostViewModelPopulator();
    @Autowired public  AcademicCostViewModelPopulator(ApplicationRestService applicationRestService, CompetitionRestService competitionRestService, SectionService sectionService, OrganisationRestService organisationRestService, ApplicationFinanceRestService applicationFinanceRestService);

}