Code Monkey home page Code Monkey logo

carlease-car-service's Introduction

Car Service for Carlease assignment

Functionality

RESTFull webservice facilitating CRUD operations on a Customer datastore using Spring REST repositories for this service. Endpoints require a valid JWT issued by an API-gateway sharing the same secret

URL mapping

  • Phase 1: Basic URL mapping docs
  • Phase 2: Swagger docs / REST Docs
- [x] GET:    {domain}/cars       - returns al cars
- [x] GET:    {domain}/cars/{id}  - returns specific cars
- [x] POST    {domain}/cars       - create new cars
- [x] DELETE: {domain}/cars/{id}  - delete specific cars
- [x] PUT:    {domain}/cars/{id}  - update specific cars
- [x] GET:    {domain}/cars/{id}/leaserate?{mileage,interest,duration} - calculculates leaserate for given car. required parameters

Sample POST/PUT Body

{
  "make": "volkswagen",
  "model": "golf",
  "version": "gte",
  "doorCount": 4,
  "co2Emission": 123.45,
  "grossPrice": 42000,
  "nettPrice": 35000
}

Run application

This service currently runs on port 9092

In development use dev profile:

mvn spring-boot:run -Dspring-boot.run.profiles=dev

Authentication

This service requires a valid JWT to use any endpoint, the JWT must contain a expiration, exp, claim

When not using an authentication service to create a valid token got to jwt.io set the expiration "exp" claim to later than current UTC and use a secret in the dev profile:

JWT payload example

{
  "sub": "1234567890",
  "name": "Jaap Test",
  "exp": 1824003711
}

carlease-car-service's People

Contributors

remideboerhva avatar

Watchers

Rémi de Boer 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.