webservices.factory('checkListService', ['$http', 'apiConfig', function ($http, apiConfig) {
    'use strict';

    return {
        getCheckListViewData: function (serviceTypeID, reportType, period) {
            var data = {
                "serviceTypeID": serviceTypeID,
                "reportType": reportType,
                "period": period
            };
            data = _.pairs(data).map(function (x) { return x.join("="); }).join("&");
            return $http.get('/checkList/getCheckListViewData?' + data, apiConfig.createVat());
        },
        addReportComment: function (reportId, content) {
            var data = {
                "reportId": reportId,
                "content": content
            };
            return $http.post('/checkList/addReportComment', data, apiConfig.createVat());
        },
        addReportModifyLog: function (reportId, content) {
            var data = {
                "reportId": reportId,
                "content": content
            };
            return $http.post('/checkList/addReportModifyLog', data, apiConfig.createVat());
        },
        removeReportComment: function (commentId) {
            return $http.delete('/checkList/removeReportComment?commentId=' + commentId, apiConfig.createVat());
        }
    };
}]);