feat: add cross-channel analytics system for amoCRM#630
Open
acc2git wants to merge 2 commits into
Open
Conversation
## Overview New analytics service (analytics/) with Fusio integration for end-to-end customer journey tracking. ## Components ### Models (8 files) - LeadSnapshot, Transaction, SourceAttribution, CustomerLTV - FunnelStage, BaseModel - Full toArray/fromArray/getId interface ### Repositories (9 files) - ConnectionFactory with DBAL - LeadSnapshotRepo, TransactionRepo, WebhookLogRepo - PipelineStagesRepo, SourceAttributionRepo, CustomerLTVRepo - AnalyticsEventRepo, ContactsCacheRepo ### Services (3 files) - FunnelService: pipeline stage metrics, conversion rates - AttributionService: first/last touch attribution - LTVService: customer lifetime value, cohort analysis ### Webhook Processing (9 files) - Handler with idempotency via WebhookLog - Verifier: HMAC signature verification - PayloadValidator: event type & field validation - 6 event processors for lead/customer/unsorted events ### ETL Exporters (5 files) - BaseExporter with pagination & rate limiting - LeadsExporter, EventsExporter, UnsortedExporter - ContactsExporter, CustomersExporter with CustomFieldExtractor ### Fusio API Actions (6 files) - WebhookAction: POST /webhook/amocrm - FunnelAction: GET /api/analytics/funnel - AttributionAction: GET /api/analytics/attribution - LTVAction: GET /api/analytics/ltv - OverviewAction: GET /api/analytics/overview ### CLI Commands (6 files) - etl:full, etl:incremental, etl:leads, etl:events - sync:pipelines - webhook:subscribe, webhook:status ### Database Schema - 8 tables: lead_snapshots, transactions, webhook_logs, analytics_events, source_attribution, customer_ltv, contacts_cache, pipeline_stages - Complete indexes for query performance ### Tests (5 files) - Unit tests for LeadSnapshot, FunnelStage, CustomerLTV - IdempotencyChecker, Verifier tests Co-authored-by: openhands <openhands@all-hands.dev>
### Bug Fixes - BaseExporter: Fix pagination method from nextPage() to getNextPage() - LeadSnapshotRepo: Optimize insertBatch() to use single INSERT statement ### Improvements - Verifier: Add comprehensive PHPDoc documentation - README: Complete rewrite with full documentation ### Documentation - Added webhook event handlers table - Added API query parameter examples - Added database schema documentation - Added security section (HMAC verification, timing-safe comparison) - Added performance optimization notes Co-authored-by: openhands <openhands@all-hands.dev>
Author
|
kk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
New analytics service (analytics/) with Fusio integration for end-to-end customer journey tracking.
Components
Models (8 files)
Repositories (9 files)
Services (3 files)
Webhook Processing (9 files)
ETL Exporters (5 files)
Fusio API Actions (6 files)
CLI Commands (6 files)
Database Schema
Tests (5 files)