Code Monkey home page Code Monkey logo

product-managment's Introduction

Product Managment

Product Managment Test

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

JWT_SECRET: jwt secret for the firm

DB_URL: url to the database

Deployment

To deploy this project run

  git add .
  git commit -m "commit"
  git push origin dev
  create pull request to master
  deploy to docker hub

Installation

Install product-management with npm

  cd product-management
  npm i
  npm run start

API Reference

Authentication

Login

Description: this endpoint is used to authenticate with the system via email and password, it will return the access token and username.

  POST {{baseUrl}}/auth/login
Parameter Type Description
email string Required. email user
password string Required. password user

Products

Create Product

Description: this end point is used to create a new product and add to store.

  POST {{baseUrl}}/products
Parameter Type Description
name string Required. name product
price decimal Required. price product
description string Required. description product
storeId integer Required. Id store
stock integer Required. stock of product

Get Products

Description: this endpoint is used to obtain all registered products.

  GET {{baseUrl}}/products 

Get Product

Description: this endpoint is used to obtain a single product if it is registered.

  GET {{baseUrl}}/products/{{productId}}
Parameter Type Description
productId integer Required. id product

Update Product

Description: this endpoint is used to update the data of a product.

  PUT {{baseUrl}}/products/{{productId}} 
Parameter Type Description
productId integer Required. id product
name string Required. name product
price decimal Required. price product
description string Required. description product
storeId integer Required. Id store
stock integer Required. stock of product

Delete Product

Description: this end point is used to eliminate a product.

  DELETE {{baseUrl}}/products/{{productId}}
Parameter Type Description
productId integer Required. id product

Stores

Create Store

Description: this endpoint is used to create a new locale.

  POST {{baseUrl}}/stores 
Parameter Type Description
name string Required. name store
address string Required. address store
phone integer Required.phone store example: +5601235678908

Get Stores

Description: this endpoint is used to get all registered stores.

  GET {{baseUrl}}/stores 

Get Store

Description: this endpoint is used to obtain a store if it is registered.

  GET {{baseUrl}}/stores/{{storeId}} 
Parameter Type Description
storeId integer Required. id store

Update Store

Description: this endpoint is used to update the data of a store.

  PUT {{baseUrl}}/stores/{{storeId}}
Parameter Type Description
storeId integer Required. id store
name string Required. name store
address string Required. address store
phone integer Required.phone store example: +5601235678908

Delete Store

Description: this end point is used to eliminate a store.

  DELETE {{baseUrl}}/stores/{{storeId}} 
Parameter Type Description
storeId integer Required. id store

product-managment's People

Contributors

ferreiramarques avatar

Watchers

 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.