@Override
protected void init(IndividualCandidacyProcessBean bean) {
checkParameters(bean.getCandidacyProcess());
if (bean.getPublicCandidacyHashCode() == null) {
throw new DomainException("error.IndividualCandidacy.hash.code.is.null");
}
if (existsIndividualCandidacyProcessForDocumentId(bean.getCandidacyProcess(), bean.getPersonBean().getIdDocumentType(),
bean.getPersonBean().getDocumentIdNumber())) {
throw new DomainException("error.IndividualCandidacy.exists.for.same.document.id");
}
if (!StringUtils.isEmpty(bean.getPersonBean().getEidentifier())
&& existsIndividualCandidacyProcessForEidentifier(bean.getCandidacyProcess(), bean.getPersonBean()
.getEidentifier())) {
throw new DomainException("error.individualCandidacy.exists.for.same.eIdentifier");
}
setCandidacyProcess(bean.getCandidacyProcess());
createIndividualCandidacy(bean);