-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PROD] Field report "affected" values in different database cells #1561
Comments
When there are multiple "_affected" values, recently the frontend solves the conflict (on Edit page) according to "strength": https://github.com/IFRCGo/go-frontend/blob/develop/src/root/views/FieldReportForm/common.tsx#L841-L846 If RedCross-figure is provided, we use that. If Government-figure is given, we use that. Otherwise we use the Other-figure to be edited. |
Plan:
|
The recent solution is:
@justinginnetti proposed, that (besides the three existing radio buttons) there should be a link also to the Global Crisis Data Bank (The user journey is: which is written the last time on frontend, it can be seen on every frontend page. On backend Admin page it is possible to change those ones, which are NOT the displayed ones.) |
So, I'd like to take a bit of a step back and re-think this a little bit. The different data points we collect for field reports and the multiple sources for them is a feature that grew out over time, and I believe is not modelled correctly in the database, which is causing a lot of these issues. Currently, we specify the different data points and their sources as separate fields on the FieldReport model, like so: https://github.com/IFRCGo/go-api/blob/develop/api/models.py#L1251 . This was fine when we had only a few fields - once we started adding multiple sources and more fields, we ideally should have moved to a different data model. But, it's never too late. What I would propose:
I believe this will make things much cleaner - it will allow us to be flexible in adding new data points and new sources, and also allow us to manage updated timestamps of each value individually. Once we have this, we can be flexible in where we show what data on the frontend based on source and updated timestamp. Unfortunately, this will be a lot of work:
@thenav56 @frozenhelium @szabozoltan69 how does this sound? If this feels like the correct approach to the problem (and a few related awkward things about these values + sources), we can at least scope it out and decide if that's something we want to do and / or if we need to pursue an intermediate solution if there is an urgent requirement. |
Really a great idea! The correct approach is always beautiful. I'm looking forward to implement it. Do I assume well that the "latest" input will be relevant for other num_... fields also? |
Is this list complete?
|
@batpad There are a lot of other "named integer" fields in field report; should we pull them out too? ERU-s, response figures... |
I would not worry about the ERU figures for now -- I think they could go into a separate FieldReportERUFigure table or so in the future - but we do not have the problem of multiple sources here (there is no separate "source" for the ERU figures") so I think it's okay to keep in the field report model for now. What worries me a little bit is the fields that have sources that are not integer fields -- for example "affected_pop_centers" which is a string field -- I'm not sure how best to handle this -- I think we can either make the |
Issue
Recently it is impossible to know, which of these figures was sent last time in a Field Report – and we should consider only one:
num_affected
gov_num_affected
other_num_affected
num_potentially_affected
gov_num_potentially_affected
other_num_potentially_affected
So we introduce a new field on backend only, to document: which was sent last time (which is considered valid currently).
When the data are sent to frontend client, we should send zero for the other field values.
It has also relevance when GO sends Field Report data to ERP.
Thank you, @mmusori for the catch!
The text was updated successfully, but these errors were encountered: