All Classes and Interfaces

Class
Description
CalculatePointsFunction calculate the total points
for a transaction using the formula
DataLoader loads batch data into the database using the repository
by reading a file in src/main/resources/rewards-api_transaction-list.json
if the file is not present, calls DataWrangler to generate the file
DataWrangler generates sample data for transactions
ErrorController to catch unknown errors
causing 404 responses to be thrown by
spring-mvc or the RestController
GlobalExceptionHandler handles exceptions thrown
by the RestController by preparing a suitable
JSON Map and returning a ResponseEntity
MonthlyRewardsFunction provides the business logic
to transform a transaction query into an ApiResult.
QueryService provides JDBC flavored persistence
contains the sql queries and executes prepared statements
returning data to the RewardsService
RewardsApi SpringBoot Application
RewardsController is the RestController for the API
provides the Rest API endpoints
- http://localhost:8080/api/v1/rewards
- http://localhost:8080/api/v1/rewards/{month}
- http://localhost:8080/api/v1/rewards/{month}/{customerId}
- http://localhost:8080/api/v1/rewards/{firstMonth}/{customerId}/{lastMonth}
RewardsService contains the primary business logic at the service layer calls the QueryService to retrieve transaction data returns apiResponse to the RestController
TransactionRepository used by the DataLoader
to load the tranaction batch
at application startup
JDBC style @Table with lombok style @Data and @NoArgsConstructor to support Jackson