Skip to content

Instantly share code, notes, and snippets.

@kru
Last active February 13, 2021 04:36
Show Gist options
  • Save kru/d4155a8d1562a0334d646d8c10575f20 to your computer and use it in GitHub Desktop.
Save kru/d4155a8d1562a0334d646d8c10575f20 to your computer and use it in GitHub Desktop.

Overview

In a company named TW, There is a team consist of 4 members and a leader, we can named this team Eagle team. The following are Eagle team members:

  1. Nicole (team leader)
  2. Irene (member)
  3. Michael (member)
  4. Dan (member)
  5. Kal (member)

In the work day, Nicole always submitting around 10 contacts toward the team, a contact is a potential buyer of company product. Each contact has the following information in them:

  • Name
  • Email
  • Phone

Nicole offered these contacts one by one to each team member randomly. But, the agent will never offered a same contact.

Each Eagle team team member should reach out a contact they assigned to, whether it by email or phone.

Bussiness Requirements:

  1. Create an endpoint to receive contact information and save them to the Database that only can be used by Nicole
  2. Each contact should be unique by email address
  3. Create a worker/cronjob that can offer a new contact to a team member, that system should follow these rules
  • System choose the team member randomly
  • Only a contact for a team member at given time (unique)

Note:

  • Ideally, we can send a notification whenever a system has choosen the agent, but, for simplicity we can stub out that by doing a mock API call to other system.

System Requirements:

  • Mysql
  • Node JS with Typescript
  • Other JS libraries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment