Repositories and contributors

Repository

CarouselMatcher

Matches incoming leads with eligible salespeople.

Browse the repository archive

Archive location. Dodol/CarouselMatcher. Purpose based on README.md at 6a3368f.

What the history shows

The matcher checks project and team membership, availability, and the cooldown after a previous acceptance. It considers eligible people in routing-attempt and availability order and gives each a weighted chance. The routing simulation illustrates the underlying selection policy.

Exceptions to the weighted draw

  1. Direct assignment to a sole salesperson. With the single-candidate option enabled, pre-routing assigns the lead directly if the designated valid team has exactly one salesperson. For leads without a valid team, it checks the project roster. The assignment is recorded as soloSP.
  2. Keep related leads with the same salesperson. With preferential assignment enabled for the project, pre-routing can reuse a salesperson matched to a related lead in the current batch or a related lead’s existing assignee. The salesperson must belong to the current project and be absent from the lead’s ignore list. The assignment is recorded as SSPA.
  3. Offer immediately to the last eligible candidate. With the single-candidate option enabled, automatic routing skips the weighted draw when exactly one eligible candidate remains after validation. That candidate gets an offer. The sole-salesperson rule above operates on roster size and assigns directly.

See Dodol/CarouselMatcher, app/lib/Matcher.js at 6a3368f.

A team of one already has a destination for its leads. Waiting for that person to come online would only delay assignment. Reza’s 14 March 2022 commit 5dfe3a9 adds the direct assignment branch.

View the CarouselMatcher console output alongside the original simulator.

Development history

  1. 2019

    Start a dedicated lead matcher

    1. Match leads for mobile dispatch

      Muhammad Anwaar added the first matcher implementation. Its README describes matching a lead with a salesperson and handing the result to Presence for mobile dispatch.

      c9594d1
  2. 2020–21

    Move legacy queues and persist deferred leads

    1. Clean up legacy routing queues after migration

      Reza Rosli adjusted the migration’s Redis code and added cleanup of the legacy queues after the move.

      f105650 a926435
    2. Store deferred leads in Redis

      Reza added tenant-scoped Redis reads and writes for leads deferred by the routing worker.

      5c93cd9
  3. 2022–23

    Keep team assignments eligible during automatic routing

    1. Avoid skipping later leads assigned to a team

      Reza narrowed the worker’s skip rule so that a lead with no available match would no longer cause later team-assigned leads in the same project to be excluded.

      b630225
    2. Document the eligibility and ordering rules

      The matcher at this revision records how routing attempts, availability, solo assignment, and preferential assignment affect selection.

      6a3368f

Contributors

  • Reza Rosli

    Primary contributor · 447 authored commits

    Persisted deferred leads in Redis and kept later team-assigned leads eligible during automatic routing.

  • Muhammad Anwaar

    23 authored commits

    Added the first matcher implementation and documented its handoff to Presence for mobile dispatch.

When contributors were active

Authored commits per quarter through Q1 2023, oldest first. Rows are ordered by the first quarter with activity. Brighter cells show more commits. Scroll across to see later quarters.

Contributor2019 Q42020 Q12020 Q22020 Q32020 Q42021 Q12021 Q22021 Q32021 Q42022 Q12022 Q22022 Q32022 Q42023 Q1
Reza Rosli 447 commits · 2019 Q4–2023 Q1 14 182 21 46 35 12 21 46 39 29 0 0 1 1
Muhammad Anwaar 23 commits · 2019 Q4–2020 Q1 18 5 0 0 0 0 0 0 0 0 0 0 0 0