I am designing a inventory stock-management system.
My current understanding is that it should be similar to bank transactions, in which you take inventory from location A and put it at location B. In that case I would have a transaction table like so:
id
product_id
amount_of_units
from_location_id
to_location_id
To get the quantities-on-hand, I would run through all transactions and spit the sum for a location. So far so good.
The problem comes with the fact that more than one thing can change at a time. It's status can become ready
or waiting
. To track status
, I have to add 2 columns:
id
product_id
amount_of_units
from_location_id
to_location_id
from_status_id
to_status_id
I have 10 or so properties that can change, and I need to keep history of those. Do I add them all to this table with a from
and to
prefix? Or do I have to split those in separate tables: location_transactions
and status_transactions
, in which case how would I connect them?
Research: I read a bunch of questions and answers but they all revolve around simple transaction table or double-entry system. Non contain additional information for the item being transacted or changing properties.