Search in sources :

Example 16 with SubstituteCareProvider

use of gov.ca.cwds.data.legacy.cms.entity.SubstituteCareProvider in project api-core by ca-cwds.

the class R04966Test method testLastNmInalid.

@Test
public void testLastNmInalid() {
    SubstituteCareProvider substituteCareProvider = entityAwareDTO.getEntity();
    substituteCareProvider.setLastNm("11");
    checkFail("R-04966");
}
Also used : SubstituteCareProvider(gov.ca.cwds.data.legacy.cms.entity.SubstituteCareProvider) Test(org.junit.Test)

Example 17 with SubstituteCareProvider

use of gov.ca.cwds.data.legacy.cms.entity.SubstituteCareProvider 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;
}
Also used : PrincipalUtils.getStaffPersonId(gov.ca.cwds.security.utils.PrincipalUtils.getStaffPersonId) SubstituteCareProviderUcDao(gov.ca.cwds.cms.data.access.dao.SubstituteCareProviderUcDao) SsaName3ParameterObject(gov.ca.cwds.data.legacy.cms.dao.SsaName3ParameterObject) DataAccessServicesException(gov.ca.cwds.cms.data.access.service.DataAccessServicesException) SubstituteCareProvider(gov.ca.cwds.data.legacy.cms.entity.SubstituteCareProvider) Date(java.util.Date) Inject(com.google.inject.Inject) LocalDateTime(java.time.LocalDateTime) DataAccessServiceLifecycle(gov.ca.cwds.cms.data.access.service.lifecycle.DataAccessServiceLifecycle) PhoneContactDetailDao(gov.ca.cwds.cms.data.access.dao.PhoneContactDetailDao) SubstituteCareProviderUc(gov.ca.cwds.data.legacy.cms.entity.SubstituteCareProviderUc) CollectionUtils(org.apache.commons.collections4.CollectionUtils) ArrayList(java.util.ArrayList) SCPEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.SCPEntityAwareDTO) PerryAccount(gov.ca.cwds.security.realm.PerryAccount) OutOfStateCheck(gov.ca.cwds.data.legacy.cms.entity.OutOfStateCheck) CountyOwnershipDao(gov.ca.cwds.cms.data.access.dao.CountyOwnershipDao) PlacementHomeInformationDao(gov.ca.cwds.cms.data.access.dao.PlacementHomeInformationDao) Authorize(gov.ca.cwds.security.annotations.Authorize) SubstituteCareProviderDao(gov.ca.cwds.cms.data.access.dao.SubstituteCareProviderDao) DefaultDataAccessLifeCycle(gov.ca.cwds.cms.data.access.service.lifecycle.DefaultDataAccessLifeCycle) BusinessValidationService(gov.ca.cwds.cms.data.access.service.BusinessValidationService) CountyOwnership(gov.ca.cwds.data.legacy.cms.entity.CountyOwnership) SubstituteCareProviderDroolsConfiguration(gov.ca.cwds.cms.data.access.service.rules.SubstituteCareProviderDroolsConfiguration) PhoneContactDetail(gov.ca.cwds.data.legacy.cms.entity.PhoneContactDetail) OutOfStateCheckDao(gov.ca.cwds.cms.data.access.dao.OutOfStateCheckDao) SsaName3Dao(gov.ca.cwds.cms.data.access.dao.SsaName3Dao) DataAccessServiceBase(gov.ca.cwds.cms.data.access.service.DataAccessServiceBase) CountyOwnershipMapper(gov.ca.cwds.cms.data.access.mapper.CountyOwnershipMapper) ParametersValidator.checkNotPersisted(gov.ca.cwds.cms.data.access.utils.ParametersValidator.checkNotPersisted) PlacementHomeInformation(gov.ca.cwds.data.legacy.cms.entity.PlacementHomeInformation) Collectors(java.util.stream.Collectors) ParametersValidator(gov.ca.cwds.cms.data.access.utils.ParametersValidator) DroolsException(gov.ca.cwds.drools.DroolsException) List(java.util.List) ScpOtherEthnicityDao(gov.ca.cwds.cms.data.access.dao.ScpOtherEthnicityDao) ScpOtherEthnicity(gov.ca.cwds.data.legacy.cms.entity.ScpOtherEthnicity) LocalDate(java.time.LocalDate) StringUtils.upperCase(org.apache.commons.lang3.StringUtils.upperCase) Constants(gov.ca.cwds.cms.data.access.Constants) CWSIdentifier(gov.ca.cwds.cms.data.access.CWSIdentifier) ExtendedSCPEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.ExtendedSCPEntityAwareDTO) DataAccessBundle(gov.ca.cwds.cms.data.access.service.lifecycle.DataAccessBundle) PhoneticSearchTables(gov.ca.cwds.cms.data.access.Constants.PhoneticSearchTables) Collections(java.util.Collections) ExtendedSCPEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.ExtendedSCPEntityAwareDTO) SubstituteCareProvider(gov.ca.cwds.data.legacy.cms.entity.SubstituteCareProvider) ScpOtherEthnicity(gov.ca.cwds.data.legacy.cms.entity.ScpOtherEthnicity)

Aggregations

SubstituteCareProvider (gov.ca.cwds.data.legacy.cms.entity.SubstituteCareProvider)17 Test (org.junit.Test)13 SCPEntityAwareDTO (gov.ca.cwds.cms.data.access.dto.SCPEntityAwareDTO)5 SubstituteCareProviderDao (gov.ca.cwds.cms.data.access.dao.SubstituteCareProviderDao)3 SubstituteCareProviderCoreService (gov.ca.cwds.cms.data.access.service.impl.SubstituteCareProviderCoreService)3 PerryAccount (gov.ca.cwds.security.realm.PerryAccount)3 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)3 ExtendedSCPEntityAwareDTO (gov.ca.cwds.cms.data.access.dto.ExtendedSCPEntityAwareDTO)2 BusinessValidationService (gov.ca.cwds.cms.data.access.service.BusinessValidationService)2 PhoneContactDetail (gov.ca.cwds.data.legacy.cms.entity.PhoneContactDetail)2 PlacementHomeInformation (gov.ca.cwds.data.legacy.cms.entity.PlacementHomeInformation)2 Inject (com.google.inject.Inject)1 CWSIdentifier (gov.ca.cwds.cms.data.access.CWSIdentifier)1 Constants (gov.ca.cwds.cms.data.access.Constants)1 PhoneticSearchTables (gov.ca.cwds.cms.data.access.Constants.PhoneticSearchTables)1 CountyOwnershipDao (gov.ca.cwds.cms.data.access.dao.CountyOwnershipDao)1 OutOfStateCheckDao (gov.ca.cwds.cms.data.access.dao.OutOfStateCheckDao)1 PhoneContactDetailDao (gov.ca.cwds.cms.data.access.dao.PhoneContactDetailDao)1 PlacementHomeInformationDao (gov.ca.cwds.cms.data.access.dao.PlacementHomeInformationDao)1 ScpOtherEthnicityDao (gov.ca.cwds.cms.data.access.dao.ScpOtherEthnicityDao)1