import 'package:pshared/data/dto/ledger/balance.dart';
import 'package:pshared/data/mapper/money.dart';
import 'package:pshared/models/ledger/balance.dart';


extension LedgerBalanceDtoMapper on LedgerBalanceDTO {
  LedgerBalance toDomain() => LedgerBalance(
    ledgerAccountRef: ledgerAccountRef,
    balance: balance?.toDomain(),
    version: version,
    lastUpdated: lastUpdated,
  );
}

extension LedgerBalanceModelMapper on LedgerBalance {
  LedgerBalanceDTO toDTO() => LedgerBalanceDTO(
    ledgerAccountRef: ledgerAccountRef,
    balance: balance?.toDTO(),
    version: version,
    lastUpdated: lastUpdated,
  );
}
