SalesCandy’s routing work began before these commits. Read in order, these five changes trace how the team refined the path from an incoming enquiry to a record that other systems and managers could use.
May 2021 · Put phone enquiries into the lead form model
CandyNumber wrapped the caller’s phone number in a data object and added a version slot to the form payload. The slot was set to null. The useful change was the shared shape: a phone enquiry could carry form data in the same structure expected downstream.
CandyNumber · 74fda93
September 2021 · Give ingestion updates an order
CandyBase configured FIFO topics with content-based deduplication for lead-source updates and manual bulk-ingestion results. That gave these streams a way to preserve order within a message group and suppress duplicate publishes with identical bodies within the deduplication window. For integrations handling repeated updates, both properties matter.
CandyBase · 6de8bd9
January 2022 · Keep looking for a salesperson
CarouselMatcher had an optimisation that could skip other enquiries in a project after one had no eligible salesperson. Once leads could target different teams, the earlier result no longer applied to every lead in the project. The patch kept leads with a team assignment out of that bulk skip, so the matcher could still try their teams.
CarouselMatcher · b630225
October 2022 · Give deletions a place in the event stream
CandySync moved timestamp assignment before the early return that builds schema-v3 delete notifications for leads and lead logs. A subscriber could now receive eventAt even on that path. Its value came from the modification time, creation time, or processing time, in that order.
February 2023 · Show what a salesperson did and when a status changed
The lead exporter added separate fields for the first and last sales actions and the first and last status updates. An imported lead might already have a status before anyone contacts it. Keeping the two histories separate helps a manager interpret response-time reports without treating a status change as a customer interaction.
lead-exporter · 58f0286
Further development findings
Updated Lead Ingestion Workflow Documentation
CandyMuncher · be6e60f
The process now specifies using a dedicated Lambda function to enqueue leads.
This clarifies the initial step for submitting new leads to the system.
Firsthand source notes
Reza Rosli recalls letting developers choose project names to encourage a sense of ownership. The team drew on names connected with selling and making candy and used names that hinted at what the services did. The CandyMuncher README gives a concrete example by naming the service for taking in incoming leads.
Implementation of DynamoDB deletion logic for connection state
Presence · 346e087
The code now uses AWS SDK to delete an item from DynamoDB based on a connection ID.
This change establishes a dedicated mechanism for removing connection records from the database.
Firsthand source notes
Reza Rosli recalls that the v3 rewrite moved SalesCandy from a Node.js monolith that relied heavily on SQL stored procedures to managed and serverless services. The v3 architecture separated salesperson presence from lead intake and routing.
Updated Elasticsearch Client Usage in Ingestion Script
sugarrush-es-indexer · ea447e3
Replaced the 'request' module with the official '@elastic/elasticsearch' client.
This change modernizes the connection method for bulk data operations.
Firsthand source notes
Reza Rosli recalls that ELK was SalesCandy’s main source for looking up and analysing lead-related data. The team indexed lead-source information alongside lead records so it could use both in Kibana. Reza recalls CandyBase as the operational store and tentatively recalls Aurora. The archived LeadSource table definition in CandyBase at 522b9f9 defines a DynamoDB table, and the SugarRush library at 8603148 prepares new lead-source records for a configured DynamoDB table. The cited indexer diff shows lead-source records being written to Elasticsearch.
Removal of dedicated lead matching handler and trigger
Carousel · 73c51b2
The file containing the lead matching handler logic was entirely deleted.
This removes the dedicated serverless function responsible for lead matching processes.
Firsthand source notes
Reza Rosli recalls that the SalesCandy team initially expected to run lead matching as a serverless process. The team later found that approach unsuitable for matching and moved the work to CarouselMatcher. The Carousel revision records the removal of its matcher while keeping lead intake and offer response handlers.
Added standalone HTML view for strategy simulation
routing-simulations · b65d236
The file now includes structure for selecting algorithms and input parameters.
This allows users to test different lead distribution strategies interactively.
Firsthand source notes
Reza Rosli recalls that salespeople asked why a teammate kept receiving the next leads while they were still waiting. The SalesCandy team used the simulator to understand customer feedback about how fair that experience felt. Reza recalls wanting customers to choose a strategy and tune its parameters, with the simulator and visualizations available in Manager Portal to explain the effects. The archived standalone HTML view supports strategy selection and lets readers vary availability, rejection chance and weight. It shows results by salesperson. Reza recalls that the simulator later became one of the projects owned by the data science team, which included Azraf (an intern), Jonathan, and Muhammad Anwaar. Azraf authored the cited browser-view revision.
Added first action time to lead export data
lead-exporter · 8477c90
The code now extracts and includes the first action time in the generated CSV.
This addition provides a specific timestamp for when a lead first interacted with the system.
Firsthand source notes
Reza Rosli recalls collaborating with SalesCandy data scientist Muhammad Anwaar on data extraction, customer-facing exports and reports, and modelling. Reza recalls SageMaker and Jupyter notebook work. The cited Anwaar revision adds first-action time to lead exports. The archive retains June 2020 screenshots in a folder labelled SageMaker, and searches have yet to locate the notebooks.
VPC Configuration Added for Elastic Cloud Connectivity
smart-alert-es · 1f0fb67
The serverless configuration now specifies required VPC security groups and subnets.
This change directly connects the deployed function to the necessary private network segments.
Firsthand source notes
Reza Rosli recalls that SalesCandy used Elastic Cloud. The smart-alert-es commit describes a VPC configuration change to connect to Elastic Cloud.
Refactored Data Processing for Status Reporting
app-status-reports · 7868667
The code now parses status data into structured objects containing duration and status.
This change supports creating a flat, reconstructible format for status timeline data.
Firsthand source notes
Reza Rosli recalls that SalesCandy v2 handled the salesperson app-status report in MySQL on Amazon RDS and that the team had a lot of load to manage. He recalls that DynamoDB and compacting the daily status data helped keep the reporting load down. The team accepted less accuracy in the status timeline while continuing to work on how the visualization handled edge cases. Reza recalls that the team also needed a flat notation that could be reconstructed independently of the frontend. The archived v3 patch shows the interval encoder storing durations and status codes and computing minute totals from those runs.
Exporting Salesperson Action Report Data
manager-portal · c67a767
The export function now uses the CSV service to write the processed data.
This change correctly handles the report's data export to a shared CSV format.
Firsthand source notes
Reza Rosli recalls that the team spent substantial time defining and fixing the Salesperson Action report and its export. The Manager Portal patch by Mohd Thaqif Bin Abdullah Hasim connects the report’s download to the shared CSV writer and maps its flattened rows to translated column labels. The separate report service history records changes to definitions such as first-action time and auto-assigned leads.
Improved Redis Connection Handling
Carousel · d7577d4
The code now implements a dedicated connection function with retry logic.
This change ensures reliable connection establishment to Redis for queue operations.
Firsthand source notes
Reza Rosli recalls Redis as part of coordinating the lead-routing workflow across CandyMuncher, Presence, Carousel and CarouselMatcher. In the archived implementation, CandyMuncher sends routing commands over SQS, Carousel updates the Redis routing queues, and CarouselMatcher checks Redis for routing and availability state. The named Carousel patch improves the Redis connection handling used by these queue operations.
Integration of SonarQube Analysis into CI Pipeline
project-cpx-report · d63cc99
Added a dedicated job to run the sonar-scanner tool.
This change formally incorporated static code analysis into the build process.
Firsthand source notes
Reza Rosli recalls that SalesCandy used SonarQube Community. The project-cpx-report change records the SonarQube integration, and Reza's account identifies the edition.
The code now auto-assigns a lead if only one salesperson is found for the project or team.
This change ensures immediate lead assignment when only one salesperson is available.
Firsthand source notes
Reza Rosli recalls that waiting for the sole salesperson to become available would delay lead assignment without changing who could receive the lead. His CarouselMatcher commit adds direct assignment when the designated roster contains exactly one salesperson.