import 'package:pshared/models/describable.dart';
import 'package:money2/money2.dart';
import 'package:pshared/models/wallet/asset.dart';
import 'package:pshared/models/wallet/balance.dart';


class WalletModel implements Describable {
  final String walletRef;
  final String organizationRef;
  final String ownerRef;
  final WalletAsset asset;
  final String depositAddress;
  final String status;
  final Map<String, String>? metadata;
  final DateTime? createdAt;
  final DateTime? updatedAt;
  final WalletBalance? balance;
  final Money? availableMoney;
  final Describable describable;

  @override
  String get name => describable.name;

  @override
  String? get description => describable.description;

  const WalletModel({
    required this.walletRef,
    required this.organizationRef,
    required this.ownerRef,
    required this.asset,
    required this.depositAddress,
    required this.status,
    this.metadata,
    this.createdAt,
    this.updatedAt,
    this.balance,
    this.availableMoney,
    required this.describable,
  });

  WalletModel copyWith({Describable? describable}) => WalletModel(
    walletRef: walletRef,
    organizationRef: organizationRef,
    ownerRef: ownerRef,
    asset: asset,
    depositAddress: depositAddress,
    status: status,
    metadata: metadata,
    createdAt: createdAt,
    updatedAt: updatedAt,
    balance: balance,
    availableMoney: availableMoney,
    describable: describable ?? this.describable,
  );
}
