Handler Index¶
Quick reference for all 36 MessageBus handlers organized by function.
Quick Search¶
| Looking for... | Go to |
|---|---|
| Provider sync handlers | Sync Handlers |
| Totals calculation handlers | Calculation Handlers |
| Data import handlers | Import Handlers |
| Administrative handlers | Administrative Handlers |
| Critical system handlers | Critical Handlers |
Critical Handlers¶
These handlers are single points of failure - if they break, automation stops:
| Handler | Purpose | Impact | Location Line |
|---|---|---|---|
| MessageConsumedHandler | Executes command chains | ALL workflow chaining stops | MessageConsumedHandler.php |
| SyncProfileHandler | Routes to provider sync handlers | ALL automated syncs stop | SyncProfileHandler.php:153 |
| DispatchTotalsHandler | Routes totals calculation | ALL billing calculation stops | DispatchTotalsHandler.php |
See: Single Points of Failure →
Handlers by Category¶
Sync Handlers¶
Purpose: Sync data from external provider APIs
| Handler | Command | Provider | Complexity |
|---|---|---|---|
| KpnSp16SyncHandler | KpnSp16SyncCommand | KPN SP16 | Very High (4-cmd chain) |
| KpnSp16ImportHandler | KpnSp16ImportCommand | KPN SP16 | Medium |
| PupeteerKpnSp16SyncHandler | PupeteerKpnSp16SyncCommand | KPN SP16 | High (Puppeteer) |
| KpnGripSyncHandler | KpnGripSyncCommand | KPN GRIP | Medium |
| KpnEenSyncHandler | KpnEenSyncCommand | KPN EEN | Medium |
| KpnEenPartnerSyncHandler | KpnEenPartnerSyncCommand SyncTaskEndStateCommand |
KPN EEN | Medium (multi-cmd) |
| VodafoneSyncHandler | VodafoneSyncCommand | Vodafone | Medium |
| TMobileCalviSyncHandler | TMobileCalviSyncCommand | T-Mobile | Medium |
| TMobileSyncHandler | TMobileSyncCommand | T-Mobile | Medium |
| YielderSyncHandler | YielderSyncCommand | Yielder/Odido | Medium |
| RoutitBillingSyncHandler | RoutitBillingSyncCommand | Routit | Low |
| RoutitSyncSubscriptionsHandler | RoutitSyncSubscriptionsCommand | Routit | Medium |
| GrexxAsyncHandler | GrexxAsyncCommand | Grexx | Medium (creates chains) |
| IrmaScraperAsyncHandler | IrmaScraperAsyncCommand | IRMA | Low |
Most Complex: KpnSp16SyncHandler (~300 lines, 3 API calls, 8 DB tables)
Calculation Handlers¶
Purpose: Calculate billing totals and generate insights
| Handler | Command | Purpose | Chain |
|---|---|---|---|
| DispatchTotalsHandler | DispatchTotalsCommand | ROUTER - Routes to correct calculation handler | Yes |
| CalculateTotalsHandler | CalculateTotalsCommand | Calculate customer billing totals from CDRs | Yes |
| CalculateTotalsRateplanHandler | CalculateTotalsRateplanCommand | Calculate with rate plan logic | No |
| CalculateSubscriptionTotalsHandler | CalculateSubscriptionTotalsCommand | Calculate subscription-level totals | No |
| BillingInsightTotalsHandler | BillingInsightTotalsCommand | Generate billing insights and anomaly detection | No |
| DispatchTotalsBackupHandler | DispatchTotalsBackupCommand | Backup totals to historical table | No |
Key Handler: CalculateTotalsHandler - Calculates ALL customer billing
Performance: Handles 10k-50k CDRs per execution
Import Handlers¶
Purpose: Import and process external data
| Handler | Command | Data Type | Volume |
|---|---|---|---|
| RoutitRequestCdrsHandler | RoutitRequestCdrsCommand | Routit CDRs (request) | N/A |
| RoutitDownloadCdrsHandler | RoutitDownloadCdrsCommand | Routit CDRs (download) | 10-30 MB |
| RoutitImportCdrsHandler | RoutitImportCdrsCommand | Routit CDRs (bulk insert) | 10k-50k records |
| KpnSp16ImportHandler | KpnSp16ImportCommand | KPN SP16 data | 5k-20k records |
| CalculationImportHandler | CalculationImportCommand | API calculation import | Variable |
Most Complex: RoutitImportCdrsHandler (~250 lines, bulk insert optimization)
Data Management Handlers¶
Purpose: Generate reports, invoices, and exports
| Handler | Command | Output | Format |
|---|---|---|---|
| GenerateCustomerExcelReportHandler | GenerateCustomerExcelReportCommand | Customer usage report | Excel (.xlsx) |
| GenerateKpnSP16InvoiceHandler | GenerateKpnSP16InvoiceCommand | KPN SP16 invoice | |
| FetchPdfKpnInvoiceHandler | FetchPdfKpnInvoiceCommand | KPN invoice from API | |
| RoutitInvoiceHandler | RoutitInvoiceCommand | Routit invoice | Database record |
| FillReportsHandler | FillReportsCommand | Fill report data | Multiple |
Mobile Addon Handlers¶
Purpose: Manage Routit mobile addons
| Handler | Command | Action | API |
|---|---|---|---|
| ActivateRoutitAddonsHandler | ActivateRoutitAddonsCommand | Activate mobile addons | Routit Nina API |
| CancelRoutitAddonsHandler | CancelRoutitAddonsCommand | Cancel mobile addons | Routit Nina API |
Rate Limit: 10 requests per minute per customer
See: User Workflows →
Administrative Handlers¶
Purpose: System administration and updates
| Handler | Command | Purpose |
|---|---|---|
| SyncProfileHandler | SyncProfileCommand | MASTER ROUTER - Routes all provider syncs |
| SaveStatusHandler | SaveStatusCommand | Update sync task status |
| UpdateCostCenterHandler | UpdateCostCenterCommand | Update cost center data |
| UpdateParentOrderHandler | UpdateParentOrderCommand | Update parent order relationships |
Handlers That Create Chains¶
Handlers that dispatch additional commands:
| Handler | Dispatches | Purpose |
|---|---|---|
| SyncProfileHandler | Provider sync commands | Route to specific provider |
| KpnSp16SyncHandler | 3-command chain | Complete KPN SP16 workflow |
| DispatchTotalsHandler | Calculation commands | Route to correct totals logic |
| CalculateTotalsHandler | BillingInsightTotalsCommand | Generate insights after calculation |
| RoutitInvoiceHandler | 3-command chain | Routit billing workflow |
| VodafoneSyncHandler | 2-command chain | Vodafone complete flow |
| TMobileCalviSyncHandler | 2-command chain | T-Mobile complete flow |
| YielderSyncHandler | 3-command chain | Yielder complete flow |
| GrexxAsyncHandler | 1-2 commands | Order processing chain |
See: Workflows → for complete chain traces
Handler Statistics¶
By Complexity¶
| Complexity | Count | Examples |
|---|---|---|
| Very High | 1 | KpnSp16SyncHandler |
| High | 5 | RoutitImportCdrsHandler, PupeteerKpnSp16SyncHandler, CalculateTotalsHandler, VodafoneSyncHandler, TMobileCalviSyncHandler |
| Medium | 20 | Most sync handlers |
| Low | 10 | SaveStatusHandler, addon handlers, simple imports |
By Lines of Code¶
| Size | Lines | Count |
|---|---|---|
| Very Large | 250+ | 2 handlers |
| Large | 150-250 | 5 handlers |
| Medium | 50-150 | 20 handlers |
| Small | <50 | 9 handlers |
By External Dependencies¶
| Dependencies | Count | Examples |
|---|---|---|
| 3+ APIs | 1 | KpnSp16SyncHandler |
| 2 APIs | 3 | VodafoneSyncHandler, TMobileCalviSyncHandler |
| 1 API | 15 | Most sync handlers |
| Database only | 17 | Calculation and admin handlers |
Finding Handlers¶
By Provider¶
- KpnSp16SyncHandler
- KpnSp16ImportHandler
- PupeteerKpnSp16SyncHandler
- KpnGripSyncHandler
- KpnEenSyncHandler
- KpnEenPartnerSyncHandler
- GenerateKpnSP16InvoiceHandler
- FetchPdfKpnInvoiceHandler
- TMobileCalviSyncHandler
- TMobileSyncHandler
- VodafoneSyncHandler
- RoutitRequestCdrsHandler
- RoutitDownloadCdrsHandler
- RoutitImportCdrsHandler
- RoutitInvoiceHandler
- RoutitBillingSyncHandler
- RoutitSyncSubscriptionsHandler
- ActivateRoutitAddonsHandler
- CancelRoutitAddonsHandler
- YielderSyncHandler
- GrexxAsyncHandler
- IrmaScraperAsyncHandler
By Function¶
All handlers ending in SyncHandler (13 total)
- CalculateTotalsHandler
- CalculateTotalsRateplanHandler
- CalculateSubscriptionTotalsHandler
- BillingInsightTotalsHandler
- DispatchTotalsHandler
- DispatchTotalsBackupHandler
- KpnSp16ImportHandler
- RoutitImportCdrsHandler
- RoutitDownloadCdrsHandler
- CalculationImportHandler
- GenerateCustomerExcelReportHandler
- GenerateKpnSP16InvoiceHandler
- FillReportsHandler
- SaveStatusHandler
- UpdateCostCenterHandler
- UpdateParentOrderHandler
- SyncProfileHandler
Usage Patterns¶
Standard Handler¶
#[AsMessageHandler]
class ExampleHandler
{
public function __invoke(ExampleCommand $command): void
{
// 1. Extract data from command
$customerId = $command->getCustomerId();
// 2. Execute business logic
$result = $this->doWork($customerId);
// 3. Persist changes
$this->entityManager->flush();
// 4. Dispatch follow-up (if needed)
if ($command->hasChain()) {
foreach ($command->getChain() as $next) {
$this->commandBus->dispatch($next);
}
}
}
}
Router Handler¶
#[AsMessageHandler]
class RouterHandler
{
public function __invoke(RouterCommand $command): void
{
// Determine target
$target = $this->determineTarget($command);
// Create target command
$targetCommand = match($target) {
'typeA' => new TypeACommand(...),
'typeB' => new TypeBCommand(...),
};
// Forward with chain
if ($command->hasChain()) {
$targetCommand->withChain($command->getChain());
}
$this->commandBus->dispatch($targetCommand);
}
}
Handler Selection Guide¶
Need to sync a provider? → Use SyncProfileHandler (routes to provider-specific handler)
Need to calculate totals? → Use DispatchTotalsHandler (routes to correct calculation)
Need to import CDRs? → Provider-specific: RoutitImportCdrsHandler, KpnSp16ImportHandler
Need to generate reports? → GenerateCustomerExcelReportHandler, GenerateKpnSP16InvoiceHandler
Need to update status? → SaveStatusHandler
Related Documentation¶
- Message Handlers Details - Complete handler documentation
- Console Commands - Commands that dispatch to handlers
- Workflows - Complete execution traces
- Dependencies - Handler relationships