axsilva1991 / challenge-developper-api-rest

This repository is a implementation an academic project for the creation of a fictitious digital bank.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

challenge-developper-api-rest

Build

This repository is a implementation an academic project for the creation of a fictitious digital bank.

Functional requirements for challenge

You need to create a digital bank when:

  • It must be possible to create and remove holder
    • a holder must contain only your name and Document Number
    • The Document Number must be valid and unique in the registration of holder
  • The digital accounts must contain the following features:
    • The account must be created using the Document Number do holder
    • An account must have its balance, number e agency available for Query
    • Required for find history balance account from per period
    • A holder can close the digital account at any time
    • Perform withdrawal and deposit operations
      • Deposit is released to all active and unlocked accounts
      • Withdrawal is allowed for all active and unlocked accounts as long as there is available balance and does not exceed the daily limit of 2 thousand R$

Mandatory regulation

  • We need to lock and unlock the digital account at any time
  • The digital account can never have the negative balance

Api-Rest

Requirements for Run Application

  • Docker
  • Docker Compose
  • Kubernetes node cluster
  • RestAPI Client's for example: (Postman/Insomnia)
  • Access Internet for gradlew dependency's download

Usage

Run the app anyway

Docker

Run

$ cd .\challenge-developper-api-rest_webapp\
$ docker-compose up --build -d

Shut down

cd .\challenge-developper-api-rest_webapp\
$ docker-compose down
Kubernetes

Run command for create service

$ cd .\challenge-developper-api-rest_webapp\
$ .\kubernetes> kubectl apply -f .\kubernetes\service.yaml
service/challenge-developper-api-rest-webapp-svc created

Run command for create deployment

$ cd .\challenge-developper-api-rest_webapp\
$ .\kubernetes> kubectl apply -f .\kubernetes\deployment.yaml
deployment.apps/challenge-developper-api-rest-webapp-k8s created

After run this commands access swagger to validate application its ok.

Test

For test api's you need to import postman collection.json

If you need click here to know how to import the collections in postman.

Atention
Because it is a integration test, it's work's if you run one time!
if you need to re-execute it, it is recommended to clean the database or restart the application.

Run integration test:
  • 1 - Click on the button marked to the left with the number one.
  • 2 - Click Run Screenshot
  • 3 - Click Run Digital Account Screenshot
  • 4 - After Run the test's. you can view the results Screenshot

Documentation

This project Using OpenAPI 3.0 specification if you whant to see a doc open swagger-ui in your Browser

About

This repository is a implementation an academic project for the creation of a fictitious digital bank.


Languages

Language:Kotlin 99.3%Language:Dockerfile 0.7%