GithubHelp home page GithubHelp logo

deposit-service's Introduction

Customer

There are 2 customers known by the application: tesla and apple.
A Basic auth mechanism is set up to authenticate api users:

  • Tesla: tesla-uuid/tesla-password
  • Apple: apple-uuid/apple-password

User

There are 4 users known by the application:

  • apple-user1-uuid belongs to apple-uuid company
  • apple-user2-uuid belongs to apple-uuid company
  • tesla-user1-uuid belongs to tesla-uuid company
  • tesla-user2-uuid belongs to tesla-uuid company

Balance

When starting the application:

  • Tesla has a balance of 1000€
  • Apple has a balance of 2000€.

Application

Note that the application (deposit-service) is focused ONLY on Deposit.
It's not focused on other domain model such as Customer, User or Balance.
When starting the application, an in-memory H2 database is created (see schema.sql) and populated (see data.sql)
Database is owned by deposit-service and consequently contains only tables related to Deposit. (We try to stick to DDD)

OpenAPI & Swagger UI

The OpenApi standard was used to describe the REST API.
Additionally, a self-configured UI is available at: http://localhost:8080/swagger-ui/index.html
Note : you will need to use the basic auth credentials to authenticate. (see above)

Test

Some unit and integration tests are available on test/java folder.

Exercice

  • Implement one or two functions allowing companies to distribute gift and meal deposits to a user if the company balance allows it.
    • On swagger ui, please use POST api/v1/deposits
  • Implement a function to calculate the user's balance.
    • Please use GET api/v1/deposits?userId=...
    • Then api client must map + reduce the deposit list to get the current balance
    • Example in DepositServiceApplicationTests.shouldAddMultipleDeposits()
    • // 6/ Calculate the tesla-user1-uuid balance

deposit-service's People

Watchers

Clément.Tréguer 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.