Some checks failed
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/bump_version Pipeline failed
27 lines
982 B
Dart
27 lines
982 B
Dart
import 'package:pshared/data/dto/wallet/balance.dart';
|
|
import 'package:pshared/data/dto/wallet/wallet.dart';
|
|
import 'package:pshared/data/mapper/wallet/balance.dart';
|
|
import 'package:pshared/data/mapper/wallet/money.dart';
|
|
import 'package:pshared/models/wallet/wallet.dart';
|
|
|
|
|
|
extension WalletDTOMapper on WalletDTO {
|
|
WalletModel toDomain({WalletBalanceDTO? balance}) => WalletModel(
|
|
walletRef: walletRef,
|
|
organizationRef: organizationRef,
|
|
ownerRef: ownerRef,
|
|
asset: WalletAsset(
|
|
chain: asset.chain,
|
|
tokenSymbol: asset.tokenSymbol,
|
|
contractAddress: asset.contractAddress,
|
|
),
|
|
depositAddress: depositAddress,
|
|
status: status,
|
|
metadata: metadata,
|
|
createdAt: (createdAt == null || createdAt!.isEmpty) ? null : DateTime.tryParse(createdAt!),
|
|
updatedAt: (updatedAt == null || updatedAt!.isEmpty) ? null : DateTime.tryParse(updatedAt!),
|
|
balance: balance?.toDomain(),
|
|
availableMoney: balance?.available?.toDomain(),
|
|
);
|
|
}
|