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;
}
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;
}
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;
}
Aggregations