Update parameters name

This commit is contained in:
TeoV
2018-03-30 04:34:11 -04:00
committed by Dan Christian Bogos
parent b24f7f1cfd
commit 1489ebbb51
3 changed files with 6 additions and 6 deletions

View File

@@ -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))}

View File

@@ -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)
}

View File

@@ -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)}