use of gov.ca.cwds.cms.data.access.dto.ExtendedSCPEntityAwareDTO in project api-core by ca-cwds.
the class BaseDocToolRulesSubstituteCareProviderTest method setUp.
@Before
public void setUp() {
businessValidationService = new BusinessValidationService(droolsService);
SCPEntityAwareDTO scpEntityAwareDTO = new SCPEntityAwareDTO();
entityAwareDTO = new ExtendedSCPEntityAwareDTO(scpEntityAwareDTO);
PlacementHomeInformation placementHomeInformation = new PlacementHomeInformation();
entityAwareDTO.setPlacementHomeInformation(placementHomeInformation);
scpService = new SubstituteCareProviderCoreService(mock(SubstituteCareProviderDao.class));
entityAwareDTO.setEntity(new SubstituteCareProvider());
}
use of gov.ca.cwds.cms.data.access.dto.ExtendedSCPEntityAwareDTO 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;
}
Aggregations