use of gov.ca.cwds.cals.web.rest.parameter.RFAApplicantAwareEntityUpdateParams in project cals-api by ca-cwds.
the class LIC198bService method create.
@Override
public LIC198bFormDTO create(RFAExternalEntityUpdateParameterObject<LIC198bFormDTO> request) {
LIC198bForm lic198bForm = composeEntity(request);
LIC198bDao dao = (LIC198bDao) getDao();
if (request instanceof RFAApplicantAwareEntityUpdateParams) {
RFAApplicantAwareEntityUpdateParams params = (RFAApplicantAwareEntityUpdateParams) request;
lic198bForm = dao.createForApplicant(lic198bForm, params.getApplicantId());
} else if (request instanceof RFAOtherAdultAwareEntityUpdateParams) {
RFAOtherAdultAwareEntityUpdateParams params = (RFAOtherAdultAwareEntityUpdateParams) request;
lic198bForm = dao.createForOtherAdult(lic198bForm, params.getOtherAdultId());
}
return extractDTO(lic198bForm);
}
use of gov.ca.cwds.cals.web.rest.parameter.RFAApplicantAwareEntityUpdateParams in project cals-api by ca-cwds.
the class RFA1bService method find.
public RFA1bFormDTO find(RFAExternalEntityUpdateParameterObject<RFA1bFormDTO> params) {
if (params instanceof RFAApplicantAwareEntityUpdateParams) {
Long applicantId = ((RFAApplicantAwareEntityUpdateParams) params).getApplicantId();
RFA1aApplicant applicant = applicantDao.find(applicantId);
return extractDTO(applicant.getRfa1bForm());
} else if (params instanceof RFAOtherAdultAwareEntityUpdateParams) {
Long otherAdultId = ((RFAOtherAdultAwareEntityUpdateParams) params).getOtherAdultId();
RFA1aOtherAdult rfa1aOtherAdult = otherAdultDao.find(otherAdultId);
return extractDTO(rfa1aOtherAdult.getRfa1bForm());
}
return null;
}
use of gov.ca.cwds.cals.web.rest.parameter.RFAApplicantAwareEntityUpdateParams in project cals-api by ca-cwds.
the class LIC198bService method find.
public LIC198bFormDTO find(RFAExternalEntityUpdateParameterObject<RFA1bFormDTO> params) {
if (params instanceof RFAApplicantAwareEntityUpdateParams) {
Long applicantId = ((RFAApplicantAwareEntityUpdateParams) params).getApplicantId();
RFA1aApplicant applicant = applicantDao.find(applicantId);
return extractDTO(applicant.getLic198bForm());
} else if (params instanceof RFAOtherAdultAwareEntityUpdateParams) {
Long otherAdultId = ((RFAOtherAdultAwareEntityUpdateParams) params).getOtherAdultId();
RFA1aOtherAdult rfa1aOtherAdult = otherAdultDao.find(otherAdultId);
return extractDTO(rfa1aOtherAdult.getLic198bForm());
}
return null;
}
use of gov.ca.cwds.cals.web.rest.parameter.RFAApplicantAwareEntityUpdateParams in project cals-api by ca-cwds.
the class RFA1bService method create.
@Override
public RFA1bFormDTO create(RFAExternalEntityUpdateParameterObject<RFA1bFormDTO> request) {
RFA1bFormDTO rfa1bFormDTO = find(request);
if (rfa1bFormDTO != null) {
throw new ExpectedException(Constants.ExpectedExceptionMessages.RFA_1B_FORM_ALREADY_EXISTS, BAD_REQUEST);
}
RFA1bForm rfa1bForm = composeEntity(request);
RFA1bDao dao = (RFA1bDao) getDao();
if (request instanceof RFAApplicantAwareEntityUpdateParams) {
RFAApplicantAwareEntityUpdateParams params = (RFAApplicantAwareEntityUpdateParams) request;
rfa1bForm = dao.createForApplicant(rfa1bForm, params.getApplicantId());
} else if (request instanceof RFAOtherAdultAwareEntityUpdateParams) {
RFAOtherAdultAwareEntityUpdateParams params = (RFAOtherAdultAwareEntityUpdateParams) request;
rfa1bForm = dao.createForOtherAdult(rfa1bForm, params.getOtherAdultId());
}
return extractDTO(rfa1bForm);
}
Aggregations