diff --git a/apier/v1/apier_local_test.go b/apier/v1/apier_local_test.go index ee23926f9..02c9581d5 100644 --- a/apier/v1/apier_local_test.go +++ b/apier/v1/apier_local_test.go @@ -569,7 +569,7 @@ func TestApierTPActionPlan(t *testing.T) { // Check missing params if err := rater.Call("ApierV1.SetTPActionPlan", new(utils.TPActionPlan), &reply); err == nil { t.Error("Calling ApierV1.SetTPActionPlan, expected error, received: ", reply) - } else if err.Error() != "MANDATORY_IE_MISSING:[TPid Id ActionPlan]" { + } else if err.Error() != "MANDATORY_IE_MISSING:[TPid ActionPlanId ActionPlan]" { t.Error("Calling ApierV1.SetTPActionPlan got unexpected error: ", err.Error()) } // Test get diff --git a/apier/v1/tpactiontimings.go b/apier/v1/tpactionplans.go similarity index 98% rename from apier/v1/tpactiontimings.go rename to apier/v1/tpactionplans.go index dc200040e..a96f87c9d 100644 --- a/apier/v1/tpactiontimings.go +++ b/apier/v1/tpactionplans.go @@ -28,7 +28,7 @@ import ( // Creates a new ActionTimings profile within a tariff plan func (self *ApierV1) SetTPActionPlan(attrs utils.TPActionPlan, reply *string) error { - if missing := utils.MissingStructFields(&attrs, []string{"TPid", "Id", "ActionPlan"}); len(missing) != 0 { + if missing := utils.MissingStructFields(&attrs, []string{"TPid", "ActionPlanId", "ActionPlan"}); len(missing) != 0 { return fmt.Errorf("%s:%v", utils.ERR_MANDATORY_IE_MISSING, missing) } for _, at := range attrs.ActionPlan { diff --git a/data/storage/mysql/create_cdrs_tables.sql b/data/storage/mysql/create_cdrs_tables.sql index 3b6bfa9b6..ac7dc3088 100644 --- a/data/storage/mysql/create_cdrs_tables.sql +++ b/data/storage/mysql/create_cdrs_tables.sql @@ -19,9 +19,9 @@ CREATE TABLE cdrs_primary ( subject varchar(128) NOT NULL, destination varchar(128) NOT NULL, setup_time datetime NOT NULL, + pdd DECIMAL(12,9) NOT NULL, answer_time datetime NOT NULL, `usage` DECIMAL(30,9) NOT NULL, - pdd DECIMAL(12,9) NOT NULL, supplier varchar(128) NOT NULL, disconnect_cause varchar(64) NOT NULL, created_at TIMESTAMP, @@ -92,9 +92,9 @@ CREATE TABLE `rated_cdrs` ( subject varchar(128) NOT NULL, destination varchar(128) NOT NULL, setup_time datetime NOT NULL, + pdd DECIMAL(12,9) NOT NULL, answer_time datetime NOT NULL, `usage` DECIMAL(30,9) NOT NULL, - pdd DECIMAL(12,9) NOT NULL, supplier varchar(128) NOT NULL, disconnect_cause varchar(64) NOT NULL, cost DECIMAL(20,4) DEFAULT NULL, diff --git a/data/storage/postgres/create_cdrs_tables.sql b/data/storage/postgres/create_cdrs_tables.sql index ecd6960eb..40fef8aa2 100644 --- a/data/storage/postgres/create_cdrs_tables.sql +++ b/data/storage/postgres/create_cdrs_tables.sql @@ -19,9 +19,9 @@ CREATE TABLE cdrs_primary ( subject VARCHAR(128) NOT NULL, destination VARCHAR(128) NOT NULL, setup_time TIMESTAMP NOT NULL, + pdd NUMERIC(12,9) NOT NULL, answer_time TIMESTAMP NOT NULL, usage NUMERIC(30,9) NOT NULL, - pdd NUMERIC(12,9) NOT NULL, supplier VARCHAR(128) NOT NULL, disconnect_cause VARCHAR(64) NOT NULL, created_at TIMESTAMP, @@ -88,9 +88,9 @@ CREATE TABLE rated_cdrs ( subject VARCHAR(128) NOT NULL, destination VARCHAR(128) NOT NULL, setup_time TIMESTAMP NOT NULL, + pdd NUMERIC(12,9) NOT NULL, answer_time TIMESTAMP NOT NULL, usage NUMERIC(30,9) NOT NULL, - pdd NUMERIC(12,9) NOT NULL, supplier VARCHAR(128) NOT NULL, disconnect_cause VARCHAR(64) NOT NULL, cost NUMERIC(20,4) DEFAULT NULL, diff --git a/engine/models.go b/engine/models.go index 2512356ca..5d51d38c7 100644 --- a/engine/models.go +++ b/engine/models.go @@ -332,9 +332,9 @@ type TblCdrsPrimary struct { Subject string Destination string SetupTime time.Time + Pdd float64 AnswerTime time.Time Usage float64 - Pdd float64 Supplier string DisconnectCause string CreatedAt time.Time @@ -392,9 +392,9 @@ type TblRatedCdr struct { Subject string Destination string SetupTime time.Time + Pdd float64 AnswerTime time.Time Usage float64 - Pdd float64 Supplier string DisconnectCause string Cost float64