import 'package:pshared/models/ledger/account.dart';
import 'package:pshared/models/payment/wallet.dart';


enum BalanceItemType { wallet, ledger, addAction }

class BalanceItem {
  final BalanceItemType type;
  final Wallet? wallet;
  final LedgerAccount? account;

  const BalanceItem.wallet(this.wallet) : type = BalanceItemType.wallet, account = null;

  const BalanceItem.ledger(this.account) : type = BalanceItemType.ledger, wallet = null;

  const BalanceItem.addAction() : type = BalanceItemType.addAction, wallet = null, account = null;

  bool get isWallet => type == BalanceItemType.wallet;
  bool get isLedger => type == BalanceItemType.ledger;
  bool get isAdd => type == BalanceItemType.addAction;
}
