import 'dart:convert';

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

class TransferModel extends CustomMessageModel {
  @override
  String businessID;
  String amount;
  int orderId;
  bool isReceived;

  TransferModel({
    this.businessID = CustomMessageType.DT_TRANSFER,
    required this.amount,
    required this.orderId,
    this.isReceived = false,
  });

  factory TransferModel.fromJson(Map<String, dynamic> json) => TransferModel(
        businessID: json['businessID'],
        amount: json['amount'],
        orderId: json['orderId'] ?? 33,
      );

  @override
  String toJson() => json.encode({
        'businessID': businessID,
        'amount': amount,
        'orderId': orderId,
        'isReceived': isReceived,
      });
}
