Modified order of fields in stordb to include pdd after setuptime, small apier test fixes

This commit is contained in:
DanB
2015-06-08 12:31:26 +02:00
parent 5bfb6da295
commit 05a522a64c
5 changed files with 8 additions and 8 deletions

View File

@@ -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

View File

@@ -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 {

View File

@@ -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,

View File

@@ -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,

View File

@@ -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