Repository
sugarrush-es-indexer
Lets SalesCandy find configured lead sources, such as website forms, by project, name, status, or type.
What it does
A lead source is a configured way enquiries enter SalesCandy, such as a website form connected through CandyPixel. When a manager looks up which sources feed a project, this service supplies the searchable list through the customer API. Each entry describes the source and its project associations. The enquiries themselves go through the lead processing system.
-
SugarRush announces changes. When a lead source is created, edited, or deleted, SugarRush sends an SNS notification. The indexer uses those events to keep a searchable copy in Elasticsearch.
README.mdat15bf7f8 -
The customer API looks up sources. Its AppSync data source calls the indexer’s query function. Searches support filters such as name, status, project, and source type.
dataSources/leadSources.ymlinDodol/customer-api-appsyncatd1778a0 -
The query checks current project data. If a deleted project is still attached to a source in the index, a search for that project could return a stale match. The January 2022 change checks CandyBase, excludes the stale match from project-filtered results, and attempts to refresh the stored entry when it detects changed project associations.
app/query.jsat01d1b64
How the stores worked together
CandyBase held the operational lead-source records. The archived CandyBase configuration defines a DynamoDB LeadSource table, and the SugarRush library prepares new source records for a DynamoDB table. dynamoDBLeadSource/serverless.yml in Dodol/CandyBase at 522b9f9
SugarRushFactory/DataProcessor/LeadSourceCreate.js in SugarRush/library at 8603148
ELK was the main source for lead search and analysis. We indexed lead-source information alongside lead records so the team could explore both in Kibana. The archived ingestion code shows the separate Elasticsearch copy being written. app/ingest.js at ea447e3
Archive location. SugarRush/sugarrush-es-indexer.
Development history
-
2019
-
2022
Keep indexed project information current
-
Refresh lead-source entries when project data changes
Reza Rosli added a workflow that compares associated project data with the indexed entry and refreshes the entry when it detects a mismatch.
01d1b64
-
Contributors
-
Lim Shi Yek
Primary contributor · 36 authored commits
Built the initial ingestion and query scaffold and separated lead-source indexing queues by deployment stage.
-
Reza Rosli
34 authored commits
Made the query check CandyBase for current project data and refresh stale lead-source index entries.
-
Ele Elyiana
23 authored commits
Adjusted the search query so source type and import status filters match exact values.
-
Muhammad Anwaar
8 authored commits
Added a query filter that uses the project IDs supplied with the manager’s permissions.
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.
| Contributor | 2019 Q2 | 2019 Q3 | 2019 Q4 | 2020 Q1 | 2020 Q2 | 2020 Q3 | 2020 Q4 | 2021 Q1 | 2021 Q2 | 2021 Q3 | 2021 Q4 | 2022 Q1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Lim Shi Yek 36 commits · 2019 Q2–2020 Q1 | 12 | 17 | 6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Reza Rosli 34 commits · 2019 Q2–2022 Q1 | 3 | 0 | 1 | 1 | 0 | 2 | 10 | 0 | 0 | 0 | 2 | 15 |
| Ele Elyiana 23 commits · 2020 Q1–2021 Q3 | 0 | 0 | 0 | 4 | 4 | 0 | 1 | 10 | 0 | 4 | 0 | 0 |
| Muhammad Anwaar 8 commits · 2020 Q1 | 0 | 0 | 0 | 8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |