mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-25 00:58:45 +05:00
Add FilterProfile + test for it
This commit is contained in:
@@ -471,6 +471,25 @@ CREATE TABLE tp_thresholds (
|
||||
UNIQUE KEY `unique_tp_thresholds` (`tpid`,`tenant`, `id`, `filter_type`, `filter_field_name`)
|
||||
);
|
||||
|
||||
--
|
||||
-- Table structure for table `tp_filter`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS tp_filters;
|
||||
CREATE TABLE tp_filters (
|
||||
`pk` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`tpid` varchar(64) NOT NULL,
|
||||
`tenant` varchar(64) NOT NULL,
|
||||
`id` varchar(64) NOT NULL,
|
||||
`filter_type` varchar(16) NOT NULL,
|
||||
`filter_field_name` varchar(64) NOT NULL,
|
||||
`filter_field_values` varchar(256) NOT NULL,
|
||||
`created_at` TIMESTAMP,
|
||||
PRIMARY KEY (`pk`),
|
||||
KEY `tpid` (`tpid`),
|
||||
UNIQUE KEY `unique_tp_filters` (`tpid`,`tenant`, `id`, `filter_type`, `filter_field_name`)
|
||||
);
|
||||
|
||||
--
|
||||
-- Table structure for table `versions`
|
||||
--
|
||||
|
||||
@@ -465,6 +465,25 @@ CREATE TABLE tp_thresholds (
|
||||
CREATE INDEX tp_thresholds_idx ON tp_thresholds (tpid);
|
||||
CREATE INDEX tp_thresholds_unique ON tp_thresholds ("tpid","tenant", "id", "filter_type", "filter_field_name");
|
||||
|
||||
--
|
||||
-- Table structure for table `tp_filter`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS tp_filters;
|
||||
CREATE TABLE tp_filters (
|
||||
"pk" SERIAL PRIMARY KEY,
|
||||
"tpid" varchar(64) NOT NULL,
|
||||
"tenant" varchar(64) NOT NULL,
|
||||
"id" varchar(64) NOT NULL,
|
||||
"filter_type" varchar(16) NOT NULL,
|
||||
"filter_field_name" varchar(64) NOT NULL,
|
||||
"filter_field_values" varchar(256) NOT NULL,
|
||||
"created_at" TIMESTAMP WITH TIME ZONE
|
||||
);
|
||||
CREATE INDEX tp_filters_idx ON tp_filters (tpid);
|
||||
CREATE INDEX tp_filters_unique ON tp_filters ("tpid","tenant", "id", "filter_type", "filter_field_name");
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Table structure for table `versions`
|
||||
|
||||
7
data/tariffplans/testtp/Filters.csv
Normal file
7
data/tariffplans/testtp/Filters.csv
Normal file
@@ -0,0 +1,7 @@
|
||||
#Tenant[0],ID[1],FilterType[2],FilterFieldName[3],FilterFieldValues[4]
|
||||
cgrates.org,FLTR_1,*string,Account,1001;1002
|
||||
cgrates.org,FLTR_1,*string_prefix,Destination,10;20
|
||||
cgrates.org,FLTR_1,*rsr_fields,,Subject(~^1.*1$);Destination(1002)
|
||||
cgrates.org,FLTR_ACNT_dan,*string,Account,dan
|
||||
cgrates.org,FLTR_DST_DE,*destinations,Destination,DST_DE
|
||||
cgrates.org,FLTR_DST_NL,*destinations,Destination,DST_NL
|
||||
|
7
data/tariffplans/tutorial/Filters.csv
Normal file
7
data/tariffplans/tutorial/Filters.csv
Normal file
@@ -0,0 +1,7 @@
|
||||
#Tenant[0],ID[1],FilterType[2],FilterFieldName[3],FilterFieldValues[4]
|
||||
cgrates.org,FLTR_1,*string,Account,1001;1002
|
||||
cgrates.org,FLTR_1,*string_prefix,Destination,10;20
|
||||
cgrates.org,FLTR_1,*rsr_fields,,Subject(~^1.*1$);Destination(1002)
|
||||
cgrates.org,FLTR_ACNT_dan,*string,Account,dan
|
||||
cgrates.org,FLTR_DST_DE,*destinations,Destination,DST_DE
|
||||
cgrates.org,FLTR_DST_NL,*destinations,Destination,DST_NL
|
||||
|
Reference in New Issue
Block a user