Using remix billing API to set calculated trial days

Hey, everybody!
I don’t know where to turn, so I’ll write here. I would like to get clarifications from the developers of Billing API.

  1. In the documentation on using billing API for remix it seems to be a mistake, lineItems is specified as an array, but written as an object (see screenshot).

  1. Can I write billing plans in shopify.server.js, and then on pages in action when calling await billing.require(…) pass here the calculated number of test days?
    For example, if a user installed an app, got a trial period of 10 days, uninstalled the application after 3 days, so that the next time he installs it, I can give him only 7 days of trial period, but all 10.
    Or is it necessary to use only GraphQL queries for such a case?

I realized that I can pass the calculated trial days to the function for remix.

await billing.require({
plans: [plan],
isTest: true,
trialDays: calculatedDays,
onFailure: async () => billing.request({ plan: plan, isTest: true, trialDays: calculatedDays, }),
returnUrl: ``,
});

@andrew_upo where did you give calculatedDays value?