Giter Site home page Giter Site logo

shipment-management's Introduction

shipment-management

Shipment management project for interview.

1. Reqirement

Post Trade:

  • post a trade with title and goods quantity.

query all trades:

  • query all the post trades.

query all the shipments in a trade:

  • At frist, a trade has one shipment.
  • After spliting and merging, there are many shipments in a trade.

change the quantity of a trade:

  • change the goods quantity of a trade.
  • the shipments' quantity in the trade will be chagned proportionally.

split a shipment:

  • Split a shipment in multi shipments.
  • split shipments' quantity sum equals to the original shipment quantity.

merge some shipments into one shipment:

  • Merge two or more shipments in a trade into one shipment.

2. Design

Datebase

  • Using H2 Database in memory.
  • Two tables: Trade and Shipment.

I18N

  • For WebException Messages.
  • For Enum item Names.

Exception

  • WebServiceException include the api exceptions.

API

API document and test: Swagger. http://localhost:8080/swagger-ui.html

API response class: ModelJsonRespone.

  • code:0 = error, 1 = success, -11 = wrong param, -12 = access deney
  • errorNo: exceptionNo in WebServiceException.
  • errorDesc: i18n exception message.
  • result: the api data according to the biz.

3. Test

Data initialized in launch, include one trade and five shipments (1 root shipment, 3 split shipments, 1 merged shipment).

JUnit test, include: Please start the application in advanced.

  • service test cases.
  • WebServiceException test cases.
  • controller test cases.

4. Deployment

  • JDK 1.8
  • Maven 3.x.
  • SpringBoot jar emmbeded tomcat.

shipment-management's People

Contributors

garyyincode avatar

Watchers

James Cloos avatar

Forkers

junxin

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.