Hello, I want to do some work with inventory and this is my current vision of how it should be. This is not all, just a part which I understand for today).
First of all we need to remember: inventory items could have
status and orders could
status and sometimes these statuses even have the same name, but they are different.
There was an idea to add more statuses to inventory item that it has now (now we have
backorder and in future we absolutely for sure need
fulfilled), but I think we don’t need them, because I think inventory logic should be simple (dump) and clear. Statuses like
packing etc we could put inside Orders statuses list.
We should move barcode field to inventory items.
We are talking here only about Inventory.
We could look at Inventory flow from two points. From admin point of view and from
customer point of view.
Admin Inventory flow
Admin could add variants to products (
inventory/register fires at this moment). He could add
inventoryQuantity to variants. By doing that, he fires
inventory/adjust. BUT he can’t decrease
inventoryQuantity or remove variant or product after the occurrence of certain conditions.
I like the following idea: If all product’s variants items have status “new”, then admin can remove this product or variant, but if at least one of variant items was reserved (status: “reserved”), after that it is impossible to remove such product with all its variants.
To achieve this we could add new field to product and variant. Lets call it status (just like inventory
status field). It could contain several states. For example active - product are in use. This could be default status. Then removed – by that we could mark products/variants which was removed by admin, but they were contain
Plus to that we need functionality to remove “dead” carts. Lets say of customer added something to cart and he not ordered this order in a 48 hours (may be other number), we should remove such carts and release items from them. System could update status from
reserved back to
new for such items. I suppose, our
Jobs server could do this task well.
Next: How we could display the number of allowed to order number of items for each variant? We could use two ways, as I can see: denormalization and calculation on-the-fly. BUT in fact we can’t use calculation on the fly, because to have always fresh data about allowed quantity we will need have
inventory publication which is not good, because the idea is to completely remove all inventory logic from the client (at least not for customers), because it’s really heavy.
Additionally we could add a job for cleaning
removed products/variants with all inventory data after several years from last update.
We need separate interface to manage stock
It should be a table without reactivity and with simple numbers pagination. Rows are products/varaints with most important information, like
availableQuantity buttons “add XX items”, “remove XX items”, “show variant items”.
- “add XX items” this is obvious
- “remove XX items” - we need an ability to remove X items from varaint, thus it is necessary to be able to spot removal. This could be necessary if the part of the party was defective and we need to took away some of specific inventory items. Remember that
barcodeshould be within inventory items? That’s why it is also important to have an ability to remove concrete items from inventory.
- “show variant items” should open something like modal window with a list of variant inventory items with
barcode, also we should put here an info about current status of order of this item (it could be already packed, or sent, but not yet marked as
fulfilled). Also we should have a button here - “remove item”.
This is not ordinary operation – to remove items from already payed order, for example, but it could happen, and in that case, we should send some mail to customer with description whats going on. Any ideas on that part of logic?
Client inventory flow
- add to cart. Inventory item status moves from
- remove items from cart. Item status should move back from
- Customer could make an order and nothing should change for an inventory item,
because, remember, we have only four status state and after
fulfilled. Going forward – order status should change here.
Logic for the rental products
Some thoughts how this could work for rental products. We could have a circle from three states of statuses for item.
reserved (when customer put item to the cart) →
fulfilled (when customer take an item for rent), and when items back, we mark it again →
In case of items was backordered I see two ways: Admin could add an item through or new stack management table and in that case status
backorder will be changed on
reserved, or he could not give a damn on this stage and add item only when all order will be shipped. In that case system should automatically change item status from
That’s all for today. This was my current vision. Let’s discuss this