As someone who has worked in supply chain automation, there is no elegant code solution to real-world problems.
Even Amazon, who one might argue has perfected the art of moving and tracking large numbers of things, has done so through (a) massive investment in infrastructure and (b) hiring a massive number of human employees who are (c) held to inhumanly strict rules in (d) a mostly closed and highly-controlled environment.
Real life is messy; you need people (and often experts) to manage it.