Carbon-Farm-Network / app-carbon-farm-network

GNU Affero General Public License v3.0
1 stars 0 forks source link

Re-calc the requested when edit made on plan #106

Closed fosterlynn closed 3 months ago

fosterlynn commented 4 months ago

When editing in the plan, the offers "n requested" is not affected by changing the quantity / agent on the first pickup column. Also therefore no red notification. But, this does work when a new commitment is added, see bottom screen print.

Screenshot from 2024-04-30 12-29-48

Screenshot from 2024-05-09 13-17-08

fosterlynn commented 3 months ago

Tested again after performance improvement. Sometimes this works, sometimes it doesn't.

The following worked: I edited the Brown Alpaca Dirty quantity, checked to calc the cost, and saved. Everything showed up properly, on both the offer and the commitment.

Screenshot from 2024-05-17 12-42-53

But then I edited the White Wool Greasy pickup, nothing changed, including after I changed the provider to be the right one. Same after I edited the quantity down. Always checking the cost calc. (On the next screen shot, ignore the colors, different test.)

Screenshot from 2024-05-17 12-48-46

fosterlynn commented 3 months ago

This is working better, but has one odd thing. Here is a sequence of changes, looking at White Wool Greasy, from two possible suppliers. (I think it works correctly when there is only one supplier for the resource specification, and the commitment is changed.) [EDIT: Possibly the problem is just that we need to look for offers by resource spec and provider agent.]

Initially calculates one pickup, as expected. Screenshot from 2024-05-17 18-04-08 Change that pickup, different provider, changed quantity. Screenshot from 2024-05-17 18-05-22 Picks the wrong provider from the offers. Screenshot from 2024-05-17 18-06-29 Add another commitment for White Wool Greasy, which will happen all the time since we currently can't create more than one pickup commitment based on offers. Screenshot from 2024-05-17 18-07-29 That one puts the requested on the other supplier, which is also the wrong one. Screenshot from 2024-05-17 18-08-06

fosterlynn commented 3 months ago

fixed!