Quick Start Guide¶
Find What You Need Fast¶
Find a specific command¶
Console Commands:
# List all commands
php bin/console list
# Search documentation
grep "command-name" docs/components/console-commands.md
Browse by category:
Understand how sync works¶
- Read: Master Sync Workflow
- See: System Architecture
- Trace: SyncProfileHandler code
Debug a failing sync¶
- Check
sync_tasktable for status - Review Common Issues
- Trace workflow in Workflows section
- Check handler logic
Add new automation¶
- Review Extension Points
- Follow existing patterns
- Add command + handler
- Update this documentation
- Run verification tests
How often does sync run?¶
Every 5 minutes via sync:manager cron job
See: Cron Jobs
What triggers totals calculation?¶
Multiple sources:
- After every provider sync
- Manual trigger from web UI
- Console command:
php bin/console totals:calculate - API endpoint calls
See: Totals Workflow
How do command chains work?¶
Commands can attach chains using withChain():
$command = new DispatchTotalsCommand($customerId, $date);
$command->withChain([
new CalculateTotalsCommand($customerId, $date),
new DispatchTotalsBackupCommand($customerId, $date)
]);
$this->commandBus->dispatch($command);
MessageConsumedHandler automatically executes the chain.
See: Chain Architecture
Where are CDRs stored?¶
Table: call_detail_record (partitioned by month)
Import process:
- Provider scraper downloads files
- Import command parses CSV/XML
- CDRs inserted into database
- Totals calculated from CDRs
See: CDR Workflow
Most Used Commands¶
| Command | Purpose | Frequency |
|---|---|---|
sync:manager |
Master orchestrator | Every 5 min |
odido:handle:queue |
Process Odido queue | Every minute |
totals:calculate |
Calculate totals | On demand |
routit:cdr:sync |
Sync Routit CDRs | Scheduled |
Critical Files¶
| File | Purpose |
|---|---|
MessageConsumedHandler.php |
Chain executor (critical!) |
SyncProfileHandler.php |
Master router |
SyncManagementService.php |
Sync orchestration |
messenger.yaml |
Command routing config |
services.yaml |
Handler bindings |
Database Tables¶
| Table | Purpose |
|---|---|
sync_task |
Sync execution tracking |
sync_profile |
Sync configuration |
call_detail_record |
CDR storage |
totals |
Billing totals |
*_import_queue |
Import job queues |
Key Directories¶
Common Tasks¶
1. Running a Sync Manually¶
# Sync specific provider
php bin/console kpn:sp16:scrape --customer=123
# Sync all active profiles
php bin/console sync:manager
# Force sync (bypass checks)
php bin/console kpn:sp16:scrape --customer=123 --force
2. Calculating Totals¶
# Calculate for specific customer/period
php bin/console totals:calculate 123 2025-01-01
# Recalculate all Calvi partners
php bin/console calculate-totals:calvi-partners 2025-01-01
3. Checking Sync Status¶
-- Check recent sync tasks
SELECT * FROM sync_task
WHERE created_at > NOW() - INTERVAL 1 HOUR
ORDER BY created_at DESC;
-- Check failed syncs
SELECT * FROM sync_task
WHERE status = 'failed'
ORDER BY created_at DESC
LIMIT 10;
4. Viewing Logs¶
# Follow application logs
tail -f var/log/prod.log
# Filter for sync errors
grep "Sync failed" var/log/prod.log
# Check Messenger worker logs
tail -f var/log/messenger.log
Learning Path¶
Beginner (Day 1)¶
- Read: Overview
- Read: Key Concepts
- Review: System Architecture
- Explore: Command Index
Intermediate (Week 1)¶
- Study: Master Sync Workflow
- Trace: Provider Workflows
- Understand: Command Chains
- Review: Dependencies
Advanced (Month 1)¶
- Deep dive: All Workflows
- Master: Dispatch Points
- Debug: Common Issues
- Extend: Add new automation following patterns
Search Tips¶
The search bar (press / to focus) supports:
- Command names:
sync:manager - Class names:
MessageConsumedHandler - Concepts:
command chaining - Error messages:
failed sync - Technical terms:
dispatch,handler,cron
Pro Tips¶
Use the Command Palette
Press Ctrl+K (or Cmd+K on Mac) to open the command palette for quick navigation
Bookmark Frequently Used Pages
Check Git History
When documentation is unclear, check the actual code:
Next Steps: