From 019a3cbb57838ebcfc7aac26f90452d495e48afc Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Mon, 22 Feb 2016 17:34:23 +0200 Subject: [PATCH] fixed SetBalance api also removed balance enabled/disabled console command --- apier/v1/accounts.go | 2 +- console/balance_enabledisable.go | 65 -------------------------------- 2 files changed, 1 insertion(+), 66 deletions(-) delete mode 100644 console/balance_enabledisable.go diff --git a/apier/v1/accounts.go b/apier/v1/accounts.go index d6273b517..1e34a1aad 100644 --- a/apier/v1/accounts.go +++ b/apier/v1/accounts.go @@ -464,7 +464,7 @@ type AttrSetBalance struct { Disabled *bool } -func (self *ApierV1) SetBalance(aType string, attr *AttrSetBalance, reply *string) error { +func (self *ApierV1) SetBalance(attr *AttrSetBalance, reply *string) error { if missing := utils.MissingStructFields(attr, []string{"Tenant", "Account", "BalanceType"}); len(missing) != 0 { return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/console/balance_enabledisable.go b/console/balance_enabledisable.go deleted file mode 100644 index 975d19ae7..000000000 --- a/console/balance_enabledisable.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -Rating system designed to be used in VoIP Carriers World -Copyright (C) 2012-2015 ITsysCOM - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see -*/ - -package console - -import ( - "github.com/cgrates/cgrates/apier/v1" - "github.com/cgrates/cgrates/utils" -) - -func init() { - c := &CmdEnableDisableBalance{ - name: "balance_enabledisable", - rpcMethod: "ApierV1.EnableDisableBalance", - } - commands[c.Name()] = c - c.CommandExecuter = &CommandExecuter{c} -} - -// Commander implementation -type CmdEnableDisableBalance struct { - name string - rpcMethod string - rpcParams *v1.AttrAddBalance - *CommandExecuter -} - -func (self *CmdEnableDisableBalance) Name() string { - return self.name -} - -func (self *CmdEnableDisableBalance) RpcMethod() string { - return self.rpcMethod -} - -func (self *CmdEnableDisableBalance) RpcParams(reset bool) interface{} { - if reset || self.rpcParams == nil { - self.rpcParams = &v1.AttrAddBalance{BalanceType: utils.MONETARY, Overwrite: false} - } - return self.rpcParams -} - -func (self *CmdEnableDisableBalance) PostprocessRpcParams() error { - return nil -} - -func (self *CmdEnableDisableBalance) RpcResult() interface{} { - var s string - return &s -}