Add participant name to transactions UI

This commit is contained in:
Hillel Coren 2024-01-12 10:15:18 +02:00
parent 0fbf09daca
commit ce13a35635
4 changed files with 14 additions and 0 deletions

View File

@ -66,6 +66,7 @@ class TransactionFields {
static const String status = 'status';
static const String accountType = 'account_type';
static const String defaultCategory = 'default_category';
static const String participantName = 'participant_name';
}
abstract class TransactionEntity extends Object

View File

@ -34,6 +34,7 @@ enum TransactionReportFields {
created_at,
updated_at,
record_state,
participant_name,
}
var memoizedTransactionReport = memo10((
@ -178,6 +179,10 @@ ReportResult transactionReport(
case TransactionReportFields.record_state:
value = AppLocalization.of(navigatorKey.currentContext!)!
.lookup(transaction.entityState);
break;
case TransactionReportFields.participant_name:
value = transaction.participantName;
break;
}
if (!ReportResult.matchField(

View File

@ -35,6 +35,7 @@ class TransactionPresenter extends EntityPresenter {
TransactionFields.category,
TransactionFields.payment,
TransactionFields.defaultCategory,
TransactionFields.participantName,
];
}
@ -76,6 +77,8 @@ class TransactionPresenter extends EntityPresenter {
);
case TransactionFields.description:
return Text(transaction!.description);
case TransactionFields.participantName:
return Text(transaction!.participantName);
case TransactionFields.accountType:
final bankAccount =
state.bankAccountState.get(transaction!.bankAccountId);

View File

@ -18,6 +18,7 @@ mixin LocalizationsProvider on LocaleCodeAware {
static final Map<String, Map<String, String>> _localizedValues = {
'en': {
// STARTER: lang key - do not remove comment
'participant_name': 'Participant Name',
'yodlee_regions': 'Regions: USA, UK, Australia & India',
'nordigen_regions': 'Regions: Europe & UK',
'select_provider': 'Select Provider',
@ -111603,6 +111604,10 @@ mixin LocalizationsProvider on LocaleCodeAware {
_localizedValues[localeCode]!['nordigen_regions'] ??
_localizedValues['en']!['nordigen_regions']!;
String get participantName =>
_localizedValues[localeCode]!['participant_name'] ??
_localizedValues['en']!['participant_name']!;
// STARTER: lang field - do not remove comment
String lookup(String? key) {