Fixed compilation
This commit is contained in:
43
frontend/pshared/lib/data/mapper/ledger/account.dart
Normal file
43
frontend/pshared/lib/data/mapper/ledger/account.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
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/models/ledger/account.dart';
|
||||
|
||||
|
||||
extension LedgerAccountDtoMapper on LedgerAccountDTO {
|
||||
LedgerAccount toModel() => LedgerAccount(
|
||||
ledgerAccountRef: ledgerAccountRef,
|
||||
organizationRef: organizationRef,
|
||||
ownerRef: ownerRef,
|
||||
accountCode: accountCode,
|
||||
accountType: accountType,
|
||||
currency: currency,
|
||||
status: status,
|
||||
allowNegative: allowNegative,
|
||||
isSettlement: isSettlement,
|
||||
metadata: metadata,
|
||||
createdAt: createdAt,
|
||||
updatedAt: updatedAt,
|
||||
describable: describable.toDomain(),
|
||||
balance: balance?.toDomain(),
|
||||
);
|
||||
}
|
||||
|
||||
extension LedgerAccountModelMapper on LedgerAccount {
|
||||
LedgerAccountDTO toDTO() => LedgerAccountDTO(
|
||||
ledgerAccountRef: ledgerAccountRef,
|
||||
organizationRef: organizationRef,
|
||||
ownerRef: ownerRef,
|
||||
accountCode: accountCode,
|
||||
accountType: accountType,
|
||||
currency: currency,
|
||||
status: status,
|
||||
allowNegative: allowNegative,
|
||||
isSettlement: isSettlement,
|
||||
metadata: metadata,
|
||||
createdAt: createdAt,
|
||||
updatedAt: updatedAt,
|
||||
describable: describable.toDTO(),
|
||||
balance: balance?.toDTO(),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user