<?php
declare(strict_types=1);

use App\Core\EventBus;
use App\Core\Logger;

// Waiver auto-complete is handled by cron (WaiverAutoCompleteJob)
// to avoid blocking the cashier HTTP response with 30-50 DB queries.
EventBus::listen('waiver.fee_paid', function (array $data): void {
    $waiverId = (int) ($data['waiver_id'] ?? 0);
    if ($waiverId > 0) {
        Logger::info("Waiver #{$waiverId} fee paid — queued for cron auto-complete");
    }
});
