mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-14 12:49:54 +05:00
Add *set_balance in supported actions for cdrlog
This commit is contained in:
@@ -49,7 +49,7 @@ var (
|
||||
testAccITAddVoiceBalance,
|
||||
testAccITDebitBalance,
|
||||
testAccITAddBalance,
|
||||
// testAccITSetBalance,
|
||||
testAccITSetBalance,
|
||||
testAccITStopCgrEngine,
|
||||
}
|
||||
)
|
||||
@@ -199,7 +199,7 @@ func testAccITAddBalance(t *testing.T) {
|
||||
func testAccITSetBalance(t *testing.T) {
|
||||
var reply string
|
||||
attrs := &AttrAddBalance{Tenant: "cgrates.org", Account: "testAccSetBalance",
|
||||
BalanceUuid: utils.StringPointer(utils.GenUUID()),
|
||||
BalanceId: utils.StringPointer("testAccSetBalance"),
|
||||
BalanceType: "*monetary", Value: 1.5, Cdrlog: utils.BoolPointer(true)}
|
||||
if err := accRPC.Call("ApierV1.SetBalance", attrs, &reply); err != nil {
|
||||
t.Error("Got error on ApierV1.SetBalance: ", err.Error())
|
||||
|
||||
@@ -71,6 +71,9 @@
|
||||
|
||||
"scheduler": {
|
||||
"enabled": true,
|
||||
"cdrs_conns": [
|
||||
{"address": "127.0.0.1:2012", "transport":"*json"},
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ func cdrLogAction(acc *Account, a *Action, acs Actions, extraData interface{}) (
|
||||
// set stored cdr values
|
||||
var cdrs []*CDR
|
||||
for _, action := range acs {
|
||||
if !utils.IsSliceMember([]string{DEBIT, DEBIT_RESET, TOPUP, TOPUP_RESET}, action.ActionType) ||
|
||||
if !utils.IsSliceMember([]string{DEBIT, DEBIT_RESET, TOPUP, TOPUP_RESET, SET_BALANCE}, action.ActionType) ||
|
||||
action.Balance == nil {
|
||||
continue // Only log specific actions
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user