import 'package:pshared/models/wallet/balance.dart';
import 'package:pshared/models/wallet/money.dart';


class WalletAsset {
  final String chain;
  final String tokenSymbol;
  final String contractAddress;

  const WalletAsset({
    required this.chain,
    required this.tokenSymbol,
    required this.contractAddress,
  });
}

class WalletModel {
  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 WalletMoney? availableMoney;

  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,
  });

  WalletModel copyWith({
    WalletBalance? balance,
    WalletMoney? availableMoney,
  }) {
    return WalletModel(
      walletRef: walletRef,
      organizationRef: organizationRef,
      ownerRef: ownerRef,
      asset: asset,
      depositAddress: depositAddress,
      status: status,
      metadata: metadata,
      createdAt: createdAt,
      updatedAt: updatedAt,
      balance: balance ?? this.balance,
      availableMoney: availableMoney ?? this.availableMoney,
    );
  }
}
