This is a java
application for authorizing banking transaction based on a set predefined rules.
The program receives json
lines as inputs that are read from operations
file at
"/src/main/java/resources/operations". As output, the program provides json
lines for each given input
โ imagine this as a stream of events arriving at an authorizer consumer.
- Java (OpenJDK 15+) (instruction)
- Maven (3.6.3+) (instructions)
- Your favorite IDE (the recommended one is IntelliJ Community Edition).
In this project's root directory, run:
mvn clean install
AuthorizerApplication
is the project's main file.
So, in order to run application, execute:
mvn exec:java -Dexec.mainClass=transaction.authorizer.AuthorizerApplication
The application reads all transaction inputs inside "/src/main/java/resources/operations"
, and produces a output
file in the project's root directory.
If you want to test application against other transaction inputs, feel free to change
content inside "/src/main/java/resources/operations"
, and re-run application.
You may run the project by executing AuthorizerApplication
via Intellij as follows:
Let's talk about the structure or architecture of the application. The project has been separated into the following layers:
- Main Application (AuthorizerApplication) starts application, and setups input and output files.
- Consumers receive and handle transaction events.
- Services process transaction events by applying a set of predefined rules, and producing an output for each event.
- Models represent the domain that we're using within the application (e.g.,
Account
, andTransaction
).