Giter Site home page Giter Site logo

vendingmachine's Introduction

Vending Machine Backend API Documentation

Table of Contents

  1. Introduction
  2. Controllers

Introduction

This document describes the backend API for a Vending Machine application. The backend is implemented using Java Spring Boot and exposes various endpoints for managing products, units, active wallets, and suppliers.

Controllers

ProductController

Endpoints:

  • GET /products: Fetches all products.
  • POST /products: Creates a new product.
  • GET /products/{productId}: Fetches a single product by its ID.
  • PUT /products/{productId}: Updates a product by its ID.
  • PUT /products/buyProduct/{productId}: Buys a product by its ID.
  • DELETE /products/{productId}: Deletes a product by its ID.

Description:

This controller is responsible for handling operations related to products. It uses the ProductRepository to interact with the database.


UnitController

Endpoints:

  • GET /units: Fetches all units.
  • POST /units: Creates a new unit.
  • GET /units/{unitId}: Fetches a single unit by its ID.
  • PUT /units/{unitId}: Updates a unit by its ID.
  • PUT /units/activeWallet/{unitId}: Adds a unit to the wallet.
  • POST /units/activeWallet/refund: Gets a refund.
  • PUT /units/activeWallet/buyProduct: Buys a product.
  • DELETE /units/{unitId}: Deletes a unit by its ID.

Description:

This controller is responsible for handling operations related to units. It uses the UnitRepository to interact with the database.


ActiveWalletController

Endpoints:

  • GET /activeWallet: Fetches the active wallet.
  • PUT /activeWallet: Updates the wallet.
  • PUT /activeWallet/buyProduct: Buys a product.

Description:

This controller is responsible for handling operations related to the active wallet. It uses the ActiveWalletRepository to interact with the database.


SupplierController

Endpoints:

  • POST /supplier/login: Logs in a supplier.
  • GET /supplier/validateToken: Validates a token.
  • GET /supplier/products: Fetches all products.
  • POST /supplier/products: Adds a new product.
  • POST /supplier/units: Adds a new unit.
  • PUT /supplier/products/{id}: Updates a product by its ID.
  • PUT /supplier/units/{id}: Updates a unit by its ID.
  • DELETE /supplier/products/{id}: Deletes a product by its ID.
  • DELETE /supplier/units/{id}: Deletes a unit by its ID.
  • GET /supplier/units/info: Gets unit info.
  • PUT /supplier/units/collectAllMoney: Collects all money.

Description:

This controller is responsible for handling operations related to suppliers. It uses multiple repositories (SupplierRepository, ProductRepository, UnitRepository, ActiveWalletRepository) to interact with the database.


vendingmachine's People

Contributors

asimkymk avatar

Stargazers

 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.