mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
loader db updates for rounding stuf movement
This commit is contained in:
@@ -47,8 +47,6 @@ CREATE TABLE `tp_rates` (
|
||||
`rate_unit` varchar(16) NOT NULL,
|
||||
`rate_increment` varchar(16) NOT NULL,
|
||||
`group_interval_start` varchar(16) NOT NULL,
|
||||
`rounding_method` varchar(255) NOT NULL,
|
||||
`rounding_decimals` tinyint(4) NOT NULL,
|
||||
PRIMARY KEY (`tbid`),
|
||||
UNIQUE KEY `unique_tprate` (`tpid`,`id`,`group_interval_start`),
|
||||
KEY `tpid` (`tpid`),
|
||||
@@ -66,6 +64,8 @@ CREATE TABLE `tp_destination_rates` (
|
||||
`id` varchar(64) NOT NULL,
|
||||
`destinations_id` varchar(64) NOT NULL,
|
||||
`rates_id` varchar(64) NOT NULL,
|
||||
`rounding_method` varchar(255) NOT NULL,
|
||||
`rounding_decimals` tinyint(4) NOT NULL,
|
||||
PRIMARY KEY (`tbid`),
|
||||
KEY `tpid` (`tpid`),
|
||||
KEY `tpid_drid` (`tpid`,`id`),
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#Tag,DestinationsTag,RatesTag
|
||||
DR_RETAIL,GERMANY,RT_1CENT
|
||||
DR_RETAIL,GERMANY_MOBILE,RT_1CENT
|
||||
DR_RETAIL,GERMANY,RT_1CENT,*up,2
|
||||
DR_RETAIL,GERMANY_MOBILE,RT_1CENT,*up,2
|
||||
|
||||
|
@@ -1,2 +1,2 @@
|
||||
#Tag,ConnectFee,Rate,RateUnit,RateIncrement,GroupIntervalStart,RoundingMethod,RoundingDecimals
|
||||
RT_1CENT,0,1,1s,1s,0s,*up,2
|
||||
RT_1CENT,0,1,1s,1s,0s
|
||||
|
||||
|
@@ -943,8 +943,9 @@ func (self *SQLStorage) GetTpDestinationRates(tpid, tag string) (map[string]*uti
|
||||
defer rows.Close()
|
||||
for rows.Next() {
|
||||
var id int
|
||||
var tpid, tag, destinations_tag, rate_tag string
|
||||
if err := rows.Scan(&id, &tpid, &tag, &destinations_tag, &rate_tag); err != nil {
|
||||
var tpid, tag, destinations_tag, rate_tag, rounding_method string
|
||||
var rounding_decimals int
|
||||
if err := rows.Scan(&id, &tpid, &tag, &destinations_tag, &rate_tag, &rounding_method, &rounding_decimals); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -953,8 +954,10 @@ func (self *SQLStorage) GetTpDestinationRates(tpid, tag string) (map[string]*uti
|
||||
DestinationRateId: tag,
|
||||
DestinationRates: []*utils.DestinationRate{
|
||||
&utils.DestinationRate{
|
||||
DestinationId: destinations_tag,
|
||||
RateId: rate_tag,
|
||||
DestinationId: destinations_tag,
|
||||
RateId: rate_tag,
|
||||
RoundingMethod: rounding_method,
|
||||
RoundingDecimals: rounding_decimals,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user