Search in sources :

Example 1 with ComplaintDTO

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

the class FacilityComplaintResourceTest method getFacilityComplaintTest.

@Test
public void getFacilityComplaintTest() throws Exception {
    WebTarget target = clientTestRule.target(FACILITIES + "/" + FACILITY_ID + "/" + Constants.API.COMPLAINTS + "/" + COMPLAINT_ID);
    Invocation.Builder invocation = target.request(MediaType.APPLICATION_JSON);
    ComplaintDTO complaintDTO = invocation.get(ComplaintDTO.class);
    String fixture = fixture("fixtures/facility/complaint-response.json");
    assertEqualsResponse(fixture, transformDTOtoJSON(complaintDTO));
}
Also used : Invocation(javax.ws.rs.client.Invocation) WebTarget(javax.ws.rs.client.WebTarget) ComplaintDTO(gov.ca.cwds.cals.service.dto.ComplaintDTO) Test(org.junit.Test) BaseCalsApiIntegrationTest(gov.ca.cwds.cals.BaseCalsApiIntegrationTest)

Example 2 with ComplaintDTO

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

the class FacilityService method loadFacilityFromCwsCms.

private FacilityDTO loadFacilityFromCwsCms(FacilityParameterObject parameterObject) {
    FacilityDTO facilityDto = cwsFacilityService.loadFacilityFromCwsCms(parameterObject);
    if (parameterObject.isExpanded()) {
        List<FacilityChildDTO> facilityChildren = cwsFacilityService.findFacilityChildrenByFacilityId(parameterObject.getFacilityId());
        List<FacilityInspectionDTO> inspections = fasFacilityService.findInspectionsByFacilityId(facilityDto.getLicenseNumber());
        List<ComplaintDTO> complaints = fasFacilityService.findComplaintsByFacilityId(facilityDto.getLicenseNumber());
        facilityDto = facilityMapper.toExpandedFacilityDTO(facilityDto, facilityChildren, inspections, complaints);
    }
    return facilityDto;
}
Also used : FacilityInspectionDTO(gov.ca.cwds.cals.service.dto.FacilityInspectionDTO) FacilityDTO(gov.ca.cwds.cals.service.dto.FacilityDTO) FacilityChildDTO(gov.ca.cwds.cals.service.dto.FacilityChildDTO) ComplaintDTO(gov.ca.cwds.cals.service.dto.ComplaintDTO)

Example 3 with ComplaintDTO

use of gov.ca.cwds.cals.service.dto.ComplaintDTO 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

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