use of gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aForm in project cals-api by ca-cwds.
the class AbstractRFAInternalEntityService method update.
@Override
public T update(Long applicationId, T request) {
RFA1aForm form = applicationDao.find(applicationId);
if (form == null) {
throw new ExpectedException(Constants.ExpectedExceptionMessages.RFA_1A_APPLICATION_NOT_FOUND_BY_ID, NOT_FOUND);
}
form.setUpdateDateTime(LocalDateTime.now());
form.setUpdateUserId(PrincipalUtils.getStaffPersonId());
configuration.putEntityToTheForm(form, request);
RFA1aForm updatedForm = applicationDao.update(form);
return configuration.getEntityFromTheForm(updatedForm);
}
use of gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aForm in project cals-api by ca-cwds.
the class RFA1aFormService method updateFormAfterPlacementHomeCreation.
private void updateFormAfterPlacementHomeCreation(Long formId, String placementHomeId, RFAApplicationStatus newStatus) {
RFA1aForm form = xaRfa1AFormsDao.find(formId);
form.setStatus(newStatus);
form.setPlacementHomeId(placementHomeId);
xaRfa1AFormsDao.update(fillFormUpdateAttributes(form));
}
use of gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aForm in project cals-api by ca-cwds.
the class RFA1aFormService method find.
@UnitOfWork(CALSNS)
@Override
public RFA1aFormDTO find(RFA1aFormsParameterObject parameterObject) {
RFA1aForm form = rfa1AFormsDao.find(parameterObject.getFormId());
RFA1aFormDTO formDTO;
if (parameterObject.isExpanded()) {
formDTO = rfa1aFomMapper.toExpandedRFA1aFormDTO(form);
} else {
formDTO = rfa1aFomMapper.toRFA1aFormDTO(form);
}
return formDTO;
}
use of gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aForm in project cals-api by ca-cwds.
the class ApplicantNamesDuplicationConstraintPutConfiguration method getValidatedFact.
@Override
public RFA1aForm getValidatedFact(Object[] input) {
BusinessValidationParameterObject<ApplicantDTO> parameterObject = getBusinessValidationParameterObject(input);
RFA1aForm form = getFormDao().find(parameterObject.getFormId());
return buildModifiedForm(form, parameterObject.getEntityDTO());
}
use of gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aForm in project cals-api by ca-cwds.
the class RFA1aApplicantService method create.
@Override
public ApplicantDTO create(RFAExternalEntityUpdateParameterObject<ApplicantDTO> request) {
ApplicantDTO applicant = super.create(request);
RFA1aForm form = formsDao.find(request.getFormId());
if (form.getStatus() != RFAApplicationStatus.IN_PROGRESS) {
form.setStatus(RFAApplicationStatus.IN_PROGRESS);
}
return applicant;
}
Aggregations