front dev update

This commit is contained in:
Stephan D
2026-01-30 16:54:56 +01:00
parent 51f5b0804a
commit 102c5d3668
31 changed files with 755 additions and 74 deletions

View File

@@ -1,6 +1,7 @@
import 'package:pshared/data/dto/ledger/account.dart';
import 'package:pshared/data/mapper/describable.dart';
import 'package:pshared/data/mapper/ledger/balance.dart';
import 'package:pshared/data/mapper/ledger/role.dart';
import 'package:pshared/data/mapper/ledger/status.dart';
import 'package:pshared/data/mapper/ledger/type.dart';
import 'package:pshared/models/describable.dart';
@@ -17,7 +18,7 @@ extension LedgerAccountDTOMapper on LedgerAccountDTO {
currency: currency,
status: status.toDomain(),
allowNegative: allowNegative,
isSettlement: isSettlement,
role: role.toDomain(),
metadata: metadata,
createdAt: createdAt,
updatedAt: updatedAt,
@@ -36,7 +37,7 @@ extension LedgerAccountModelMapper on LedgerAccount {
currency: currency,
status: status.toDTO(),
allowNegative: allowNegative,
isSettlement: isSettlement,
role: role.toDTO(),
metadata: metadata,
createdAt: createdAt,
updatedAt: updatedAt,

View File

@@ -0,0 +1,65 @@
import 'package:pshared/data/dto/ledger/role.dart';
import 'package:pshared/models/ledger/role.dart';
extension LedgerAccountRoleDTOMapper on LedgerAccountRoleDTO {
LedgerAccountRole toDomain() {
switch (this) {
case LedgerAccountRoleDTO.unspecified:
return LedgerAccountRole.unspecified;
case LedgerAccountRoleDTO.operating:
return LedgerAccountRole.operating;
case LedgerAccountRoleDTO.hold:
return LedgerAccountRole.hold;
case LedgerAccountRoleDTO.transit:
return LedgerAccountRole.transit;
case LedgerAccountRoleDTO.settlement:
return LedgerAccountRole.settlement;
case LedgerAccountRoleDTO.clearing:
return LedgerAccountRole.clearing;
case LedgerAccountRoleDTO.pending:
return LedgerAccountRole.pending;
case LedgerAccountRoleDTO.reserve:
return LedgerAccountRole.reserve;
case LedgerAccountRoleDTO.liquidity:
return LedgerAccountRole.liquidity;
case LedgerAccountRoleDTO.fee:
return LedgerAccountRole.fee;
case LedgerAccountRoleDTO.chargeback:
return LedgerAccountRole.chargeback;
case LedgerAccountRoleDTO.adjustment:
return LedgerAccountRole.adjustment;
}
}
}
extension LedgerAccountRoleModelMapper on LedgerAccountRole {
LedgerAccountRoleDTO toDTO() {
switch (this) {
case LedgerAccountRole.unspecified:
return LedgerAccountRoleDTO.unspecified;
case LedgerAccountRole.operating:
return LedgerAccountRoleDTO.operating;
case LedgerAccountRole.hold:
return LedgerAccountRoleDTO.hold;
case LedgerAccountRole.transit:
return LedgerAccountRoleDTO.transit;
case LedgerAccountRole.settlement:
return LedgerAccountRoleDTO.settlement;
case LedgerAccountRole.clearing:
return LedgerAccountRoleDTO.clearing;
case LedgerAccountRole.pending:
return LedgerAccountRoleDTO.pending;
case LedgerAccountRole.reserve:
return LedgerAccountRoleDTO.reserve;
case LedgerAccountRole.liquidity:
return LedgerAccountRoleDTO.liquidity;
case LedgerAccountRole.fee:
return LedgerAccountRoleDTO.fee;
case LedgerAccountRole.chargeback:
return LedgerAccountRoleDTO.chargeback;
case LedgerAccountRole.adjustment:
return LedgerAccountRoleDTO.adjustment;
}
}
}

View File

@@ -90,6 +90,8 @@ ChainNetwork chainNetworkFromValue(String? value) {
return ChainNetwork.ethereumMainnet;
case 'arbitrum_one':
return ChainNetwork.arbitrumOne;
case 'arbitrum_sepolia':
return ChainNetwork.arbitrumSepolia;
case 'tron_mainnet':
return ChainNetwork.tronMainnet;
case 'tron_nile':
@@ -111,6 +113,8 @@ String chainNetworkToValue(ChainNetwork chain) {
return 'tron_mainnet';
case ChainNetwork.tronNile:
return 'tron_nile';
case ChainNetwork.arbitrumSepolia:
return 'arbitrum_sepolia';
case ChainNetwork.unspecified:
return 'unspecified';
}