Search in sources :

Example 1 with FacilityChildParameterObject

use of gov.ca.cwds.cals.web.rest.parameter.FacilityChildParameterObject in project cals-api by ca-cwds.

the class FacilityChildService method find.

@Override
public Response find(Serializable params) {
    FacilityChildParameterObject parameterObject = (FacilityChildParameterObject) params;
    Client client = null;
    if (parameterObject.getUnitOfWork().equals(UnitOfWork.CMS)) {
        client = clientService.getClientByFacilityIdAndChildId(parameterObject.getFacilityId(), parameterObject.getChildId());
    } else {
        client = clientService.getClientByLicNumAndChildId(parameterObject.getFacilityId(), parameterObject.getChildId());
    }
    return facilityChildMapper.toFacilityChildDTO(client);
}
Also used : FacilityChildParameterObject(gov.ca.cwds.cals.web.rest.parameter.FacilityChildParameterObject) Client(gov.ca.cwds.data.legacy.cms.entity.Client)

Example 2 with FacilityChildParameterObject

use of gov.ca.cwds.cals.web.rest.parameter.FacilityChildParameterObject in project cals-api by ca-cwds.

the class FacilityChildCollectionService method find.

@Override
public Response find(Serializable params) {
    FacilityChildParameterObject parameterObject = (FacilityChildParameterObject) params;
    FacilityChildrenDto facilityChildrenDto = new FacilityChildrenDto();
    if (parameterObject.getUnitOfWork().equals(UnitOfWork.CMS)) {
        facilityChildrenDto.getChildren().addAll(getChildrenFromCwsFacility(parameterObject.getFacilityId()));
    } else {
        facilityChildrenDto.getChildren().addAll(getChildrenFromLisFacility(parameterObject.getFacilityId()));
    }
    return facilityChildrenDto.getChildren().isEmpty() ? null : facilityChildrenDto;
}
Also used : FacilityChildrenDto(gov.ca.cwds.cals.service.dto.FacilityChildrenDto) FacilityChildParameterObject(gov.ca.cwds.cals.web.rest.parameter.FacilityChildParameterObject)

Aggregations

FacilityChildParameterObject (gov.ca.cwds.cals.web.rest.parameter.FacilityChildParameterObject)2 FacilityChildrenDto (gov.ca.cwds.cals.service.dto.FacilityChildrenDto)1 Client (gov.ca.cwds.data.legacy.cms.entity.Client)1