Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
50.00% covered (danger)
50.00%
1 / 2
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
RecordDeletedEvent
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5/** @license For full copyright and license information, please see the LICENSE.md file. */
6
7namespace App\Core\Engine\Domain\Event;
8
9defined('AMMONLY_APP') || exit('Direct script access is forbidden.');
10
11use App\Core\Engine\Domain\Model\PermissionContext;
12
13/**
14 * Record Deleted Domain Event.
15 *
16 * Dispatched via Yii3 EventDispatcher (PSR-14) after a successful
17 * record delete operation. Contains a full snapshot of the deleted record.
18 * Consumed by AuditDeleteListener.
19 *
20 * @package App\Core\Engine\Domain\Event
21 */
22final readonly class RecordDeletedEvent
23{
24    /**
25     * RecordDeletedEvent constructor.
26     *
27     * @param string               $moduleName Module name where record was deleted.
28     * @param int                  $recordId   Primary key of the deleted record.
29     * @param array<string, mixed> $snapshot   Full data snapshot before deletion.
30     * @param PermissionContext     $context    Security context of the actor.
31     */
32    public function __construct(
33        public readonly string            $moduleName,
34        public readonly int               $recordId,
35        public readonly array             $snapshot,
36        public readonly PermissionContext  $context,
37    ) {
38    }
39}