class ApiResponse {
  const ApiResponse({required this.status, required this.message});

  final String status;
  final String message;

  bool get isOk => status == 'ok';

  factory ApiResponse.fromJson(Map<String, dynamic> json) {
    return ApiResponse(
      status: json['status'] as String? ?? 'error',
      message: json['message'] as String? ?? '',
    );
  }

  Map<String, dynamic> toJson() {
    return <String, dynamic>{
      'status': status,
      'message': message,
    };
  }
}
