class AuthModel {
  final String token;
  final AuthKurirModel model;

  AuthModel({
    required this.token,
    required this.model,
  });
}

class AuthKurirModel {
  User? user;
  String? token;

  AuthKurirModel({this.user, this.token});

  AuthKurirModel.fromJson(Map<String, dynamic> json) {
    user = json['user'] != null ? User.fromJson(json['user']) : null;
    token = json['token'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    if (user != null) {
      data['user'] = user!.toJson();
    }
    data['token'] = token;
    return data;
  }
}

class User {
  String? mUserID;
  String? mUserUsername;
  String? mStaffName;
  String? ip;
  String? agent;
  String? mUserPassword = "";
  String? mCourierID;

  User(
      {this.mUserID,
      this.mUserUsername,
      this.mStaffName,
      this.ip,
      this.agent,
      this.mUserPassword,
      this.mCourierID});

  User.fromJson(Map<String, dynamic> json) {
    mUserID = json['M_UserID'];
    mUserUsername = json['M_UserUsername'];
    mStaffName = json['Nat_StaffName'];
    ip = json['ip'];
    agent = json['agent'];
    mCourierID = json['M_CourierID'];
    mUserPassword = "";
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['M_UserID'] = mUserID;
    data['M_UserUsername'] = mUserUsername;
    data['Nat_StaffName'] = mStaffName;
    data['ip'] = ip;
    data['agent'] = agent;
    data['M_CourierID'] = mCourierID;
    data['M_UserPassword'] = mUserPassword;
    return data;
  }
}
