Code Monkey home page Code Monkey logo

sql-coursework-week3's Introduction

Homework

Submission

You can continue working on the code from last week for this weeks task.

Copy over all of your code to this folder now.

To submit you should open a pull request with all of your code in this folder.

Task

In the following homework, you will create new API endpoints in the NodeJS application cyf-ecommerce-api that you created for last week homework for the Database 2 class.

  • If you don't have it already, add a new GET endpoint /products to load all the product names along with their supplier names.

  • Update the previous GET endpoint /products to filter the list of products by name using a query parameter, for example /products?name=Cup. This endpoint should still work even if you don't use the name query parameter!

  • Add a new GET endpoint /customers/:customerId to load a single customer by ID.

  • Add a new POST endpoint /customers to create a new customer.

  • Add a new POST endpoint /products to create a new product (with a product name, a price and a supplier id). Check that the price is a positive integer and that the supplier ID exists in the database, otherwise return an error.

  • Add a new POST endpoint /customers/:customerId/orders to create a new order (including an order date, and an order reference) for a customer. Check that the customerId corresponds to an existing customer or return an error.

  • Add a new PUT endpoint /customers/:customerId to update an existing customer (name, address, city and country).

  • Add a new DELETE endpoint /orders/:orderId to delete an existing order along all the associated order items.

  • Add a new DELETE endpoint /customers/:customerId to delete an existing customer only if this customer doesn't have orders.

  • Add a new GET endpoint /customers/:customerId/orders to load all the orders along the items in the orders of a specific customer. Especially, the following information should be returned: order references, order dates, product names, unit prices, suppliers and quantities.

sql-coursework-week3's People

Contributors

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