• /transactions/new/map
• /purchases/all
• /products/all
• /sales/all
Method: POST
/products/all
- Body must contain the following:
{
"item":"chocolate",
"description":"food",
"quantity":"7"
}
- First: Item Name and description
- Second: you must put an initial quantity
Method: GET
/products/all
- Retrieves all records (products) and the related
Transactions
of each item
Method: POST
/purchases/all
- Adds a record with
id
andCreation Date
Method: GET
/purchases/all
- Retrieves all records on this table, including the related products
Method: POST
/sales/all
- Adds a record with
id
andCreation Date
Method: GET
/sales/all
- Retrieves all records on this table, including the related product
Method: POST
/transactions/new
- Body must contain the following: (AT LEAST ONE OR MORE OBJECTS)
{
"products_id":3,
"quantity":5,
"purchases_id": null
},
{
"products_id":4,
"quantity":5,
"purchases_id": null
}
-
First you should have a product with an initial quantity
-
Second: if it's a sale you must not include the
sales_id
, because it will be created automatically, and viceversa withpurchases
, but you must include purchases_id = null, and viceversa -
third: you must set a
warehouse_id
, that's mandatory, consider the following: 1.MAIN 2.MOTORCYCLE1 3.MOTORCYCLE2 4.MOTORCYCLE3 -
If its a
PURCHASE
you should set the quantity amount to positive, if itsSALE
you should set it to negative (example : -3)
Method: GET
/transactions/new/map
- Retrieves all records on this table