I will carefully review the code according to your suggestion. Before that, could you please help me confirm one thing? I learned in the tutorial documentation(https://shopify.dev/docs/apps/functions/input-output/variables-queries) that Input query variables value can be set using the metafield collection on the create or update mutation on your function owner (for example, discountAutomaticAppCreate).
Now in my case,the function owner is the shop right?
In other words, is it correct for me to set input variable values to the Matefields in the shop?