Skip to content

Latest commit

 

History

50 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Banking card management system

Description

Backend of banking card management application.

Prerequisites

The runtime environment contains packages:

  • Java SE 21 development and runtime platform;
  • Docker containerization platform;
  • Apache Maven build tool.

All commands are run in the terminal from the project folder Bank_REST/.

No initial setup is required.

Build package

The project is built using the shell command:

mvn clean package

Upon successful build, the results will be located in the folder target/

Run package

To run the package, execute the following commands in the project folder:

docker compose --project-directory ./docker/ up --detach

Upon successful package startup, docker will run 2 containers cards-microservice, postgres-container in the Up status.

Usage Instructions

The package functionality is accessed via the URL:

<METHOD> http://localhost:8081/api/<endpoint>

Where <endpoint> represents a specific API resource. Depending on the chosen <METHOD>, the package will initiate corresponding command.

A detailed API description is available at:

GET http://localhost:8081/swagger-ui/index.html

The package uses JWT-based authentication. To obtain a token, send a request to:

POST http://localhost:8081/api/login

This authentication endpoint expects input data as a JSON object in the following format:

  { 
    "email": "<email address>", 
    "password": "<password>" 
  }

Upon successful authentication, the access_token will be returned in the response body. Using this token, and based on the roles assigned during registration, the user will have access to the users, cards, and transfers resources.

${users}$ resource commands

  • The command to register a new user is invoked using the HTTP POST method. The command expects input data as an object in the following JSON notation:
  { 
    "email": "<email address>", 
    "password": "<password>",
    "roles": ["role1","..."] 
  }

Successful execution of this command results in the creation of a user account.

  • The command to delete a user is invoked using the HTTP DELETE method. The command expects input data as the following request parameters:
   email = <email address>

Successful execution of this command ensures that the user account no longer exists.

  • The command to update a user record is invoked using the HTTP PUT method. The command expects input data as an object in the following JSON notation:
  { 
    "email": "<email address>",
    "password": "<password>",
    "roles": ["role1","..."]
  }

Successful execution of this command results in the update of the user account.

  • The command to retrieve a list of users is invoked using the HTTP GET method. The command expects input data as the following request parameters:
   email = [email address]
   offset = [search result offset]
   limit = [search result page size]

Successful execution of this command returns a list of users that matches the criteria specified in the request body.

${cards}$ resource commands

  • The command to create a bank card is invoked using the HTTP POST method. The command expects input data as an object in the following JSON notation:
 {
   "pan": "<#### #### ##### ####>",
   "expire_date": "[yyyy-MM-dd]",
   "email": "<email address>",
   "status": "[card status]", 
   "balance": "[card balance]"
 }

Successful execution of this command results in the creation of a bank card record.

  • The command to retrieve a list of bank cards is invoked using the HTTP GET method. The command expects input data as the following request parameters:
   offset = [search result offset]
   limit = [search result page size]

Successful execution of this command returns a list of session user banking cards.

  • The command to update bank card details is invoked using the HTTP PUT method. The command expects input data as an object in the following JSON notation:
 {
   "pan": "<#### #### ##### ####>",
   "expire_date": "[yyyy-MM-dd]",
   "status": "[card status]",
   "balance": "[card balance]"
 }

Successful execution of this command results in the update of the bank card record based on the existing Primary Account Number.

  • The command to block a bank card is invoked using the HTTP PATCH method. The command expects input data as an object in the following JSON notation:
 {
   "pan": "<#### #### ##### ####>"
 }

Successful execution of this command results in a change to the bank card status based on the existing Primary Account Number.

  • The command to delete a bank card is invoked using the HTTP DELETE method. The command expects input data as the following request parameters:
   pan = <#### #### ##### ####>

Successful execution of this command results in the deletion of the bank card record based on the existing Primary Account Number.

${transfers}$ resource commands

  • The command to transfer funds is invoked using the HTTP POST method. The command expects input data as the following request parameters:
  origin = <#### #### #### ####>
  destination = = <#### #### #### ####>
  amount = <number>

Successful execution of this command results in the creation of a transaction record and the adjustment of card balances for the current session user.

${tokens}$ resource commands

  • The command of reissuing access token is invoked using the HTTP POST method. Prior of using this resource user has to have active session. Successful execution of this command results in refreshing the expiry date of user access_token.

About

Banking card management system

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages