msupply-foundation / open-msupply

Open mSupply represents our most recent advancement in the Logistics Management Information System (LMIS), expanding on more than two decades of development inherited from the well-established legacy of the original mSupply.
https://msupply.foundation/open-msupply/
Other
23 stars 15 forks source link

General Population does not save without another Demographic Indicator #4222

Open lache-melvin opened 4 months ago

lache-melvin commented 4 months ago

What went wrong? 😲

If you have no demographic indicators (only the General Population row) and try to update the population:

https://github.com/msupply-foundation/open-msupply/assets/55115239/c27085a9-7603-4a60-b75f-7a3e75fb5a96

This is because we store the general population against the other projection rows, rather than on its own. Will require a bit of rework to save this separately. I'm not sure where exactly?

Expected behaviour 🤔

Gen population row saves, regardless of what other rows you have

How to Reproduce 🔨

Steps to reproduce the behaviour:

  1. See above 🙈

Your environment 🌱

mark-prins commented 4 months ago

I did wonder if we should save gen pop as a row in database, same as the others but with a specific ID so that we can customise behaviour. either insert as a migration or just upsert from f/e?

lache-melvin commented 4 months ago

Is there a future where we add ability to delete rows? Also wouldn't want that to be possible... but yeah with specific ID we could work around that 😁

Almost wondered if it was a value you could store on the demographic_projection row? Maybe it's mixing concerns?

mark-prins commented 4 months ago

yeah - could add to demographic_projection but it is a little bit of a mixed concern. At least with the demographic_indicator row most of the data is applicable and it is shown in the table. It also means that we don't have to recalculate on first load - just show what's in the db

Chris-Petty commented 3 months ago

Low - no budget for GAPS area, no users to affect