// To parse this JSON data, do
//
//     final shiftRespon = shiftResponFromJson(jsonString);

import 'dart:convert';

ShiftRespon shiftResponFromJson(String str) =>
    ShiftRespon.fromJson(json.decode(str));

String shiftResponToJson(ShiftRespon data) => json.encode(data.toJson());

class ShiftRespon {
  ShiftRespon({
    this.success,
    this.message,
    this.data,
  });

  bool? success;
  String? message;
  List<DataShift>? data;

  factory ShiftRespon.fromJson(Map<String, dynamic> json) => ShiftRespon(
        success: json["success"] == null ? null : json["success"],
        message: json["message"] == null ? null : json["message"],
        data: json["data"] == null
            ? null
            : List<DataShift>.from(
                json["data"].map((x) => DataShift.fromJson(x))),
      );

  Map<String, dynamic> toJson() => {
        "success": success == null ? null : success,
        "message": message == null ? null : message,
        "data": data == null
            ? null
            : List<dynamic>.from(data!.map((x) => x.toJson())),
      };
}

class DataShift {
  DataShift({
    this.idShiftKaryawan,
    this.namaLengkap,
    this.nik,
    this.tanggal,
    this.tanggalRaw,
    this.idMasterShift,
    this.kodeShift,
    this.namaShift,
    this.jamMasuk,
    this.jamPulang,
    this.flagJamPulang,
    this.libur,
  });

  int? idShiftKaryawan;
  String? namaLengkap;
  String? nik;
  String? tanggal;
  String? tanggalRaw;
  String? idMasterShift;
  String? kodeShift;
  String? namaShift;
  String? jamMasuk;
  String? jamPulang;
  String? flagJamPulang;
  String? libur;

  factory DataShift.fromJson(Map<String, dynamic> json) => DataShift(
        idShiftKaryawan: json["id_shift_karyawan"] == null
            ? null
            : json["id_shift_karyawan"],
        namaLengkap: json["nama_lengkap"] == null ? null : json["nama_lengkap"],
        nik: json["nik"] == null ? null : json["nik"],
        tanggal: json["tanggal"] == null ? null : json["tanggal"],
        tanggalRaw: json["tanggal_raw"] == null ? null : json["tanggal_raw"],
        idMasterShift:
            json["id_master_shift"] == null ? null : json["id_master_shift"],
        kodeShift: json["kode_shift"] == null ? null : json["kode_shift"],
        namaShift: json["nama_shift"] == null ? null : json["nama_shift"],
        jamMasuk: json["jam_masuk"] == null ? null : json["jam_masuk"],
        jamPulang: json["jam_pulang"] == null ? null : json["jam_pulang"],
        flagJamPulang:
            json["flag_jam_pulang"] == null ? null : json["flag_jam_pulang"],
        libur: json["libur"] == null ? null : json["libur"],
      );

  Map<String, dynamic> toJson() => {
        "id_shift_karyawan": idShiftKaryawan == null ? null : idShiftKaryawan,
        "tanggal": tanggal == null ? null : tanggal,
        "nama_lengkap": namaLengkap == null ? null : namaLengkap,
        "nik": nik == null ? null : nik,
        "id_master_shift": idMasterShift == null ? null : idMasterShift,
        "kode_shift": kodeShift == null ? null : kodeShift,
        "nama_shift": namaShift == null ? null : namaShift,
        "jam_masuk": jamMasuk == null ? null : jamMasuk,
        "jam_pulang": jamPulang == null ? null : jamPulang,
        "flag_jam_pulang": flagJamPulang == null ? null : flagJamPulang,
        "libur": libur == null ? null : libur,
      };
}

ShiftTemanKaryawanRespon shiftTemanResponFromJson(String str) =>
    ShiftTemanKaryawanRespon.fromJson(json.decode(str));

String shiftTemanResponToJson(ShiftTemanKaryawanRespon data) =>
    json.encode(data.toJson());

class ShiftTemanKaryawanRespon {
  ShiftTemanKaryawanRespon({
    this.success,
    this.message,
    this.data,
  });

  bool? success;
  String? message;
  List<DataShiftTeman>? data;

  factory ShiftTemanKaryawanRespon.fromJson(Map<String, dynamic> json) =>
      ShiftTemanKaryawanRespon(
        success: json["success"] == null ? null : json["success"],
        message: json["message"] == null ? null : json["message"],
        data: json["data"] == null
            ? null
            : List<DataShiftTeman>.from(
                json["data"].map((x) => DataShiftTeman.fromJson(x))),
      );

  Map<String, dynamic> toJson() => {
        "success": success == null ? null : success,
        "message": message == null ? null : message,
        "data": data == null
            ? null
            : List<dynamic>.from(data!.map((x) => x.toJson())),
      };
}

class DataShiftTeman {
  DataShiftTeman(
      {this.namaLengkap,
      this.foto,
      this.idKaryawan,
      this.namaJabatan,
      this.namaDepartemen,
      this.namaCabang});

  String? namaLengkap;
  String? foto;
  String? idKaryawan;
  String? namaJabatan;
  String? namaDepartemen;
  String? namaCabang;

  factory DataShiftTeman.fromJson(Map<String, dynamic> json) => DataShiftTeman(
        namaLengkap: json["nama_lengkap"] == null ? null : json["nama_lengkap"],
        foto: json["foto"] == null ? null : json["foto"],
        idKaryawan: json["id_karyawan"] == null ? null : json["id_karyawan"],
        namaJabatan: json["nama_jabatan"] == null ? null : json["nama_jabatan"],
        namaDepartemen:
            json["nama_departemen"] == null ? null : json["nama_departemen"],
        namaCabang: json["nama_cabang"] == null ? null : json["nama_cabang"],
      );

  Map<String, dynamic> toJson() => {
        "nama_lengkap": namaLengkap == null ? null : namaLengkap,
        "foto": foto == null ? null : foto,
        "id_karyawan": idKaryawan == null ? null : idKaryawan,
        "nama_jabatan": namaJabatan == null ? null : namaJabatan,
        "nama_departemen": namaDepartemen == null ? null : namaDepartemen,
        "nama_cabang": namaCabang == null ? null : namaCabang,
      };
}
