Skip to content

Commit 08e9ae2

Browse files
authored
Merge pull request #167 from ConsumerDataStandardsAustralia/feature/testdata-integration-banking
Loading of testdata for Banking
2 parents 25cb31d + e5016d3 commit 08e9ae2

File tree

44 files changed

+608
-223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+608
-223
lines changed

client-cli/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ or, if you want to point to your own keystore:
2929

3030
docker run -p 8686:8686 -it -v /your/local/path/to/java-artefacts/client-cli/keystore:/keystore consumerdatastandardsaustralia/client-cli:x.x.x
3131

32-
Where `x.x.x` is the version, say, `2.1.0`
32+
Where `x.x.x` is the version, say, `2.2.0`
3333

3434
Run locally-built image:
3535

36-
docker run -p 8383:8383 consumerdatastandardsaustralia/data-holder:2.1.1-SNAPSHOT
36+
docker run -p 8383:8383 consumerdatastandardsaustralia/data-holder:2.2.1-SNAPSHOT
3737

3838
### Command Reference
3939

@@ -183,8 +183,8 @@ or in the application.properties file before launching the application with `mvn
183183

184184
Example:
185185

186-
java -Dserver=http://localhost:8383/cds-au/v1 -jar target/client-cli-2.1.0.jar
186+
java -Dserver=http://localhost:8383/cds-au/v1 -jar target/client-cli-2.2.0.jar
187187

188188
or
189189

190-
java -Dserver=http://localhost:8383/cds-au/v1 -jar target/client-cli-2.1.1-SNAPSHOT.jar
190+
java -Dserver=http://localhost:8383/cds-au/v1 -jar target/client-cli-2.2.1-SNAPSHOT.jar

client/src/main/java/au/org/consumerdatastandards/client/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public ApiClient(boolean validating) {
6565
json = new JSON(validating);
6666

6767
// Set default User-Agent.
68-
setUserAgent("CDS Client/2.1.0/java");
68+
setUserAgent("CDS Client/2.2.0/java");
6969

7070
addDefaultHeader("Accept", "application/json");
7171
addDefaultHeader("Content-Type", "application/json");

data-holder/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If you want to pass a [test data file](https://github.com/ConsumerDataStandardsA
2020

2121
java -jar target/data-holder-x.x.x.jar /your/local/path/to/testdata-cli/samples/output/u1-output.json
2222

23-
Where `x.x.x` is the version, say, `2.1.0`
23+
Where `x.x.x` is the version, say, `2.2.0`
2424

2525
## Docker
2626

@@ -36,8 +36,8 @@ If you want to pass a [test data file](https://github.com/ConsumerDataStandardsA
3636

3737
docker run -p 8383:8383 -v /your/local/path/to/testdata-cli/samples/output/u1-output.json:/testdata/u1-output.json consumerdatastandardsaustralia/data-holder:x.x.x /testdata/u1-output.json
3838

39-
Where `x.x.x` is the version, say, `2.1.0`
39+
Where `x.x.x` is the version, say, `2.2.0`
4040

4141
Run locally-built image:
4242

43-
docker run -p 8383:8383 consumerdatastandardsaustralia/data-holder:2.1.1-SNAPSHOT
43+
docker run -p 8383:8383 consumerdatastandardsaustralia/data-holder:2.2.1-SNAPSHOT

data-holder/src/main/java/au/org/consumerdatastandards/holder/api/banking/BankingAccountsApiController.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ public ResponseEntity<ResponseBankingTransactionList> getTransactions(String acc
136136
HttpHeaders headers = generateResponseHeaders(xFapiInteractionId, supportedVersion);
137137
Integer actualPage = getPagingValue(page, 1);
138138
Integer actualPageSize = getPagingValue(pageSize, 25);
139+
newestTime = (newestTime == null ? OffsetDateTime.now() : newestTime);
140+
oldestTime = (oldestTime == null ? newestTime.minusDays(90) : oldestTime);
139141
Page<BankingTransaction> transactionPage = transactionService.findTransactions(
140142
accountId, maxAmount, minAmount, newestTime, oldestTime, text, PageRequest.of(actualPage - 1, actualPageSize));
141143
validatePageRange(actualPage, transactionPage.getTotalPages(), xFapiInteractionId);

data-holder/src/main/java/au/org/consumerdatastandards/holder/model/CommonPhysicalAddress.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,20 @@ public enum AddressUType {
2525

2626
private AddressUType addressUType;
2727

28-
@ManyToOne
28+
@ManyToOne(cascade = CascadeType.ALL)
2929
private CommonPAFAddress paf;
3030

3131
@Embedded
3232
private CommonSimpleAddress simple;
3333

34+
public String getId() {
35+
return id;
36+
}
37+
38+
public void setId(String id) {
39+
this.id = id;
40+
}
41+
3442
public CommonPhysicalAddress addressUType(AddressUType addressUType) {
3543
this.addressUType = addressUType;
3644
return this;

data-holder/src/main/java/au/org/consumerdatastandards/holder/model/banking/BankingAccountDetail.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ public enum SpecificAccountUType {
4343

4444
void setDepositRate(String depositRate);
4545

46-
@ApiModelProperty(value = "Fully described deposit rates for this account based on the equivalent structure in Product Reference")
47-
List<BankingProductDepositRateV1> getDepositRates();
48-
49-
void setDepositRates(List<BankingProductDepositRateV1> depositRates);
50-
5146
@ApiModelProperty(value = "Array of features of the account based on the equivalent structure in Product Reference with the following additional field")
5247
List<BankingAccountProductFeature> getFeatures();
5348

@@ -63,11 +58,6 @@ public enum SpecificAccountUType {
6358

6459
void setLendingRate(String lendingRate);
6560

66-
@ApiModelProperty(value = "Fully described lending rates for this account based on the equivalent structure in Product Reference")
67-
List<BankingProductLendingRateV1> getLendingRates();
68-
69-
void setLendingRates(List<BankingProductLendingRateV1> lendingRates);
70-
7161
@ApiModelProperty
7262
BankingLoanAccount getLoan();
7363

data-holder/src/main/java/au/org/consumerdatastandards/holder/model/banking/BankingAccountDetailV1.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ public class BankingAccountDetailV1 implements BankingAccountDetail {
122122
/**
123123
* Array of features of the account based on the equivalent structure in Product Reference with the following additional field
124124
*/
125-
@OneToMany
125+
@OneToMany(cascade = CascadeType.ALL)
126+
@JoinTable(
127+
name = "banking_account_features",
128+
joinColumns = @JoinColumn(name = "banking_account_id"),
129+
inverseJoinColumns = @JoinColumn(name = "feature_id"))
126130
private List<BankingAccountProductFeature> features;
127131

128132
/**
@@ -151,11 +155,19 @@ public class BankingAccountDetailV1 implements BankingAccountDetail {
151155
private List<BankingProductLendingRateV1> lendingRates;
152156

153157
@ManyToOne
158+
@JoinTable(
159+
name = "b_account_loans",
160+
joinColumns = @JoinColumn(name = "account_id"),
161+
inverseJoinColumns = @JoinColumn(name = "loan_id"))
154162
private BankingLoanAccount loan;
155163

156164
private SpecificAccountUType specificAccountUType;
157165

158166
@OneToMany
167+
@JoinTable(
168+
name = "b_account_term_deposits",
169+
joinColumns = @JoinColumn(name = "account_id"),
170+
inverseJoinColumns = @JoinColumn(name = "term_deposit_id"))
159171
private List<BankingTermDepositAccount> termDeposit;
160172

161173
@Override
@@ -420,13 +432,11 @@ public BankingAccountDetail addItem(BankingProductDepositRateV1 depositRatesItem
420432
return this;
421433
}
422434

423-
@Override
424435
@ApiModelProperty(value = "Fully described deposit rates for this account based on the equivalent structure in Product Reference")
425436
public List<BankingProductDepositRateV1> getDepositRates() {
426437
return depositRates;
427438
}
428439

429-
@Override
430440
public void setDepositRates(List<BankingProductDepositRateV1> depositRates) {
431441
this.depositRates = depositRates;
432442
}
@@ -508,13 +518,11 @@ public BankingAccountDetail addItem(BankingProductLendingRateV1 lendingRatesItem
508518
return this;
509519
}
510520

511-
@Override
512521
@ApiModelProperty(value = "Fully described lending rates for this account based on the equivalent structure in Product Reference")
513522
public List<BankingProductLendingRateV1> getLendingRates() {
514523
return lendingRates;
515524
}
516525

517-
@Override
518526
public void setLendingRates(List<BankingProductLendingRateV1> lendingRates) {
519527
this.lendingRates = lendingRates;
520528
}

data-holder/src/main/java/au/org/consumerdatastandards/holder/model/banking/BankingAccountDetailV3.java

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,16 @@ public class BankingAccountDetailV3 implements BankingAccountDetail {
110110
name = "banking_account_deposit_rates",
111111
joinColumns = @JoinColumn(name = "banking_account_id"),
112112
inverseJoinColumns = @JoinColumn(name = "deposit_rate_id"))
113-
private List<BankingProductDepositRateV1> depositRates;
113+
private List<BankingProductDepositRateV2> depositRates;
114114

115115
/**
116116
* Array of features of the account based on the equivalent structure in Product Reference with the following additional field
117117
*/
118-
@OneToMany
118+
@OneToMany(cascade = CascadeType.ALL)
119+
@JoinTable(
120+
name = "banking_account_features",
121+
joinColumns = @JoinColumn(name = "banking_account_id"),
122+
inverseJoinColumns = @JoinColumn(name = "feature_id"))
119123
private List<BankingAccountProductFeature> features;
120124

121125
/**
@@ -141,14 +145,22 @@ public class BankingAccountDetailV3 implements BankingAccountDetail {
141145
name = "banking_account_lending_rates",
142146
joinColumns = @JoinColumn(name = "banking_account_id"),
143147
inverseJoinColumns = @JoinColumn(name = "lending_rate_id"))
144-
private List<BankingProductLendingRateV1> lendingRates;
148+
private List<BankingProductLendingRateV2> lendingRates;
145149

146150
@ManyToOne
151+
@JoinTable(
152+
name = "b_account_loans",
153+
joinColumns = @JoinColumn(name = "account_id"),
154+
inverseJoinColumns = @JoinColumn(name = "loan_id"))
147155
private BankingLoanAccount loan;
148156

149157
private SpecificAccountUType specificAccountUType;
150158

151159
@OneToMany
160+
@JoinTable(
161+
name = "b_account_term_deposits",
162+
joinColumns = @JoinColumn(name = "account_id"),
163+
inverseJoinColumns = @JoinColumn(name = "term_deposit_id"))
152164
private List<BankingTermDepositAccount> termDeposit;
153165

154166
@Override
@@ -408,27 +420,25 @@ public void setDepositRate(String depositRate) {
408420
this.depositRate = depositRate;
409421
}
410422

411-
public BankingAccountDetail depositRates(List<BankingProductDepositRateV1> depositRates) {
423+
public BankingAccountDetail depositRates(List<BankingProductDepositRateV2> depositRates) {
412424
this.depositRates = depositRates;
413425
return this;
414426
}
415427

416-
public BankingAccountDetail addItem(BankingProductDepositRateV1 depositRatesItem) {
428+
public BankingAccountDetail addItem(BankingProductDepositRateV2 depositRatesItem) {
417429
if (this.depositRates == null) {
418430
this.depositRates = new ArrayList<>();
419431
}
420432
this.depositRates.add(depositRatesItem);
421433
return this;
422434
}
423435

424-
@Override
425436
@ApiModelProperty(value = "Fully described deposit rates for this account based on the equivalent structure in Product Reference")
426-
public List<BankingProductDepositRateV1> getDepositRates() {
437+
public List<BankingProductDepositRateV2> getDepositRates() {
427438
return depositRates;
428439
}
429440

430-
@Override
431-
public void setDepositRates(List<BankingProductDepositRateV1> depositRates) {
441+
public void setDepositRates(List<BankingProductDepositRateV2> depositRates) {
432442
this.depositRates = depositRates;
433443
}
434444

@@ -496,27 +506,25 @@ public void setLendingRate(String lendingRate) {
496506
this.lendingRate = lendingRate;
497507
}
498508

499-
public BankingAccountDetail lendingRates(List<BankingProductLendingRateV1> lendingRates) {
509+
public BankingAccountDetail lendingRates(List<BankingProductLendingRateV2> lendingRates) {
500510
this.lendingRates = lendingRates;
501511
return this;
502512
}
503513

504-
public BankingAccountDetail addItem(BankingProductLendingRateV1 lendingRatesItem) {
514+
public BankingAccountDetail addItem(BankingProductLendingRateV2 lendingRatesItem) {
505515
if (this.lendingRates == null) {
506516
this.lendingRates = new ArrayList<>();
507517
}
508518
this.lendingRates.add(lendingRatesItem);
509519
return this;
510520
}
511521

512-
@Override
513522
@ApiModelProperty(value = "Fully described lending rates for this account based on the equivalent structure in Product Reference")
514-
public List<BankingProductLendingRateV1> getLendingRates() {
523+
public List<BankingProductLendingRateV2> getLendingRates() {
515524
return lendingRates;
516525
}
517526

518-
@Override
519-
public void setLendingRates(List<BankingProductLendingRateV1> lendingRates) {
527+
public void setLendingRates(List<BankingProductLendingRateV2> lendingRates) {
520528
this.lendingRates = lendingRates;
521529
}
522530

0 commit comments

Comments
 (0)