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
RecordUpdatedEvent
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 Updated Domain Event.
15 *
16 * Dispatched via Yii3 EventDispatcher (PSR-14) after a successful
17 * record update operation. Contains the field-level diff for audit.
18 * Consumed by AuditUpdateListener.
19 *
20 * @package App\Core\Engine\Domain\Event
21 */
22final readonly class RecordUpdatedEvent
23{
24    /**
25     * RecordUpdatedEvent constructor.
26     *
27     * @param string               $moduleName Module name where record was updated.
28     * @param int                  $recordId   Primary key of the updated record.
29     * @param array<string, array{old: mixed, new: mixed}> $diff Field-level diff map.
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             $diff,
36        public readonly PermissionContext  $context,
37    ) {
38    }
39}