@Override
public Object provide(Object source, Object current) {
List<IndividualCandidacyDocumentFileType> fileTypesList = new ArrayList<IndividualCandidacyDocumentFileType>();
CandidacyProcessDocumentUploadBean uploadBean = (CandidacyProcessDocumentUploadBean) source;
IndividualCandidacyProcess individualCandidacyProcess = uploadBean.getIndividualCandidacyProcess();
if (individualCandidacyProcess.getAllFilesForType(IndividualCandidacyDocumentFileType.CV_DOCUMENT).size() <= 10) {
fileTypesList.add(IndividualCandidacyDocumentFileType.CV_DOCUMENT);
}
if (individualCandidacyProcess.getAllFilesForType(
IndividualCandidacyDocumentFileType.HABILITATION_CERTIFICATE_DOCUMENT).size() <= 10) {
fileTypesList.add(IndividualCandidacyDocumentFileType.HABILITATION_CERTIFICATE_DOCUMENT);
}
if (individualCandidacyProcess.getAllFilesForType(IndividualCandidacyDocumentFileType.DOCUMENT_IDENTIFICATION).size() <= 10) {
fileTypesList.add(IndividualCandidacyDocumentFileType.DOCUMENT_IDENTIFICATION);
}
if (individualCandidacyProcess.getAllFilesForType(IndividualCandidacyDocumentFileType.PAYMENT_DOCUMENT).size() <= 10) {
fileTypesList.add(IndividualCandidacyDocumentFileType.PAYMENT_DOCUMENT);
}
if (individualCandidacyProcess.getAllFilesForType(IndividualCandidacyDocumentFileType.REGISTRATION_CERTIFICATE)
.size() <= 10) {
fileTypesList.add(IndividualCandidacyDocumentFileType.REGISTRATION_CERTIFICATE);
}
if (individualCandidacyProcess.getAllFilesForType(IndividualCandidacyDocumentFileType.NO_PRESCRIPTION_CERTIFICATE)
.size() <= 10) {
fileTypesList.add(IndividualCandidacyDocumentFileType.NO_PRESCRIPTION_CERTIFICATE);
}
if (individualCandidacyProcess.getAllFilesForType(IndividualCandidacyDocumentFileType.VAT_CARD_DOCUMENT).size() <= 10) {
fileTypesList.add(IndividualCandidacyDocumentFileType.VAT_CARD_DOCUMENT);
}
if (individualCandidacyProcess.getAllFilesForType(
IndividualCandidacyDocumentFileType.FIRST_CYCLE_ACCESS_HABILITATION_CERTIFICATE).size() <= 10) {
fileTypesList.add(IndividualCandidacyDocumentFileType.FIRST_CYCLE_ACCESS_HABILITATION_CERTIFICATE);
}
if (individualCandidacyProcess.getAllFilesForType(
IndividualCandidacyDocumentFileType.FOREIGN_INSTITUTION_SCALE_CERTIFICATE).size() <= 10) {
fileTypesList.add(IndividualCandidacyDocumentFileType.FOREIGN_INSTITUTION_SCALE_CERTIFICATE);
}
if (individualCandidacyProcess.getAllFilesForType(IndividualCandidacyDocumentFileType.GRADES_DOCUMENT).size() <= 10) {
fileTypesList.add(IndividualCandidacyDocumentFileType.GRADES_DOCUMENT);
}
return fileTypesList;
}