IFRCGo/go-frontend

[PROD] Start date of Emergency page showing incorrectly

Closed this issue · 7 comments

Issue

The "Start Date" of the Emergencies is not showing correctly, we have two different issues here:

  • In the front-end, in the Emergency pages is showing a "Start date" is being pulled from the Field Report from the field "disaster_start_date" and it should be pulled from Apple, from the parent code. For example, for "Ukraine and impacted countries crisis" find the GO page here
    image
    As shown in the screenshot, the start date showing in the front-end is 08-02-2022, when it should be 05-02-2022, see screenshot of Apple:
    image

  • In the endpoint of "Appeals", "Start date" it is being pulled from Apple, but it seems is being pulled from a child code and it should be pulled from the parent code. For example, for "Ukraine and impacted countries crisis", se attached screenshots:
    image
    image

@mmusori @tovari @szabozoltan69

tovari commented

Thanks @anamariaescobar. What should be the start date when there are no related appeal exists or not linked yet to the emergency? I assume then the start date from the FR should be applicable, right?

@tovari I think we should have two dates here. 1. The start date of the disaster from the field report which is what we are currently pulling in and that solves the problem you stated above. 2. And then we need the response start date from Apple/Data warehouse.

tovari commented

@mmusori, @anamariaescobar, so I suggest to change the start_date attribute of the api_appeal table to the APP_startDate attribute of the https://go-api.ifrc.org/api/Appeals (seems, currently it is APD_startDate). This will change the start date to 2022-02-05 in our example.
@szabozoltan69, I assume this will be reflected in both https://goadmin.ifrc.org/api/v2/appeal and the https://goadmin.ifrc.org/api/v2/event end points, right?

Regarding the date in the Emergency overview box, I'M not sure, if we want to show the appeal start date or the disaster start date?

So we should use APP_startDate instead of APD_startDate (and the same for...endDate).

Locally tested the ingest_appeals, worked fine.

Deployed to Staging and Prod.

tovari commented

The appeal start date in the appeal and event api endpoint show now the start date of the parent appeal (the launch of the first appeal).
E.g:
"appeals": [
{
"aid": "16472",
"num_beneficiaries": 22600000,
"amount_requested": "800000000.00",
"code": "MGR65002",
"amount_funded": "471770481.88",
"status": 1,
"status_display": "Closed",
"start_date": "2022-02-05T00:00:00Z",
"id": 3542,
"translation_module_original_language": "en"
}
],