import 'dart:convert';

import 'package:chat/models/im/custom_message_model.dart';

class GroupCardModel extends CustomMessageModel {
  @override
  String businessID;
  String groupID;
  String groupName;
  String inviterID;

  GroupCardModel({
    this.businessID = CustomMessageType.GROUP_CARD,
    required this.groupID,
    required this.groupName,
    required this.inviterID,
  });

  factory GroupCardModel.fromJson(Map<String, dynamic> json) => GroupCardModel(
        businessID: json['businessID'],
        groupID: json['groupID'],
        groupName: json['groupName'],
        inviterID: json['inviterID'],
      );

  @override
  String toJson() => json.encode({
        'businessID': businessID,
        'groupID': groupID,
        'groupName': groupName,
        'inviterID': inviterID,
      });
}
