Git Product home page Git Product logo

kata-hublo-shop's Introduction

Hublo Shop (in NestJS)

Introduction

Hublo has decided to launch a shop to sell equipments for Hublers. In this Kata you will implement Hublo shop Rest API.

In this Kata you will be asked to use your knowledge in NestJs and Rest API to build this API following all the business rules. It offers a set of features to practice your API programming skills. It covers basic HTTP verbs and codes.

Requirements

  • REST API design
  • NestJS
  • Software design

Features

  • Shopping API with products, orders and bills.

Business Rules

Products

A product can be:

  • created
  • updated
  • found by id
  • deleted

Definition

A product have a(n):

  • id
  • name
  • price
  • weight

Rules

Products can be sorted by name, price or weight

  • Products name must be longer than 3 characters or throw an error if shorter
  • Products id cannot be updated
  • Product can be managed by an admin or employee role

Orders

Can be : created, listed, updated and deleted

Definition

Order have:

  • a status
  • a product list with a quantity per product
  • a shipment amount
  • a total amount and a weight

Rules

  • Orders status can be pending, paid or canceled

  • Are offered 5% discount when the price exceeds 1000€

  • Shipment costs 25€ for every 10 more kg (50€ for 20kg, 75€ for 30kg, etc.)

  • Order can only be created by customer role

Bills

Can be listed

Definition

Have an:

  • amount
  • creation
  • date

Rules

  • Are automatically generated when an order status is set to paid
  • Bills can only be deleted by admin role

Code

Advices

Class validator

You can use decorator from this package to validate your input data. see class validator

Class transformer

You can use class transformer to transform domain object into DTO.

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.