This Application processes the transaction statements and generates report of failed records
Rabobank receives monthly deliveries of customer statement records. This information is delivered in two formats, CSV and XML. These records need to be validated.
The format of the file is a simplified version of the MT940 format. The format is as follows:
Table 1. Record description Field Description
Transaction reference A numeric value
Account number
An IBAN
Start Balance The starting balance in Euros
Mutation Either an addition (+) or a deduction (-)
Description
Free text
End Balance The end balance in Euros
There are two validations:
all transaction references should be unique
the end balance needs to be validated
At the end of the processing, a report needs to be created which will display both the transaction reference and description of each of the failed records.
- Java8
- Spring boot
- Spring batch
- Mysql
- Docker
-
Build: mvn clean install
-
run Mysql on Docker :
docker-compose up
-
run batch_Scripts.sql file from the mysql_Scripts directory for spring batch tables.
-
For running the application use:
mvn spring-boot:run -Dspring-boot.run.profiles=dev
http://localhost:8095/transaction-statements/process
Get Method
Response:
DESCRIPTION,REFERENCEID
Subscription for Erik Dekker,189177
Subscription for Erik Theuß,163215
It return the csv response which can be saved from postman, send and download button.
-
Records have been read from the XML file.
-
Assuming that the records already saved in the database will have unique reference id, hence records have not been validates against the one in the database.
Spring batch processes the records from the xml file and validates the records and saves the valid record in the database and saves the inValid records in the Job Execution Context.
Once the Batch completes, then CSV data is generated for the failed records.
Valid Records are saved in TransactionStatement table.