Q:

Warehouse Inventory Database Modal

I got my first professional project where I have to create a warehouse inventory web application. I have completed the front-end however I am stuck on the database modal - I'm not entirely sure if I got it right.
(ignore the scribble)

Basically, the company only needs to keep track of their stock level in each of their warehouse and do not need to add supplier details or any cost/sale prices.
These are all the tables and links I could think of however, even though this might work (or not), is this the correct design modal? (specifially the central table)
.
.

A:

Right and Wrong are not absolute. That being said, here is my opinion on your model:
1) Are you sure purchases and sales should be two different tables? They have the same fields. Make them one and add a field that determines whether it's a purchase or sale.
2) The fact that the stock table has the same keys (warehouse,item) that the sales/purchases,inventory, and transfers table does not make it a logical centre table. My design would be:

Tables barcodes,items,warehouses as you already have them.
The remaining tables should have foreign keys on items,or warehouses, or both, whatever exists. There is no reason to make a 2-field FK towards the stock-locations table
The transfers item should have both warehouse_from and warehouse_to FK referenceing warehouses. And item, of course.

