bcgov / lcfs

An online application for fuel suppliers to manage their compliance obligations under the Low Carbon Fuels Act
Apache License 2.0
5 stars 3 forks source link

LCFS - Bug when trying to update inputs in line 6 and 8 of the compliance report summary #997

Closed Grulin closed 1 month ago

Grulin commented 1 month ago

Describe the Bug When attempting to remove or change inputs on lines 6 and 8 of the Compliance Report Summary, a "Status code 422" error appears.

Additionally, if changes are made to the schedules that affect the renewable fuel supply or requirement, lines 6 and 8 do not update accordingly. The inputs in lines 6 and 8 persist as they were initially entered, even if the requirements have changed based on updated fuel supply data in the schedules.

While it is important for these lines to persist when the report is left and reopened in the same session, they should also automatically update when relevant changes are made and be resaved with the new conditions for line availability, the maximum amount allowed, and the amount input.

Expected Behaviour

Actual Behaviour Image

Implications

Steps To Reproduce Steps to reproduce the behaviour:

  1. User/Role: Navigate to the Compliance Report Summary as a BCeID user.
  2. Attempt to remove or change an input on line 6 or 8.
  3. Observe the "Status code 422" error that appears.
  4. Make changes in the schedules that affect the renewable fuel supply or requirement.
  5. Check lines 6 and 8 and observe that they do not update based on the changes made in the schedules.
dhaselhan commented 1 month ago

How should the lines update based on the schedules? e.g my original renewable requirement was 1000, so I defer 50 (5%), then I change the quantity to 500, should the input show 25 (the new maximum) or 0?

Grulin commented 1 month ago

I think it should reset to "0" like it does in TFRS. Perhaps we should also add the pop-up that TFRS gives when you changes values. It says this: Image

I can make a separate card for the pop-up if that's what we want to do, so for now, I'd say reset both 6 and 8 to zero if changes are made to the renewable requirement (line 4). Thanks for catching this!

dhaselhan commented 1 month ago

As discussed with Lindsy, the pop up will be its own card we do later. Logic is now updated that if the fuel requirements change for a certain category, it will reset lines 6/8 to 0 for that category.