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));
}
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;
}
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;
}
Aggregations