import 'package:qrscanner/models/pass_code.dart';

class ScanResponse {
  const ScanResponse({
    required this.success,
    this.message,
    this.passCode,
  });

  factory ScanResponse.fromJson(Map<String, dynamic> json) {
    return ScanResponse(
      success: json['success'] == true,
      message: json['message'] as String?,
      passCode: json['passCode'] is Map<String, dynamic>
          ? PassCode.fromJson(json['passCode'] as Map<String, dynamic>)
          : null,
    );
  }

  final bool success;
  final String? message;
  final PassCode? passCode;
}