use of gov.ca.cwds.cals.service.dto.rfa.OtherAdultDTO in project cals-api by ca-cwds.
the class RFA1aFormMapper method toOtherAdultDTO.
default OtherAdultDTO toOtherAdultDTO(RFA1aOtherAdult entity) {
OtherAdultDTO otherAdultDTO = entity.getOtherAdult();
Optional.ofNullable(entity.getRfa1bForm()).ifPresent(rfa1bForm -> otherAdultDTO.setRfa1bForm(rfa1bForm.getEntityDTO()));
Optional.ofNullable(entity.getLic198bForm()).ifPresent(lic198bForm -> otherAdultDTO.setLic198bForm(lic198bForm.getEntityDTO()));
return otherAdultDTO;
}
use of gov.ca.cwds.cals.service.dto.rfa.OtherAdultDTO in project cals-api by ca-cwds.
the class Rfa1aFormGenerationTest method getOtherAdult.
public OtherAdultDTO getOtherAdult(Long applicantId, int seed) throws Exception {
OtherAdultDTO otherAdult = mapper.readValue(OTHER_ADULTS_FIXTURE, OtherAdultDTO.class);
otherAdult.setFirstName(otherAdult.getFirstName() + seed);
otherAdult.setLastName(otherAdult.getLastName() + seed);
otherAdult.getRelationshipToApplicants().get(0).setApplicantId(applicantId);
return otherAdult;
}
use of gov.ca.cwds.cals.service.dto.rfa.OtherAdultDTO in project cals-api by ca-cwds.
the class PacketBuilder method otherAdults.
public PacketBuilder otherAdults(RFA1aFormDTO rfa1aFormDTO) {
List<PersonSummaryDTO> otherAdults = new ArrayList<>();
if (checkIfSectionIsNotEmpty(rfa1aFormDTO.getOtherAdults())) {
for (OtherAdultDTO otherAdult : rfa1aFormDTO.getOtherAdults()) {
otherAdults.add(new PersonSummaryDTO(otherAdult.getId(), otherAdult.getFirstName(), otherAdult.getLastName(), checkIdIfExists(otherAdult.getRfa1bForm())));
}
}
this.otherAdults = otherAdults;
return this;
}
use of gov.ca.cwds.cals.service.dto.rfa.OtherAdultDTO in project cals-api by ca-cwds.
the class OtherAdultsHelper method createOtherAdults.
public List<OtherAdultDTO> createOtherAdults(Long formId, ApplicantDTO relativeApplicant) throws Exception {
List<OtherAdultDTO> otherAdultsDTOs = new ArrayList<>(2);
for (int i = 0; i < 2; i++) {
OtherAdultDTO otherAdultDTO = getOtherAdultDTO(relativeApplicant);
otherAdultDTO.setFirstName(otherAdultDTO.getFirstName() + i);
otherAdultDTO.setLastName(otherAdultDTO.getLastName() + i);
otherAdultsDTOs.add(postOtherAdult(formId, otherAdultDTO));
}
return otherAdultsDTOs;
}
use of gov.ca.cwds.cals.service.dto.rfa.OtherAdultDTO in project cals-api by ca-cwds.
the class OtherAdultsHelper method getOtherAdultDTO.
public OtherAdultDTO getOtherAdultDTO(ApplicantDTO relativeApplicant, String fixture) throws IOException {
OtherAdultDTO otherAdultDTO = clientTestRule.getMapper().readValue(fixture, OtherAdultDTO.class);
// Assume that we have only one relationship object
otherAdultDTO.getRelationshipToApplicants().get(0).setApplicantId(relativeApplicant.getId());
return otherAdultDTO;
}
Aggregations