Skip to content

Commit

Permalink
fix: consider minimum CS score
Browse files Browse the repository at this point in the history
  • Loading branch information
Markkop committed Mar 23, 2021
1 parent 22aa00e commit 1128b77
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ruby/customer_success_balancing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ def execute
css_ordered_by_score = @customer_success.sort { |a,b| a[:score] <=> b[:score] }

already_matched_customers = []
css_with_customers = css_ordered_by_score.reduce([]) do |css, cs|
css_with_customers = css_ordered_by_score.reduce([]) do |css, cs|
next css if cs[:score] <= 0

is_cs_available = @customer_success_away.none? { |cs_away| cs[:id] == cs_away }
next css if !is_cs_available

Expand Down

0 comments on commit 1128b77

Please sign in to comment.