Giter Club home page Giter Club logo

accounts-service's Introduction

Reference Documentation

  • how to test accounts-service
  1. ./docker-compose-up.sh
  2. mvn flyway:migrate -Dflyway.url=jdbc:postgresql://localhost:5432/account_service -Dflyway.user=account-service -Dflyway.password=account-s3rv1c3
  3. Execute curl's commands listed below.
  • how to run intetration-test accounts-service
  1. ./docker-compose-only-db-up.sh
  2. mvn flyway:migrate -Dflyway.url=jdbc:postgresql://localhost:5432/account_service -Dflyway.user=account-service -Dflyway.password=account-s3rv1c3

Endpoints

Method Url Description
POST /accounts create an account with these required parameters.
Ex request body:

{
document_number: '12345678900' ,
mobile: '11985733234',
email: '[email protected]'
}
GET /accounts/{id} get account by id
POST /transactions create a transaction with these required parameters.
Ex request body:

{
account_id: 1 ,
operation_type_id: 4,
amount: 123.45
}

Curl comands

1- Create Account curl -d '{ "document_number": "12345678900" , "mobile": "11985733234", "email": "[email protected]" }' -H 'Content-Type: application/json' http://localhost:8300/accounts-service/accounts

2- Get Account By Id curl -v http://localhost:8300/accounts-service/accounts/5

3- Create Transaction curl -d '{ "account_id": 5 , "operation_type_id": 4, "amount": 123.45 }' -H 'Content-Type: application/json' http://localhost:8300/accounts-service/transactions

Docker - generate new image

mvn spring-boot:build-image -DskipTests

Comandos para migração de dados com Flyway

mvn flyway:migrate -Dflyway.url=jdbc:postgresql://localhost:5432/account_service -Dflyway.user=account-service -Dflyway.password=account-s3rv1c3
1) Primeira vez rode:
    mvn compile flyway:migrate

2) Para as proximas vezes rode    
    mvn clean flyway:migrate

hot swap dev environment for intellij

    A solution that uses devTools works :
    
    1 - Adding devtools to your project
    
        org.springframework.boot
        spring-boot-devtools
    
    2- Enabling automatic build
    Open the Settings --> Build-Execution-Deployment --> Compiler and enable :
    
    Build Project Automatically.
    3- Update the value of compiler.automake.allow.when.app.running
    press ctrl+shift+A and search for the registry. In the registry, enable :
    
    compiler.automake.allow.when.app.running
 

accounts-service's People

Contributors

mhbpcuiaba avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.