New_Micro_Learning/backend/app/Modules/Capability/Application/RecalculateCapability.php

19 خطوط
533 B
PHP

<?php
namespace App\Modules\Capability\Application;
use App\Modules\Evidence\Domain\Events\AssessmentEvidenceCreated;
use Illuminate\Contracts\Queue\ShouldQueue;
final class RecalculateCapability implements ShouldQueue
{
public string $queue = 'analytics';
public function __construct(private readonly CapabilityScoreEngine $engine) {}
public function handle(AssessmentEvidenceCreated $event): void
{
$this->engine->recalculate($event->organizationId, $event->learnerId, $event->taxonomyNodeId);
}
}