I'm currently exploring the microservice architecture and base on what I've read so far it's good to separate the catalog microservice/database to inventory and that's where I want to go.
- Since the catalog will be on another database (PostgreSQL/MongoDB) compare to the inventory (PostgreSQL). When I want to create a report of inventory movement with product code, what's the best way to model it? So far I'm sending the productId to the inventory but not the code as it might change.
- What's the best way to track the inventory movement? I have this schema in mind:
InventoryTransaction -productId -operationDate -action (IN/OUT) -count InventoryTransactionSummary <- updated daily -productId -prevTotal - total from the previous date -total - prevTotal + productIn - productOut -productIn - in stock -productOut - sold, pullout, etc