Giter Club home page Giter Club logo

c-plus-product-register-flask's Introduction

C-Plus Product Register

A backend project for React Native C-Plus product register helper

TOC

Description

A firebird database helper to register products on a C-plus system.

Characteristics

  • Uses a firebird ORM build build by me
  • Makes requests on a firebird server
  • Acess the product, price and stock tables to make modifications

How to run

To start using the server, install it with poetry install to add all the dependences. Change the database path on .env to your database path. And them run the server with the src/App.py.

Endpoints

It have two basic endpoints /products and /stock

/products

  GET /products?NOMEPROD={product name}

The NOMEPROD uses a non exact search of the item.

Returns the list of products in the database as a array:

[
  {
    "CODPROD": string,
    "CODIGO": string,
    "NOMEPROD": string,
    "UNIDADE": string,
    "DESCMAXIMO": float,
    "FLAGINATIVO": boolean,
    "ESTOQUE": {
      "CODEMPRESA": integer,
      "CODPROD": string,
      "CODSETORESTOQUE": string,
      "ESTATU": float,
      "LAST_CHANGE": string
    },
    "PRECO": float
  }
]

/stock

  GET /stock?CODPROD={product code}

Return the stock for the specified product.

{
  "CODEMPRESA": integer,
  "CODPROD": string,
  "CODSETORESTOQUE": string,
  "ESTATU": float,
  "LAST_CHANGE": string
}
  PATCH /stock?CODPROD={product code}

Updates the product stock for the specified product code. It accepts the new stock as:

{
	"amount": integer
}

And returns the stock.

{
  "CODEMPRESA": integer,
  "CODPROD": string,
  "CODSETORESTOQUE": string,
  "ESTATU": float,
  "LAST_CHANGE": string
}

Problems

  • The CODEMPRESA is hardcoded to help with the code.

Bugs found

  • Found bug where json.dumps passed to Flask return as a parsed string.
  • Found bug where if page is not setted on the all function, limit not work also.

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.