class SwipeTransaction {
  final int ?id;
  final String? swipeTypeName;
  final String ?userName;
  final String? siteName;
  final String? pointName;
  final DateTime? swipeTime;
  final bool? isSuccess;
  final String? errorMessage;

  SwipeTransaction({
     this.id,
     this.swipeTypeName,
     this.userName,
     this.siteName,
     this.pointName,
     this.swipeTime,
     this.isSuccess,
     this.errorMessage,
  });

  factory SwipeTransaction.fromJson(Map<String, dynamic> json) {
    return SwipeTransaction(
      id: json['id'] as int,
      swipeTypeName: json['swipeTypeName'] ,
      userName: json['userName'] ,
      siteName: json['siteName'] ,
      pointName: json['pointName'] ,
      swipeTime: DateTime.parse(json['swipeTime']),
      isSuccess: json['isSuccess'] ,
      errorMessage: json['errorMessage'] ,
    );
  }

  // Map<String, dynamic> toJson() {
  //   return {
  //     'id': id,
  //     'swipeTypeName': swipeTypeName,
  //     'userName': userName,
  //     'siteName': siteName,
  //     'pointName': pointName,
  //     'swipeTime': swipeTime.toIso8601String(),
  //     'isSuccess': isSuccess,
  //     'errorMessage': errorMessage,
  //   };
  // }
}
