Skip to content

smerik/aggregation-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aggregation Service

The aggregation service is aggregating data from various API endpoints. This aggregated data can be used by a frontend project for example.

Dependencies

This project depends on the Power of Attorney Service, which is available at https://github.com/Aldrion/json-stub. This means that the mentioned project needs to be both running and reachable when making use of the Aggregation Service.

Requirements

The aggregation service has been implemented with the following requirements:

  • Aggregate all data that is linked to a power of attorney.
  • Account
    • Only an active account is visible
    • An account is not active anymore when the current date is after the end date.
    • The account linked to the power of attorney is only visible when it is owned by the grantor.
  • Cards
    • A card can be either a credit card or debit card type.
    • Only the card types where the user has been authorized for are visible.
    • Only an active card is visible
    • A card is not active when its status is not ACTIVE. For example when the status is BLOCKED.
  • Exceptions
    • Do not expose internal API server errors to the outside world.

Configuration

The application configuration is using the embedded application.properties by default. You might want to change the Power of Attorney Service API location in here.

Building from source

In case you don't have the project jar file the application needs to be compiled first.

Prerequisites

The application should be able to compile & run with the versions:

  • Java 11
  • Maven 3.6.3

Compile

In case you need to compile the application just do the following:

$ mvn clean package

Running the application

You can run this Spring Boot application in multiple ways, which is also mentioned on https://docs.spring.io/spring-boot/docs/current/reference/html/using-spring-boot.html#using-boot-running-your-application.

Running as a Packaged Application

You can run the application using java -jar, as shown in the following example:

  $ java -jar target/aggregation-service-2020.0.0-SNAPSHOT.jar

Using the Maven Plugin

The Spring Boot Maven plugin includes a run goal that can be used to quickly compile and run your application. Applications run in an exploded form, as they do in your IDE. The following example shows the Maven command to run the Spring Boot application:

  $ mvn spring-boot:run

API

Once the application has been started you can check out the API by using Swagger. This can be done by opening the following link: http://localhost:8181/swagger-ui.html.

If you're not interested in exploring the API via Swagger, you can try the following calls:

Development

  • Don't add non project related generated files into the project .gitignore file. For example files that are generated by your tools and operating system should be in your global .gitignore file.

Aggregation Service Project ideas & improvements

  • PowerOfAttorneyServiceClient: Move either into a separate Maven module, make it part of the Power of Attorney Service project or even into a separate project on its own.
  • Validation on authorizations, active accounts & products is hard coded within the service. Maybe use some sort of Spring (Security) filtering for authorizations & active objects?
  • Do something with authorization type VIEW.
  • Improve performance of the API by using async REST calls to the Power of Attorney Service (e.g. By using Spring WebFlux.)
  • Improve exception handling.
  • Improve/expand controller test.
  • Introduce Cucumber tests to make the tests more human readable and see if the project meets the requirements.

Power of Attorney Service shortcomings

The Power of Attorney Service contains a couple of errors and is missing some documentation.

API

It would have been nice the Accounts API uses an International Bank Account Number (IBAN) as identifier. All power of attorneys use an IBAN value for their account field. This means that the account number needs to be extracted from the IBAN first to be able to use the Accounts API.

Swagger

The following data is missing from the Swagger documentation page:

  • Endpoint /accounts/{id}
  • Field status on cards
  • Model Status enum used on cards

Mock data

  • Account 123123123 contains a faulty owner value. This results into account data not being shown on the related power of attorney.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages