mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Merge branch 'master' of https://github.com/cgrates/cgrates
This commit is contained in:
@@ -19,6 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package engine
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
@@ -39,6 +41,12 @@ func (hcs *HightCostSorter) SortSuppliers(prflID string, suppls []*Supplier,
|
||||
Sorting: hcs.sorting,
|
||||
SortedSuppliers: make([]*SortedSupplier, 0)}
|
||||
for _, s := range suppls {
|
||||
if len(s.RatingPlanIDs) == 0 {
|
||||
utils.Logger.Warning(
|
||||
fmt.Sprintf("<%s> RatingPlanIDs is empty for suplier with ID: %s",
|
||||
utils.SupplierS, s.ID))
|
||||
return nil, utils.NewErrMandatoryIeMissing("RatingPlanIDs")
|
||||
}
|
||||
if srtSpl, pass, err := hcs.spS.populateSortingData(ev, s, extraOpts); err != nil {
|
||||
return nil, err
|
||||
} else if pass && srtSpl != nil {
|
||||
|
||||
@@ -19,6 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package engine
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
@@ -39,6 +41,12 @@ func (lcs *LeastCostSorter) SortSuppliers(prflID string, suppls []*Supplier,
|
||||
Sorting: lcs.sorting,
|
||||
SortedSuppliers: make([]*SortedSupplier, 0)}
|
||||
for _, s := range suppls {
|
||||
if len(s.RatingPlanIDs) == 0 {
|
||||
utils.Logger.Warning(
|
||||
fmt.Sprintf("<%s> RatingPlanIDs is empty for suplier with ID: %s",
|
||||
utils.SupplierS, s.ID))
|
||||
return nil, utils.NewErrMandatoryIeMissing("RatingPlanIDs")
|
||||
}
|
||||
if srtSpl, pass, err := lcs.spS.populateSortingData(ev, s, extraOpts); err != nil {
|
||||
return nil, err
|
||||
} else if pass && srtSpl != nil {
|
||||
|
||||
Reference in New Issue
Block a user