In case of SetActions with *reset_triggers leave the balance empty

This commit is contained in:
TeoV
2020-07-17 18:01:02 +03:00
committed by Dan Christian Bogos
parent f05aaa2a0a
commit 029964e4d9
2 changed files with 8 additions and 8 deletions

View File

@@ -63,7 +63,7 @@ var (
testAccITCountAccounts,
testAccITTPFromFolder,
testAccITAddBalanceWithDestinations,
//testAccITAccountWithTriggers,
testAccITAccountWithTriggers,
testAccITStopCgrEngine,
}
)
@@ -780,7 +780,6 @@ func testAccITAddBalanceWithDestinations(t *testing.T) {
}
}
/* Uncomment this test when found a solution for SetActions
func testAccITAccountWithTriggers(t *testing.T) {
var reply string
args := &utils.AttrSetBalance{
@@ -910,8 +909,8 @@ func testAccITAccountWithTriggers(t *testing.T) {
} else {
for _, value := range acnt.BalanceMap[utils.MONETARY] {
if value.ID == "testAccITAccountWithTriggers" {
if value.GetValue() != 2 {
t.Errorf("Expecting %+v, received: %+v", 2, value.GetValue())
if value.GetValue() != 5 {
t.Errorf("Expecting %+v, received: %+v", 5, value.GetValue())
}
} else if value.ID == "CustomBanalce" {
if value.GetValue() != 5 {
@@ -922,11 +921,10 @@ func testAccITAccountWithTriggers(t *testing.T) {
if len(acnt.ActionTriggers) != 1 {
t.Errorf("Expected 1, received: %+v", len(acnt.ActionTriggers))
} else {
if acnt.ActionTriggers[0].Executed != true {
if acnt.ActionTriggers[0].Executed != false {
t.Errorf("Expected true, received: %+v", acnt.ActionTriggers[0].Executed)
}
}
}
}
*/

View File

@@ -325,7 +325,9 @@ func (apiv2 *APIerSv2) SetActions(attrs *utils.AttrSetActions, reply *string) er
ExpirationString: apiAct.ExpiryTime,
ExtraParameters: apiAct.ExtraParameters,
Filter: apiAct.Filter,
Balance: &engine.BalanceFilter{ // TODO: update this part
}
if apiAct.Identifier != utils.RESET_TRIGGERS { // add an exception for ResetTriggers
a.Balance = &engine.BalanceFilter{ // TODO: update this part
Uuid: utils.StringPointer(apiAct.BalanceUuid),
ID: utils.StringPointer(apiAct.BalanceId),
Type: utils.StringPointer(apiAct.BalanceType),
@@ -338,7 +340,7 @@ func (apiv2 *APIerSv2) SetActions(attrs *utils.AttrSetActions, reply *string) er
TimingIDs: utils.StringMapPointer(utils.ParseStringMap(apiAct.TimingTags)),
Blocker: blocker,
Disabled: disabled,
},
}
}
storeActions[idx] = a
}