<?php

namespace App\Helpers;

use App\Models\TeknisiModel;

class TeknisiMapper
{
  public function toTeknisi(array $row): TeknisiModel
  {
    // id_teknisi, id_user, nama, username, spesialisasi, status_aktif, created_at, updated_at
    return new TeknisiModel(
      id: (int) $row["id_teknisi"],
      userId: (int) $row["id_user"],
      namaUser: $row["nama"],
      username: $row["username"],
      spesialisasi: $row["spesialisasi"],
      statusAktif: $row["status_aktif"],
      createdAt: $row["created_at"],
      updatedAt: $row["updated_at"]
    );
  }
}
