Giter Site home page Giter Site logo

java-orders-mysql's Introduction

java-orders-mysql

Introduction

This is a basic database scheme with customers, orders, and sales agents.

Instructions

Create a REST api server to store and read data from the provided SQLite Database called orders.db. The database is adapted from the sample database found at https://www.w3resource.com/sql/sql-table.php. This a continuation of the java-orders-swagger project. We are taking the java-orders-swagger project and converting it to MySQL.

The table layouts are as follows

  • AGENTS

    • AGENTCODE primary key, not null Long
    • AGENTNAME string
    • WORKINGAREA string
    • COMMISSION double
    • PHONE string
    • COUNTRY string
  • CUSTOMERS

    • CUSTCODE primary key, not null Long
    • CUSTNAME String, not null
    • CUSTCITY String
    • WORKINGAREA String
    • CUSTCOUNTRY String
    • GRADE String
    • OPENINGAMT double
    • RECEIVEAMT double
    • PAYMENTAMT double
    • OUTSTANDINGAMT double
    • PHONE String
    • AGENTCODE long foreign key (one agent to many customers) not null
  • ORDERS

    • ORDNUM primary key, not null Long
    • ORDAMOUNT double
    • ADVANCEAMOUNT double
    • CUSTCODE long foreign key (one customer to many orders) not null
    • AGENTCODE long foreign key (one agent to many orders) not null
    • ORDDESCRIPTION
  • Create a schema (the data.sql script assumes that it is called customerorders. If it is not, update the script before running it!)

  • Create the entities needed to store this data

  • Use the provided data.sql to populate

  • End points should return the data they worked with or nothing if no data was found

  • Swagger should be used to document your API. The default documentation generated by Swagger is sufficient.

Expose the following end points

  • GET /customers - returns all the customer

  • GET /orders - return all the orders

  • GET /agents - return all the agents

  • GET /customers/custcode/{custcode}

  • GET /orders/ordnum/{ordnum}

  • GET /agents/agentcode/{agentcode}

  • POST /customers - adds a customer

  • POST /orders - adds an order

  • POST /agents - adds an agent

  • PUT /customers/custocode/{custcode} - updates a customer based on custcode

  • PUT /orders/ordnum/{ordnum} - updates an order based on ordnum

  • PUT /agents/agentcode/{agentcode} - updates an agent based on ordnum

  • DELETE /customers/custcode/{custcode} - Deletes a customer based off of their custcode and deletes all their associated orders

  • DELETE /orders/ordnum/{ordnum} - deletes an order based off its ordnum

  • DELETE agents/agentcode/{agentcode} - Deletes an agent if they are not assigned to a customer or order (Stretch Goal)

  • /customers/order - Returns all customers with their orders

  • /customers/name/{custname} - Returns all orders for a particular customer based on name

  • /customers/order/{custcode} - Returns all orders for a particular customer based on custcode

  • /agents - Returns all agents with their customers

  • /agents/orders - Return a list with the agents name and associated order number and order description

  • /customers/{custcode} - Deletes a customer based off of their custcode and deletes all their associated orders

  • /agents/{agentcode} - Deletes an agent if they are not assigned to a customer or order (Stretch Goal)

  • Expose at least the following the actuator endpoints to help with system mangagement

    • /health

    • /inf

    • /metrics

    • Stretch goal - update each of these three actuator endpoints to report your own messages.

java-orders-mysql's People

Contributors

jrmmba8314 avatar

Watchers

 avatar  avatar  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.