From c52b161b731d6f76a4832bb4cf331b6b37fee735 Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Tue, 18 Feb 2014 15:37:03 +0200 Subject: [PATCH] allow seetting rate subject and expiration with AddBalance api --- apier/apier.go | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/apier/apier.go b/apier/apier.go index 9d73c2c28..34725c3a6 100644 --- a/apier/apier.go +++ b/apier/apier.go @@ -22,6 +22,7 @@ import ( "errors" "fmt" "path" + "time" "github.com/cgrates/cgrates/cache2go" "github.com/cgrates/cgrates/config" @@ -81,16 +82,16 @@ func (self *ApierV1) GetUserBalance(attr *AttrGetUserBalance, reply *engine.User } type AttrAddBalance struct { - Tenant string - Account string - BalanceId string - Direction string - Value float64 - //ExpirationDate time.Time - //RateSubject string - DestinationId string - Weight float64 - Overwrite bool // When true it will reset if the balance is already there + Tenant string + Account string + BalanceId string + Direction string + Value float64 + ExpirationDate time.Time + RateSubject string + DestinationId string + Weight float64 + Overwrite bool // When true it will reset if the balance is already there } func (self *ApierV1) AddBalance(attr *AttrAddBalance, reply *string) error { @@ -122,11 +123,11 @@ func (self *ApierV1) AddBalance(attr *AttrAddBalance, reply *string) error { BalanceId: attr.BalanceId, Direction: attr.Direction, Balance: &engine.Balance{ - Value: attr.Value, - //ExpirationDate: attr.ExpirationDate, - //RateSubject: attr.RateSubject, - DestinationId: attr.DestinationId, - Weight: attr.Weight, + Value: attr.Value, + ExpirationDate: attr.ExpirationDate, + RateSubject: attr.RateSubject, + DestinationId: attr.DestinationId, + Weight: attr.Weight, }, }, }) @@ -530,8 +531,6 @@ func (self *ApierV1) GetCachedItemAge(itemId string, reply *utils.CachedItemAge) return nil } - - func (self *ApierV1) LoadTariffPlanFromFolder(attrs utils.AttrLoadTpFromFolder, reply *string) error { loader := engine.NewFileCSVReader(self.RatingDb, self.AccountDb, utils.CSV_SEP, path.Join(attrs.FolderPath, utils.DESTINATIONS_CSV),