Search in sources :

Example 1 with PersonSummaryDTO

use of gov.ca.cwds.cals.service.dto.packet.PersonSummaryDTO in project cals-api by ca-cwds.

the class PacketBuilder method applicants.

public PacketBuilder applicants(RFA1aFormDTO rfa1aFormDTO) {
    List<PersonSummaryDTO> applicants = new ArrayList<>();
    if (checkIfSectionIsNotEmpty(rfa1aFormDTO.getApplicants())) {
        for (ApplicantDTO applicant : rfa1aFormDTO.getApplicants()) {
            applicants.add(new PersonSummaryDTO(applicant.getId(), applicant.getFirstName(), applicant.getLastName(), checkIdIfExists(applicant.getRfa1bForm())));
        }
    }
    this.applicants = applicants;
    return this;
}
Also used : ArrayList(java.util.ArrayList) RelationshipToApplicantDTO(gov.ca.cwds.cals.service.dto.rfa.RelationshipToApplicantDTO) ApplicantDTO(gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO) PersonSummaryDTO(gov.ca.cwds.cals.service.dto.packet.PersonSummaryDTO)

Example 2 with PersonSummaryDTO

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

Example 3 with PersonSummaryDTO

use of gov.ca.cwds.cals.service.dto.packet.PersonSummaryDTO 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)3 ArrayList (java.util.ArrayList)3 OtherAdultDTO (gov.ca.cwds.cals.service.dto.rfa.OtherAdultDTO)2 RelationshipToApplicantDTO (gov.ca.cwds.cals.service.dto.rfa.RelationshipToApplicantDTO)2 ApplicantDTO (gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO)1