mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-12 02:26:26 +05:00
Rename filter "*accounts" to "*account"
This commit is contained in:
committed by
Dan Christian Bogos
parent
118461c1f7
commit
88dc208841
@@ -166,7 +166,7 @@ func (fS *FilterS) Pass(tenant string, filterIDs []string,
|
||||
conn = fS.statSConns
|
||||
case MetaResources, MetaNotResources:
|
||||
conn = fS.resSConns
|
||||
case utils.MetaAccounts:
|
||||
case utils.MetaAccount:
|
||||
conn = fS.ralSConns
|
||||
}
|
||||
if pass, err = fltr.Pass(ev, conn, tenant); err != nil || !pass {
|
||||
@@ -230,7 +230,7 @@ func NewFilterRule(rfType, fieldName string, vals []string) (*FilterRule, error)
|
||||
if !utils.IsSliceMember([]string{MetaString, MetaPrefix, MetaSuffix,
|
||||
MetaTimings, MetaRSR, MetaStatS, MetaDestinations, MetaEmpty,
|
||||
MetaExists, MetaLessThan, MetaLessOrEqual, MetaGreaterThan,
|
||||
MetaGreaterOrEqual, MetaResources, MetaEqual, MetaNotEqual}, rType) {
|
||||
MetaGreaterOrEqual, MetaResources, MetaEqual, utils.MetaAccount, MetaNotEqual}, rType) {
|
||||
return nil, fmt.Errorf("Unsupported filter Type: %s", rfType)
|
||||
}
|
||||
if fieldName == "" && utils.IsSliceMember([]string{MetaString, MetaPrefix, MetaSuffix,
|
||||
@@ -318,7 +318,7 @@ func (rf *FilterRule) CompileValues() (err error) {
|
||||
FilterValue: valSplt[2],
|
||||
}
|
||||
}
|
||||
case utils.MetaAccounts:
|
||||
case utils.MetaAccount:
|
||||
//value for filter of type *accounts needs to be in the following form:
|
||||
//*gt:AccountID:ValueOfUsage
|
||||
rf.accountItems = make([]*itemFilter, len(rf.Values))
|
||||
@@ -372,7 +372,7 @@ func (fltr *FilterRule) Pass(dP config.DataProvider,
|
||||
result, err = fltr.passResourceS(dP, rpcClnt, tenant)
|
||||
case MetaEqual, MetaNotEqual:
|
||||
result, err = fltr.passEqualTo(dP)
|
||||
case utils.MetaAccounts:
|
||||
case utils.MetaAccount:
|
||||
result, err = fltr.passAccountS(dP, rpcClnt, tenant)
|
||||
default:
|
||||
err = utils.ErrPrefixNotErrNotImplemented(fltr.Type)
|
||||
|
||||
@@ -526,7 +526,7 @@ func testV1FltrAccounts(t *testing.T) {
|
||||
ID: "FLTR_TH_Accounts",
|
||||
Rules: []*engine.FilterRule{
|
||||
{
|
||||
Type: "*accounts",
|
||||
Type: "*account",
|
||||
Values: []string{"*gt:1001.BalanceMap.*monetary[0].Value:9"},
|
||||
},
|
||||
},
|
||||
@@ -588,7 +588,7 @@ func testV1FltrAccounts(t *testing.T) {
|
||||
ID: "FLTR_TH_Accounts",
|
||||
Rules: []*engine.FilterRule{
|
||||
{
|
||||
Type: "*accounts",
|
||||
Type: "*account",
|
||||
Values: []string{"*gt:1001.BalanceMap.*monetary[0].Value:11"},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -618,6 +618,7 @@ const (
|
||||
MetaInit = "*init"
|
||||
MetaRatingPlanCost = "*rating_plan_cost"
|
||||
RatingPlanIDs = "RatingPlanIDs"
|
||||
MetaAccount = "*account"
|
||||
)
|
||||
|
||||
// Migrator Action
|
||||
|
||||
Reference in New Issue
Block a user