Some checks failed
Main Confidence / confidence (push) Failing after 51s
## Summary - converge finding, queued, and completed database notifications on one shared `OperationUxPresenter` presentation contract - preserve existing finding and operation deep-link authorities while standardizing title, body, status/icon treatment, and single primary action - add focused notification, findings, and guard coverage plus the full feature 230 spec artifacts ## Validation - `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent` - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Notifications/SharedDatabaseNotificationContractTest.php tests/Feature/Notifications/OperationRunNotificationTest.php tests/Feature/Notifications/FindingNotificationLinkTest.php` - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Findings/FindingsNotificationEventTest.php tests/Feature/Findings/FindingsNotificationRoutingTest.php tests/Feature/OpsUx/Constitution/LegacyNotificationGuardTest.php` ## Filament / Platform Notes - Livewire v4.0+ compliance preserved on Filament v5 primitives - provider registration remains unchanged in `apps/platform/bootstrap/providers.php` - no globally searchable resource behavior changed in this feature - no destructive actions were introduced - asset strategy is unchanged; the existing `cd apps/platform && php artisan filament:assets` deploy step remains sufficient Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #265
37 lines
984 B
PHP
37 lines
984 B
PHP
<?php
|
|
|
|
namespace App\Notifications;
|
|
|
|
use App\Models\OperationRun;
|
|
use App\Support\OpsUx\OperationUxPresenter;
|
|
use App\Support\ReasonTranslation\ReasonPresenter;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Notifications\Notification;
|
|
|
|
class OperationRunCompleted extends Notification
|
|
{
|
|
use Queueable;
|
|
|
|
public function __construct(
|
|
public OperationRun $run
|
|
) {}
|
|
|
|
public function via(object $notifiable): array
|
|
{
|
|
return ['database'];
|
|
}
|
|
|
|
public function toDatabase(object $notifiable): array
|
|
{
|
|
$message = OperationUxPresenter::terminalDatabaseNotificationMessage($this->run, $notifiable);
|
|
$reasonEnvelope = app(ReasonPresenter::class)->forOperationRun($this->run, 'notification');
|
|
|
|
if ($reasonEnvelope !== null) {
|
|
$message['reason_translation'] = $reasonEnvelope->toArray();
|
|
$message['diagnostic_reason_code'] = $reasonEnvelope->diagnosticCode();
|
|
}
|
|
|
|
return $message;
|
|
}
|
|
}
|