// web service proxy for standard account
webservices.factory('KeyValueConfigService', ['$http', 'apiConfig', 'httpCacheService', function ($http, apiConfig, httpCacheService) {
    'use strict';
    return {
        getAll: function () {
            return $http.get('/keyValueConfig', apiConfig.create());
        },
        getFinacialReference: function (id) {
            return $http.get('/keyValueConfig/getFinacialReference/'+id, apiConfig.create());
        },
        getTaxReference: function (id) {
            return $http.get('/keyValueConfig/getTaxReference/'+id, apiConfig.create());
        },
        getModelReference: function (id) {
            return $http.get('/keyValueConfig/getModelReference/'+id, apiConfig.create());
        },
        remove: function (id) {
            return $http.delete('/keyValueConfig?keyValueID=' + id, apiConfig.create());
        },
        addNewKeyValueConifg: function (newKeyValueConfig) {
            return $http.post('/keyValueConfig/add', newKeyValueConfig, apiConfig.create());
        },
        updateNewKeyValueConifg: function (updatedKeyValueConfig) {
            return $http.post('/keyValueConfig/update', updatedKeyValueConfig, apiConfig.create());
        },
        getByOrgID: function (id) {
            return $http.get('/keyValueConfig/getByOrgID/' + id, apiConfig.create());
        },
        mappingDataSource: function (formula) {
            return $http.get('/keyValueConfig/mappingDataSource/' + formula, apiConfig.create());
        },
        getAllDataSource: function () {
            return $http.get('/keyValueConfig/dataSource', apiConfig.create());
        }
    };
}]);