A backend project for React Native C-Plus product register helper
A firebird database helper to register products on a C-plus system.
- Uses a firebird ORM build build by me
- Makes requests on a firebird server
- Acess the product, price and stock tables to make modifications
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
.
It have two basic endpoints /products
and /stock
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
}
]
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
}
- The CODEMPRESA is hardcoded to help with the code.
- 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.