$details Free-form context. Anything sensitive (PII, card numbers) MUST be redacted by the caller. */ function easy_invoice_audit_log(string $action, string $resource_type = '', $resource_id = null, array $details = []): void { /** * Fired once per auditable event. * * Subscribers (in order of expected interest): * • EasyInvoicePro\Addons\TeamRoles\AuditLogger::log — writes the row * • EasyInvoicePro\Addons\Webhooks\EventBridge — fans out 'audit.event_logged' * • SIEM / Slack / external forwarders — user-installed * * @param string $action * @param string $resource_type * @param int|string|null $resource_id * @param array $details */ do_action('easy_invoice_audit_event', $action, $resource_type, $resource_id, $details); } }