Skip to content

Commit

Permalink
Prepare for v1.7.6 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhi13man committed Sep 9, 2022
1 parent 3000687 commit a95d572
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 155 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
2. **Potentially Breaking:** Extension of Accounts API Data Models to incorporate premium Data Layer: [#7](https://github.com/Dhi13man/nordigen_integration/issues/7)
3. Lint compliances.

## [1.7.6] - 9th September 2021

1. Parse bban property in account details: [#12](https://github.com/Dhi13man/nordigen_integration/pull/12)
2. Add parsing of endToEndId property: [#11](https://github.com/Dhi13man/nordigen_integration/pull/11)

Big thanks to [tolik505](https://github.com/tolik505) for these contributions.

## [1.7.5] - 30th August 2021

1. **Bug Fix:** Fixing the issue of `TransactionData` model not containing `currencyExchange` as a List: [#8](https://github.com/Dhi13man/nordigen_integration/issues/8)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ Make sure you check out the [Contribution Guildelines](https://github.com/Dhi13m

1. In case of any bugs, reach out to me at [@Dhi13man](https://twitter.com/Dhi13man) or [file an issue](https://github.com/Dhi13man/nordigen_integration/issues)

2. Big thanks to contributors, including [@antoineraulin](https://github.com/antoineraulin), [@stantemo](https://github.com/stantemo) and [@c-louis](https://github.com/c-louis). Contribution is welcome, and makes my day brighter
2. Big thanks to contributors, including [@tolik505](https://github.com/tolik505), [@antoineraulin](https://github.com/antoineraulin), [@stantemo](https://github.com/stantemo) and [@c-louis](https://github.com/c-louis). Contribution is welcome, and makes my day brighter

3. The first release of this package was sponsored by [Cashtic](https://cashtic.com). Show them some love! This package would not otherwise be possible

Expand Down
6 changes: 3 additions & 3 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "46.0.0"
version: "40.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "4.6.0"
version: "4.1.0"
args:
dependency: transitive
description:
Expand Down Expand Up @@ -331,4 +331,4 @@ packages:
source: hosted
version: "3.1.1"
sdks:
dart: ">=2.17.0 <3.0.0"
dart: ">=2.16.0 <3.0.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: nordigen_integration
description: Dart/Flutter Package for Nordigen's EU PSD2 AISP Banking API Integration, with relevant Data Models.
version: 1.7.5
version: 1.7.6
homepage: https://github.com/Dhi13man/nordigen_integration/
repository: https://github.com/dhi13man/nordigen_integration/
issue_tracker: https://github.com/Dhi13man/nordigen_integration/issues/
Expand Down
179 changes: 29 additions & 150 deletions test/unit_tests/nordigen_account_models_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,160 +5,39 @@ Future<void> main() async {
group(
'Nordigen Account Models Unit Tests',
() => <void>{
test('Parse Account Details', () {
// Arrange - Sample Data
const Map<String, dynamic> sampleMap = <String, dynamic>{
'resourceId': '0df01281-2408-5dbe-92f2-96b2c1cc08e1',
'iban': 'DE26100110012622221111',
'bban': '333322221111',
'currency': 'EUR',
'name': 'Main Account',
'product': 'Main Product',
'cashAccountType': 'CACC',
'status': 'enabled',
'bic': 'NTSBDEB1XXX',
'usage': 'PRIV'
};
test(
'Parse Account Details',
() {
// Arrange - Sample Data
const Map<String, dynamic> sampleMap = <String, dynamic>{
'resourceId': '0df01281-2408-5dbe-92f2-96b2c1cc08e1',
'iban': 'DE26100110012622221111',
'bban': '333322221111',
'currency': 'EUR',
'name': 'Main Account',
'product': 'Main Product',
'cashAccountType': 'CACC',
'status': 'enabled',
'bic': 'NTSBDEB1XXX',
'usage': 'PRIV'
};

// Act - Parse Data
final AccountDetails result = AccountDetails.fromMap(sampleMap);

// Assert - Check Data
expect(result.id, '0df01281-2408-5dbe-92f2-96b2c1cc08e1');
expect(result.iban, 'DE26100110012622221111');
expect(result.bban, '333322221111');
expect(result.currency, 'EUR');
expect(result.name, 'Main Account');
expect(result.product, 'Main Product');
expect(result.cashAccountType, 'CACC');
expect(result.status, 'enabled');
expect(result.bic, 'NTSBDEB1XXX');
expect(result.usage, 'PRIV');
}),
test('Parse sample Account Model Transaction Data', () {
// Arrange - Sample Data
const Map<String, dynamic> sampleTransactionMap = <String, dynamic>{
'transactionId': 'uuid',
'bookingDate': '2022-08-15',
'valueDate': '2022-08-15',
'transactionAmount': <String, String>{
'amount': '-14.54',
'currency': 'EUR'
},
'currencyExchange': <Map<String, String>>[
<String, String>{
'sourceCurrency': 'USD',
'exchangeRate': '0.9771505376',
'unitCurrency': 'USD',
'targetCurrency': 'EUR',
'quotationDate': '2022-08-15'
}
],
'creditorName': 'PAYPAL',
'remittanceInformationUnstructured': '-',
'remittanceInformationUnstructuredArray': <String>['-'],
'additionalInformation': 'uuid',
'bankTransactionCode': 'CODE'
};

// Act - Parse Data
final TransactionData transactionData =
TransactionData.fromMap(sampleTransactionMap);

// Assert - Check Data
expect(transactionData.id, 'uuid');
expect(transactionData.bookingDate, '2022-08-15');
expect(transactionData.valueDate, '2022-08-15');
expect(transactionData.transactionAmount.amount, '-14.54');
expect(transactionData.transactionAmount.currency, 'EUR');
expect(transactionData.currencyExchange!.length, 1);
}),
test('Parse List of sample Account Model Transaction Data', () {
// Arrange - Sample Data
const List<Map<String, dynamic>> sampleTransactionMapList =
<Map<String, dynamic>>[
<String, dynamic>{
'transactionId': 'uuid',
'bookingDate': '2022-08-15',
'valueDate': '2022-08-15',
'transactionAmount': <String, String>{
'amount': '-14.54',
'currency': 'EUR',
},
'currencyExchange': <Map<String, String>>[
<String, String>{
'sourceCurrency': 'USD',
'exchangeRate': '0.9771505376',
'unitCurrency': 'USD',
'targetCurrency': 'EUR',
'quotationDate': '2022-08-15',
}
],
'creditorName': 'PAYPAL',
'remittanceInformationUnstructured': '-',
'remittanceInformationUnstructuredArray': <String>['-'],
'additionalInformation': 'uuid',
'bankTransactionCode': 'CODE',
},
<String, dynamic>{
'transactionId': 'uuid-1',
'bookingDate': '2022-08-16',
'valueDate': '2022-08-16',
'transactionAmount': <String, String>{
'amount': '-150.0',
'currency': 'EUR',
},
'creditorName': 'Someone',
'creditorAccount': <String, String>{'iban': 'DE87100110535353906'},
'remittanceInformationUnstructured': 'MoneyBeam',
'remittanceInformationUnstructuredArray': <String>['MoneyBeam'],
'bankTransactionCode': 'ICDT',
},
<String, dynamic>{
'transactionId': 'uuid-2',
'bookingDate': '2022-08-16',
'valueDate': '2022-08-16',
'transactionAmount': <String, dynamic>{
'amount': '300.0',
'currency': 'EUR',
},
'debtorName': 'JOHN DOE',
'debtorAccount': <String, dynamic>{'iban': 'DE047008000543427500'},
'bankTransactionCode': 'PMNT-ESCT',
},
<String, dynamic>{
'transactionId': 'uuid-3',
'bookingDate': '2022-08-15',
'valueDate': '2022-08-15',
'transactionAmount': <String, dynamic>{
'amount': '-3.1',
'currency': 'EUR',
},
'creditorName': 'TICKETSHOP',
'remittanceInformationUnstructured': '-',
'remittanceInformationUnstructuredArray': <String>['-'],
'additionalInformation': '90ef-4147-aa2e',
'bankTransactionCode': 'PMNT-CCRD',
}
];

for (Map<String, dynamic> transactionMap in sampleTransactionMapList) {
// Act - Parse Data
final TransactionData transactionData =
TransactionData.fromMap(transactionMap);
final AccountDetails result = AccountDetails.fromMap(sampleMap);

// Assert - Check Data
expect(transactionData.id, transactionMap['transactionId']);
expect(transactionData.bookingDate, transactionMap['bookingDate']);
expect(transactionData.valueDate, transactionMap['valueDate']);
expect(transactionData.transactionAmount.amount,
transactionMap['transactionAmount']['amount']);
expect(transactionData.transactionAmount.currency,
transactionMap['transactionAmount']['currency']);
expect(transactionData.currencyExchange?.length ?? 0,
transactionMap['currencyExchange']?.length ?? 0);
}
})
expect(result.id, '0df01281-2408-5dbe-92f2-96b2c1cc08e1');
expect(result.iban, 'DE26100110012622221111');
expect(result.bban, '333322221111');
expect(result.currency, 'EUR');
expect(result.name, 'Main Account');
expect(result.product, 'Main Product');
expect(result.cashAccountType, 'CACC');
expect(result.status, 'enabled');
expect(result.bic, 'NTSBDEB1XXX');
expect(result.usage, 'PRIV');
},
),
},
);
}

0 comments on commit a95d572

Please sign in to comment.