Search in sources :

Example 1 with FacilityComplaintParameterObject

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

the class ComplaintService method find.

@Override
public Response find(Serializable parametersObject) {
    FacilityComplaintParameterObject parameterObject;
    if (parametersObject instanceof FacilityComplaintParameterObject) {
        parameterObject = (FacilityComplaintParameterObject) parametersObject;
        ComplaintReportLic802 complaintReportLic802 = null;
        if (StringUtils.isNumeric(parameterObject.getFacilityId())) {
            complaintReportLic802 = complaintReportLic802Dao.findComplaintByFacilityIdAndComplaintId(parameterObject.getFacilityId(), parameterObject.getComplaintId());
        }
        if (complaintReportLic802 == null) {
            throw new ExpectedException(Constants.ExpectedExceptionMessages.COMPLAINT_NOT_FOUND_BY_ID, NOT_FOUND);
        } else {
            return complaintMapper.entityToDTO(complaintReportLic802);
        }
    }
    throw new IllegalStateException("FacilityComplaintParameterObject is expected here");
}
Also used : FacilityComplaintParameterObject(gov.ca.cwds.cals.web.rest.parameter.FacilityComplaintParameterObject) ExpectedException(gov.ca.cwds.rest.exception.ExpectedException) ComplaintReportLic802(gov.ca.cwds.cals.persistence.model.fas.ComplaintReportLic802)

Aggregations

ComplaintReportLic802 (gov.ca.cwds.cals.persistence.model.fas.ComplaintReportLic802)1 FacilityComplaintParameterObject (gov.ca.cwds.cals.web.rest.parameter.FacilityComplaintParameterObject)1 ExpectedException (gov.ca.cwds.rest.exception.ExpectedException)1