<?php

namespace Modules\Vrc\Services\Adapters\Erp;

use App\Utils\Util;
use Modules\Vrc\Services\Contracts\AuditServiceContract;

/**
 * ERP adapter: delegates to App\Utils\Util::activityLog (spatie activitylog),
 * the same mechanism every ERP module uses. Signature:
 *   activityLog($on, $action, $before, $properties, $log_changes, $business_id)
 */
class ErpAuditService implements AuditServiceContract
{
    public function __construct(protected Util $util)
    {
    }

    public function log($model, string $action, array $properties = [], ?int $businessId = null): void
    {
        $this->util->activityLog($model, $action, null, $properties, false, $businessId);
    }
}
