16 lines
523 B
Dart
16 lines
523 B
Dart
import 'package:pshared/data/dto/wallet/balance.dart';
|
|
import 'package:pshared/data/mapper/money.dart';
|
|
import 'package:pshared/models/wallet/balance.dart';
|
|
|
|
|
|
extension WalletBalanceDTOMapper on WalletBalanceDTO {
|
|
WalletBalance toDomain() => WalletBalance(
|
|
available: available?.toDomain(),
|
|
pendingInbound: pendingInbound?.toDomain(),
|
|
pendingOutbound: pendingOutbound?.toDomain(),
|
|
calculatedAt: (calculatedAt == null || calculatedAt!.isEmpty)
|
|
? null
|
|
: DateTime.tryParse(calculatedAt!),
|
|
);
|
|
}
|