FreshSales CRM Sync
Business perspective: FreshSales CRM Sync
1. Business Summary
Imports FreshSales CRM data (owners, accounts, deals/opportunities, contacts, leads, campaigns, activities) via REST APIs into local mirror tables — full replace.
2. Business Value
Provides centralized CRM datapoint for reporting.
3. Users / Stakeholders
Sales ops, executives.
4. Workflows
getFreshSalesData()truncates target tables, then runs:getOwners()→selector/owners.getAccounts(),getTerritories(),getCampaigns().- Per owner:
getOpportunities(),getActivities(). getContacts(),FreshSalesLead().- Custom fields flattened into local rows.
- Datetime normalization for various fields.
5. Sub-Features
- Pagination per entity.
- Custom field mapping (e.g., cf_brand_1_last_sale_date).
- Data normalization.
6. Business Rules
- Full replace (TRUNCATE) is destructive.
- Token in code:
JzGsLSRqLVTg2akBpPrujA.
7. Data Entities
FreshSales* models (Account, Activity, BusinessType, Campaign, Contact, ContactStatus, Currency, DealPaymentStatus, Deal, DealPipeline, DealProduct, DealReason, DealStage, DealType, Email, IndustryType, Lead, LeadReason, LeadSource, LeadStage, Owner, PhoneNumber, SalesActivityEntityType, SalesActivityType, SalesSalesActivityOutcome, Territory, User).
8. Entry Points
fresh_sales/*actions / cron.
9. Inputs & Outputs
- Inputs: FreshSales API.
- Outputs: local mirror tables.
10. Integrations
- FreshSales REST API.
11. Calculations / Logic
- None financial.
12. Status Lifecycle
- N/A (sync replace).
13. Permissions
- Internal cron.
14. Reports & KPIs
- Sync run status.
15. Risks & Observations
- Hard-coded token.
- Destructive sync without backup/diff.
- No incremental sync.
16. Source Code Evidence
app/Controller/FreshSalesController.php(~614 LOC).app/Model/FreshSales*.php.