use of gov.ca.cwds.cals.service.dto.rfa.RelationshipToApplicantDTO in project cals-api by ca-cwds.
the class PacketBuilder method adultChildren.
public PacketBuilder adultChildren(RFA1aFormDTO rfa1aFormDTO) {
List<PersonSummaryDTO> adultChildren = new ArrayList<>();
if (checkIfSectionIsNotEmpty(rfa1aFormDTO.getOtherAdults()) && checkIfSectionIsNotEmpty(rfa1aFormDTO.getApplicantsRelationship())) {
for (OtherAdultDTO otherAdult : rfa1aFormDTO.getOtherAdults()) {
for (RelationshipToApplicantDTO relationshipToApplicant : otherAdult.getRelationshipToApplicants()) {
if (relationshipToApplicant.getRelationshipToApplicantType().getValue().equalsIgnoreCase("Child")) {
adultChildren.add(new PersonSummaryDTO(otherAdult.getId(), otherAdult.getFirstName(), otherAdult.getLastName(), checkIdIfExists(otherAdult.getRfa1bForm())));
}
}
}
}
this.adultChildren = adultChildren;
return this;
}
Aggregations