<?php

namespace App\Helpers;

use App\Models\ActivityLogModel;

class ActivityLogMapper
{
  public function toActivityLog(array $row): ActivityLogModel
  {
    return new ActivityLogModel(
      id: $row['id_log'],
      ticketId: $row['id_ticket'],
      userId: $row['id_user'],
      aktivitas: $row['aktivitas'],
      logType: $row['log_type'],
      ipAddress: $row['ip_address'],
      tanggalAktivitas: $row['tanggal_aktivitas'],
      namaUser: $row['nama'] ?? null,
    );
  }
}
