use of gov.ca.cwds.cms.data.access.dto.SCPEntityAwareDTO in project api-core by ca-cwds.
the class SubstituteCareProviderCoreService method enrichSCPEntityAwareDTO.
/**
* Build all entities which are required for creating SubstituteCareProvider entity
*/
private ExtendedSCPEntityAwareDTO enrichSCPEntityAwareDTO(SCPEntityAwareDTO scpEntityAwareDTO) {
ExtendedSCPEntityAwareDTO dto = new ExtendedSCPEntityAwareDTO(scpEntityAwareDTO);
final SubstituteCareProvider substituteCareProvider = dto.getEntity();
substituteCareProvider.setIdentifier(IdGenerator.generateId());
dto.setSubstituteCareProviderUc(buildSubstituteCareProviderUc(dto.getEntity()));
dto.setPlacementHomeInformation(buildPlacementHomeInformation(dto.getEntity(), dto));
enrichPhoneContactDetails(dto);
List<ScpOtherEthnicity> clientScpEthnicities = dto.getEthnicityList().stream().map(ethnicity -> buildScpOtherEthnicity(ethnicity, dto.getEntity().getIdentifier())).collect(Collectors.toList());
dto.setClientScpEthnicities(clientScpEthnicities);
enrichOutOfStateChecks(dto);
return dto;
}
use of gov.ca.cwds.cms.data.access.dto.SCPEntityAwareDTO in project cals-api by ca-cwds.
the class PlacementHomeEntityAwareDTOBuilder method appendSubstituteCareProviders.
public PlacementHomeEntityAwareDTOBuilder appendSubstituteCareProviders() {
List<ApplicantDTO> applicants = Optional.ofNullable(form.getApplicants()).orElse(Collections.emptyList());
for (ApplicantDTO applicant : applicants) {
SCPEntityAwareDTO scpEntityAwareDTO = buildSubstituteCareProviderParameterObject(form, applicant);
rfaApplicantIdsMap.put(applicant.getId(), scpEntityAwareDTO.getEntity());
placementHomeEntityAwareDTO.addSCPParameterObject(scpEntityAwareDTO);
}
return this;
}
Aggregations