mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Update parameters name
This commit is contained in:
committed by
Dan Christian Bogos
parent
b24f7f1cfd
commit
1489ebbb51
@@ -108,12 +108,12 @@ func NewSupplierSortDispatcher(lcrS *SupplierService) (ssd SupplierSortDispatche
|
||||
type SupplierSortDispatcher map[string]SuppliersSorter
|
||||
|
||||
func (ssd SupplierSortDispatcher) SortSuppliers(prflID, strategy string,
|
||||
suppls []*Supplier, suplEv *utils.CGREvent, extraFields *extraOptions) (sortedSuppls *SortedSuppliers, err error) {
|
||||
suppls []*Supplier, suplEv *utils.CGREvent, extraFilters *extraOptions) (sortedSuppls *SortedSuppliers, err error) {
|
||||
sd, has := ssd[strategy]
|
||||
if !has {
|
||||
return nil, fmt.Errorf("unsupported sorting strategy: %s", strategy)
|
||||
}
|
||||
return sd.SortSuppliers(prflID, suppls, suplEv, extraFields)
|
||||
return sd.SortSuppliers(prflID, suppls, suplEv, extraFilters)
|
||||
}
|
||||
|
||||
func NewWeightSorter() *WeightSorter {
|
||||
@@ -126,7 +126,7 @@ type WeightSorter struct {
|
||||
}
|
||||
|
||||
func (ws *WeightSorter) SortSuppliers(prflID string,
|
||||
suppls []*Supplier, suplEv *utils.CGREvent, extraFields *extraOptions) (sortedSuppls *SortedSuppliers, err error) {
|
||||
suppls []*Supplier, suplEv *utils.CGREvent, extraFilters *extraOptions) (sortedSuppls *SortedSuppliers, err error) {
|
||||
sortedSuppls = &SortedSuppliers{ProfileID: prflID,
|
||||
Sorting: ws.sorting,
|
||||
SortedSuppliers: make([]*SortedSupplier, len(suppls))}
|
||||
|
||||
@@ -137,7 +137,7 @@ func TestLibSuppliersSortWeight(t *testing.T) {
|
||||
Event: make(map[string]interface{}),
|
||||
}
|
||||
ws := NewWeightSorter()
|
||||
result, err := ws.SortSuppliers("SPL_WEIGHT_1", spl, se)
|
||||
result, err := ws.SortSuppliers("SPL_WEIGHT_1", spl, se, nil)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ type extraOptions struct {
|
||||
ignoreErrors bool
|
||||
}
|
||||
|
||||
func (lcs *LeastCostSorter) SortSuppliers(prflID string,
|
||||
suppls []*Supplier, ev *utils.CGREvent, extraFilters *extraOptions) (sortedSuppls *SortedSuppliers, err error) {
|
||||
func (lcs *LeastCostSorter) SortSuppliers(prflID string, suppls []*Supplier,
|
||||
ev *utils.CGREvent, extraFilters *extraOptions) (sortedSuppls *SortedSuppliers, err error) {
|
||||
sortedSuppls = &SortedSuppliers{ProfileID: prflID,
|
||||
Sorting: lcs.sorting,
|
||||
SortedSuppliers: make([]*SortedSupplier, 0)}
|
||||
|
||||
Reference in New Issue
Block a user