  class PenitipanModel {
    final int id;
    final String nama;
    final String rfid;
    final int lokerId;
    final DateTime? waktuMulai;
    final DateTime? waktuSelesai;
    final int? durasiMenit;
    final int? biaya;

    PenitipanModel({
    required this.id,
      required this.nama,
      required this.rfid,
      required this.lokerId,
      this.waktuMulai,
      this.waktuSelesai,
      this.durasiMenit,
      this.biaya,
    });

    factory PenitipanModel.fromJson(Map<String, dynamic> json) {
      return PenitipanModel(
        id: json['id'],
        nama: json['nama'],
        rfid: json['rfid'],
        lokerId: json['loker_id'],
        waktuMulai: json['waktu_mulai'] != null
            ? DateTime.parse(json['waktu_mulai'])
            : null,
        waktuSelesai: json['waktu_selesai'] != null
            ? DateTime.parse(json['waktu_selesai'])
            : null,
        durasiMenit: json['durasi_menit'],
        biaya: json['biaya'],
      );
    }
  }
