Search in sources :

Example 6 with FacilityDTO

use of gov.ca.cwds.cals.service.dto.FacilityDTO in project cals-api by ca-cwds.

the class FacilityService method loadFacilityFromLis.

private FacilityDTO loadFacilityFromLis(FacilityParameterObject parameterObject) {
    FacilityDTO facilityDto = lisFacilityService.loadFacilityFromLis(parameterObject);
    FacilityInformation facilityInformation = fasFacilityService.findFacilityInfoByLicenseNumber(parameterObject);
    if (facilityInformation != null) {
        lisFacilityService.attachVisitsData(facilityInformation);
    }
    fasFacilityMapper.toFacilityDTO(facilityDto, facilityInformation);
    if (parameterObject.isExpanded()) {
        List<FacilityChildDTO> facilityChildren = cwsFacilityService.findFacilityChildrenByLicenseNumber(Integer.valueOf(parameterObject.getFacilityId()));
        List<FacilityInspectionDTO> inspections = fasFacilityService.findInspectionsByFacilityId(parameterObject.getFacilityId());
        List<ComplaintDTO> complaints = fasFacilityService.findComplaintsByFacilityId(parameterObject.getFacilityId());
        facilityDto = facilityMapper.toExpandedFacilityDTO(facilityDto, facilityChildren, inspections, complaints);
    }
    return facilityDto;
}
Also used : FacilityInspectionDTO(gov.ca.cwds.cals.service.dto.FacilityInspectionDTO) FacilityInformation(gov.ca.cwds.cals.persistence.model.fas.FacilityInformation) FacilityDTO(gov.ca.cwds.cals.service.dto.FacilityDTO) FacilityChildDTO(gov.ca.cwds.cals.service.dto.FacilityChildDTO) ComplaintDTO(gov.ca.cwds.cals.service.dto.ComplaintDTO)

Aggregations

FacilityDTO (gov.ca.cwds.cals.service.dto.FacilityDTO)6 BaseCalsApiIntegrationTest (gov.ca.cwds.cals.BaseCalsApiIntegrationTest)4 Invocation (javax.ws.rs.client.Invocation)4 WebTarget (javax.ws.rs.client.WebTarget)4 Test (org.junit.Test)4 ComplaintDTO (gov.ca.cwds.cals.service.dto.ComplaintDTO)2 FacilityChildDTO (gov.ca.cwds.cals.service.dto.FacilityChildDTO)2 FacilityInspectionDTO (gov.ca.cwds.cals.service.dto.FacilityInspectionDTO)2 FacilityInformation (gov.ca.cwds.cals.persistence.model.fas.FacilityInformation)1