class ProjectDetailsViewModel {

    public String getLocationForPartnerOrganisation(Long organisationId) {
        return partnerOrganisations.stream()
                .filter(partnerOrganisation ->  partnerOrganisation.getOrganisation().equals(organisationId))
                .findFirst()
                .map(partnerOrg -> {
                    Optional<OrganisationResource> organisationResource = organisations.stream().filter(org -> organisationId.equals(org.getId())).findFirst();
                    if (organisationResource.isPresent() && organisationResource.get().isInternational()) {
                        return partnerOrg.getInternationalLocation();
                    } else {
                        return partnerOrg.getPostcode();
                    }
                })
                .orElse(null);
    }

    public  ProjectDetailsViewModel(ProjectResource project, UserResource currentUser,
                                         List<Long> usersPartnerOrganisations,
                                         List<OrganisationResource> organisations,
                                         List<PartnerOrganisationResource> partnerOrganisations,
                                         OrganisationResource leadOrganisation,
                                         boolean userIsLeadPartner,
                                         boolean spendProfileGenerated,
                                         boolean grantOfferLetterGenerated,
                                         boolean readOnlyView,
                                         CompetitionResource competitionResource);

}