- User - Owner of a Transaction. For simplicity exists as a column in Transaction only
- Transaction - Record of money transaction of a User
- Bonus Program - Has start date, end date and some rules how bonuses assigned. Bonus Programs are independent and can be run in parallel. Transaction is valid for Bonus Program only if it was created within active period of Bonus Program
- Bonus Rules - Logic for assigning bonuses. In this case we have only implementation based on thresholds
Requires Java 17 to run
Run command
- mvn spring-boot:run
Application will start on port 8080
All exposed rest endpoints are available via link
Get list of all users
Get list of transaction of John starting July 1 ending September 30
Get transaction statistic of John starting July 1 ending September 30
Get list of bonus programs
Get bonus statistic of John for bonus program "TestProgramOne"
Liquibase is used to create db schema Please check db.changelog-master.xml for details
Initial data loaded from CSV file in resource folder. TransactionPopulationJobConfiguration.java responsible for loading initial data it uses spring batch to load data. You can read more about it on https://spring.io/guides/gs/batch-processing/