import 'package:equatable/equatable.dart';

class SuccessModel extends Equatable {
  final String message;
  final bool success;

  const SuccessModel({
    required this.message,
    required this.success,
  });

  factory SuccessModel.fromJson(Map<String, dynamic> json) {
    return SuccessModel(
      message: json['message'] as String? ?? '',
      success: json['success'] as bool? ?? false,
    );
  }

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

  SuccessModel copyWith({
    String? message,
    bool? success,
  }) {
    return SuccessModel(
      message: message ?? this.message,
      success: success ?? this.success,
    );
  }

  @override
  List<Object?> get props => [message, success];
}
