mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-17 14:19:54 +05:00
Fixup re-rating not using cost -1
This commit is contained in:
@@ -1423,6 +1423,17 @@ func TestExportCdrsToFile(t *testing.T) {
|
||||
*/
|
||||
}
|
||||
|
||||
func TestLocalGetCdrs(t *testing.T) {
|
||||
if !*testLocal {
|
||||
return
|
||||
}
|
||||
var reply []*utils.StoredCdr
|
||||
req := utils.AttrGetCdrs{}
|
||||
if err := rater.Call("ApierV1.GetCdrs", req, &reply); err != nil {
|
||||
t.Error("Unexpected error: ", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func TestLocalSetDC(t *testing.T) {
|
||||
if !*testLocal {
|
||||
return
|
||||
|
||||
@@ -912,6 +912,9 @@ func (self *SQLStorage) GetStoredCdrs(cgrIds, runIds, tors, cdrHosts, cdrSources
|
||||
SetupTime: setupTime.Time, AnswerTime: answerTime.Time, Duration: time.Duration(usage.Int64),
|
||||
ExtraFields: extraFieldsMp, MediationRunId: runid.String, Cost: cost.Float64,
|
||||
}
|
||||
if !cost.Valid { //There was no cost provided, will fakely insert 0 if we do not handle it and reflect on re-rating
|
||||
storCdr.Cost = -1
|
||||
}
|
||||
cdrs = append(cdrs, storCdr)
|
||||
}
|
||||
return cdrs, nil
|
||||
|
||||
Reference in New Issue
Block a user