I need to create a custom product type that has custom stock functionality and does not behave like a simple product, bundle, or configurable.
To build out this product type I need to understand how Magento 2.3 with product category stock filters work (and indexers) and how product types are tied to stock models.
I have tried looking at the Magento Catalog module and can see where category product collection is made but not how it filters for stocks vendor/magento/module-catalog/Block/Product/ListProduct.php:485 and the UML diagram here: https://github.com/magento/inventory/wiki/New-Indexer-for-StockItems as well as how the simple and bundle product types are setup.
So basically when and where does stock checking happen, where are the stock models tied to products, where are the stock checks done when viewing a product category on the front-end, and how can I make my own models for a new product type? Also are indexers used for these checks?
PS are there any UML architectural diagrams for classes and how they interact besides the very high level ones on Magento Docs site?