Tracking Inventory as Variants of a Separate SKU

We have a working solution for a purchasing a fabric kit in our Shopify sandbox, but we have not been able to figure out a way to track inventory, because of its unique properties:

We have two SKUs, one for the fabric kit themselves, one for the fabric. We build out a customer’s request with a form that gives us the kit SKU, which we then dynamically populate with the actual fabric in a second SKU via a dropdown. Fabric SKUs have two variants for inventory tracking: full rolls of fabric (e.g. 50 feet long), and By the Foot.

The price is calculated by the feet needed for the kit: if a kit requires, e.g., 105 feet of fabric, we dynamically update the price with a hidden “feet” value based on the kit requirement (the dynamic piece is why we don’t do bundles, since those can’t calculate the dynamic price for us for every scenario). That order goes through with other hidden values we need to build the kit. What we haven’t figured out is how to deduct that the amount of fabric needed for that order from those two variants that track inventory of the fabric SKU.

It’s more complex still: we calculate how much fabric is needed based on full roll length and By the Foot. In our scenario above, assuming a full roll at 50 feet, we would need to deduct from the inventory variants:

2 full rolls;
5 By the foot

to correctly track inventory.

The kits need no inventory, we’re trying to track the amount of fabric they require, and we have the math ready to go. We can use Flow to notice an order, but we are told we need a third-party “listener” like Cloudflare Workers, etc. to actually trigger the calculation to deduct inventory. This seems like an extra step we’d like to avoid – I want to believe we aren’t the first people to need to track variant calculations in this manner.

I welcome any recommendations for how to proceed here. Many thanks in advance for your help.