<?php

namespace App\Helpers;

use App\Models\AttachmentModel;

class AttachmentMapper
{
  public function toAttachment(array $row): AttachmentModel
  {
    return new AttachmentModel(
      id: (int) $row['id_lampiran'],
      ticketId: (int) $row['id_ticket'],
      userId: (int) $row['id_user'],
      namaFile: $row['nama_file'],
      tipeFile: $row['tipe_file'],
      ukuranFile: $row['ukuran_file'],
      tanggalUpload: $row['tanggal_upload']
    );
  }
}
