mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-22 07:38:45 +05:00
Add maxcost functionality and continue repairing routes it test
This commit is contained in:
committed by
Dan Christian Bogos
parent
f1c07f8b0c
commit
437db2bccb
@@ -71,6 +71,9 @@ func populateCostForRoutes(ctx *context.Context, cfg *config.CGRConfig,
|
||||
if acntCost.Concretes != nil {
|
||||
cost = acntCost.Concretes
|
||||
}
|
||||
if costFloat64, _ := cost.Float64(); extraOpts.maxCost != 0 && costFloat64 > extraOpts.maxCost {
|
||||
continue
|
||||
}
|
||||
acntIDs := make([]string, 0, len(acntCost.Accounts))
|
||||
for acntID := range acntCost.Accounts {
|
||||
acntIDs = append(acntIDs, acntID)
|
||||
@@ -94,6 +97,9 @@ func populateCostForRoutes(ctx *context.Context, cfg *config.CGRConfig,
|
||||
return
|
||||
}
|
||||
cost = rpCost.Cost
|
||||
if costFloat64, _ := cost.Float64(); extraOpts.maxCost != 0 && costFloat64 > extraOpts.maxCost {
|
||||
continue
|
||||
}
|
||||
srtRoute.SortingData[utils.RatingPlanID] = rpCost.ID
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user