diff --git a/apis/tpes_it_test.go b/apis/tpes_it_test.go index a09eabead..600a7479e 100644 --- a/apis/tpes_it_test.go +++ b/apis/tpes_it_test.go @@ -822,7 +822,7 @@ func testTPeSetActions(t *testing.T) { "*string:~*req.Account:1001"}, Weights: utils.DynamicWeights{ { - Weight: 0, + Weight: 10, }, }, Targets: map[string]utils.StringSet{utils.MetaAccounts: {"1001": {}}}, @@ -852,6 +852,11 @@ func testTPeSetActions(t *testing.T) { ActionProfile: &engine.ActionProfile{ Tenant: "cgrates.org", ID: "Execute_thd", + Weights: utils.DynamicWeights{ + { + Weight: 20, + }, + }, Actions: []*engine.APAction{ { ID: "actID", @@ -861,7 +866,6 @@ func testTPeSetActions(t *testing.T) { Targets: map[string]utils.StringSet{ utils.MetaThresholds: { "THD_1": struct{}{}, - "THD_2": struct{}{}, }, }, }, @@ -980,6 +984,8 @@ func testTPeSExportTariffPlan(t *testing.T) { }, utils.ActionsCsv: { {"#Tenant", "ID", "FilterIDs", "Weights", "Schedule", "TargetType", "TargetIDs", "ActionID", "ActionFilterIDs", "ActionBlocker", "ActionTTL", "ActionType", "ActionOpts", "ActionPath", "ActionValue"}, + {"cgrates.org", "Execute_thd", "", ";20", "", "*thresholds", "THD_1", "actID", "", "false", "0s", "*reset_threshold", "", "", ""}, + {"cgrates.org", "SET_BAL", "*string:~*req.Account:1001", ";10", "*asap", "*accounts", "1001", "SET_BAL", "", "false", "0s", "*set_balance", "", "MONETARY", "10"}, }, } expected[utils.RatesCsv] = csvRply[utils.RatesCsv] diff --git a/engine/model_helpers.go b/engine/model_helpers.go index 3b277fb8d..bc22045c3 100644 --- a/engine/model_helpers.go +++ b/engine/model_helpers.go @@ -2129,8 +2129,8 @@ func APItoModelTPActionProfile(tPrf *utils.TPActionProfile) (mdls ActionProfileM } mdl.ActionPath = actD.Path mdl.ActionValue = actD.Value - mdls = append(mdls, mdl) } + mdls = append(mdls, mdl) } return }