mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Add AccountS in config for LoaderS
This commit is contained in:
committed by
Dan Christian Bogos
parent
420edb52ab
commit
372662bc5a
@@ -844,6 +844,25 @@ const CGRATES_CFG_JSON = `
|
||||
{"tag": "ActionValue", "path": "ActionValue", "type": "*variable", "value": "~*req.15"},
|
||||
],
|
||||
},
|
||||
{
|
||||
"type": "*account_profiles", // data source type
|
||||
"file_name": "AccountProfiles.csv", // file name in the tp_in_dir
|
||||
"fields": [
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~*req.2"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~*req.3"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~*req.4"},
|
||||
{"tag": "BalanceID", "path": "BalanceID", "type": "*variable", "value": "~*req.5"},
|
||||
{"tag": "BalanceFilterIDs", "path": "BalanceFilterIDs", "type": "*variable", "value": "~*req.6"},
|
||||
{"tag": "BalanceWeight", "path": "BalanceWeight", "type": "*variable", "value": "~*req.7"},
|
||||
{"tag": "BalanceBlocker", "path": "BalanceBlocker", "type": "*variable", "value": "~*req.8"},
|
||||
{"tag": "BalanceType", "path": "BalanceType", "type": "*variable", "value": "~*req.9"},
|
||||
{"tag": "BalanceOpts", "path": "BalanceOpts", "type": "*variable", "value": "~*req.10"},
|
||||
{"tag": "BalanceValue", "path": "BalanceValue", "type": "*variable", "value": "~*req.11"},
|
||||
{"tag": "ThresholdIDs", "path": "ThresholdIDs", "type": "*variable", "value": "~*req.12"},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1712,6 +1712,66 @@ func TestDfLoaderJsonCfg(t *testing.T) {
|
||||
Value: utils.StringPointer("~*req.15")},
|
||||
},
|
||||
},
|
||||
{
|
||||
Type: utils.StringPointer(utils.MetaAccountProfiles),
|
||||
File_name: utils.StringPointer(utils.AccountProfilesCsv),
|
||||
Fields: &[]*FcTemplateJsonCfg{
|
||||
{Tag: utils.StringPointer(utils.Tenant),
|
||||
Path: utils.StringPointer(utils.Tenant),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~*req.0"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer(utils.ID),
|
||||
Path: utils.StringPointer(utils.ID),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~*req.1"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer("FilterIDs"),
|
||||
Path: utils.StringPointer("FilterIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~*req.2")},
|
||||
{Tag: utils.StringPointer("ActivationInterval"),
|
||||
Path: utils.StringPointer("ActivationInterval"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~*req.3")},
|
||||
{Tag: utils.StringPointer("Weight"),
|
||||
Path: utils.StringPointer("Weight"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~*req.4")},
|
||||
{Tag: utils.StringPointer("BalanceID"),
|
||||
Path: utils.StringPointer("BalanceID"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~*req.5")},
|
||||
{Tag: utils.StringPointer("BalanceFilterIDs"),
|
||||
Path: utils.StringPointer("BalanceFilterIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~*req.6")},
|
||||
{Tag: utils.StringPointer("BalanceWeight"),
|
||||
Path: utils.StringPointer("BalanceWeight"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~*req.7")},
|
||||
{Tag: utils.StringPointer("BalanceBlocker"),
|
||||
Path: utils.StringPointer("BalanceBlocker"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~*req.8")},
|
||||
{Tag: utils.StringPointer("BalanceType"),
|
||||
Path: utils.StringPointer("BalanceType"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~*req.9")},
|
||||
{Tag: utils.StringPointer("BalanceOpts"),
|
||||
Path: utils.StringPointer("BalanceOpts"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~*req.10")},
|
||||
{Tag: utils.StringPointer("BalanceValue"),
|
||||
Path: utils.StringPointer("BalanceValue"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~*req.11")},
|
||||
{Tag: utils.StringPointer("ThresholdIDs"),
|
||||
Path: utils.StringPointer("ThresholdIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~*req.12")},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -2216,6 +2216,7 @@ func TestNewLoaderWithMultiFiles(t *testing.T) {
|
||||
utils.StatsCsv: {},
|
||||
utils.ThresholdsCsv: {},
|
||||
utils.ActionProfilesCsv: {},
|
||||
utils.AccountProfilesCsv: {},
|
||||
}
|
||||
if !reflect.DeepEqual(expected, openRdrs) {
|
||||
t.Errorf("Expected %s,received %s", utils.ToJSON(expected), utils.ToJSON(openRdrs))
|
||||
|
||||
Reference in New Issue
Block a user