Rev 37227 |
Last modification |
Compare with Previous |
View Log
| RSS feed
Last modification
- Rev 37683 2026-09-17 17:53:09
- Author: amit
- Log message:
- Move the knowlarity insights pull into dao, and delete the dead earlier attempt
The pull belongs in dao because its SCHEDULE moves to profitmandi-cron while the
fofo portal still reads the same rows. Both modules depend on dao, so that is the
only place the two can share it.
KnowlarityInsightsSyncService fetches via KnowlarityApiClient (moved here from
fofo, unchanged) and upserts cs.agent_daily_insight. No DDL: every column it
writes already exists.
It writes what the old chrome scrape could not:
- the *_seconds columns. Verified on prod over 7 consecutive days, every row had
logged_in_seconds, break_seconds, available_seconds and talk_seconds = 0. The
API returns fractional seconds as numbers, so they are stored directly rather
than re-parsed out of a display string.
- calls_answered / missed_calls / total_calls, also 0 on every row, because the
scrape never captured them at all.
auth_id resolution keeps the email-PREFIX match from the fofo version: some
stored emails are truncated ('user@smartdukaan.co..'), so matching the whole
address silently misses those agents.
Redis keys are deliberately the same pair the portal reads, so its fast path
stays warm across the process boundary. ⚠ That makes AgentInsightRow's getter
names a contract with fofo's AgentInsightDTO -- rename one without the other and
the portal deserialises blanks.
Also deleted, all with zero external references:
- KnowlarityAgentInsightsService: an earlier, unfinished run at this same API.
Its ALT_INSIGHTS_APIS list of guessed endpoints is the giveaway that it never
worked; nothing ever called it. It owned three redis keys nobody read
(knowlarity:agent:insights, :summary, :lastUpdate) -- distinct from the live
knowlarity:insights:* pair, which stays.
- AgentInsightsDTO / AgentInsightsSummaryDTO: used only by that service.
- KnowlaritySocketTest: a scratch main(), never referenced.