class PassCode {
  const PassCode({
    required this.id,
    required this.name,
    required this.code,
    required this.status,
    required this.scanned,
    required this.createdAt,
    this.scannedAt,
  });

  factory PassCode.fromJson(Map<String, dynamic> json) {
    return PassCode(
      id: (json['id'] as num).toInt(),
      name: json['name'] as String? ?? '',
      code: json['code'] as String? ?? '',
      status: json['status'] as String? ?? '',
      scanned: json['scanned'] == true,
      createdAt: json['createdAt'] as String? ?? '',
      scannedAt: json['scannedAt'] as String?,
    );
  }

  final int id;
  final String name;
  final String code;
  final String status;
  final bool scanned;
  final String createdAt;
  final String? scannedAt;
}