Search in sources :

Example 1 with RelationshipToApplicantDTO

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;
}
Also used : RelationshipToApplicantDTO(gov.ca.cwds.cals.service.dto.rfa.RelationshipToApplicantDTO) OtherAdultDTO(gov.ca.cwds.cals.service.dto.rfa.OtherAdultDTO) ArrayList(java.util.ArrayList) PersonSummaryDTO(gov.ca.cwds.cals.service.dto.packet.PersonSummaryDTO)

Aggregations

PersonSummaryDTO (gov.ca.cwds.cals.service.dto.packet.PersonSummaryDTO)1 OtherAdultDTO (gov.ca.cwds.cals.service.dto.rfa.OtherAdultDTO)1 RelationshipToApplicantDTO (gov.ca.cwds.cals.service.dto.rfa.RelationshipToApplicantDTO)1 ArrayList (java.util.ArrayList)1