Skip to content
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] Donor Responses #2219

Closed
szabozoltan69 opened this issue Jul 12, 2024 · 2 comments
Closed

[PROD] Donor Responses #2219

szabozoltan69 opened this issue Jul 12, 2024 · 2 comments
Assignees

Comments

@szabozoltan69
Copy link
Contributor

Issue

There are erroneously (and multiplied) shown Donor Response AppealDocuments in our database.

Let's choose an example:
https://www.ifrc.org/appeals?appeal_code=MDRZM021
https://goadmin.ifrc.org/en/admin/api/appealdocument/?q=ZM021
https://go.ifrc.org/emergencies/6817/reports (bottom, at Appeal Documents (6))
https://go-api.ifrc.org/api/PublicSiteAppeals?Appealnumber=MDRZM021&Hidden=false
Here we find only 4 ones, namely MDRZM021eu1, MDRZM021eu2, MDRZM021ea, MDRZM021OS

But, fortunately, on
https://go-api.ifrc.org/Help/Api/GET-api-PublicSiteDonorResponses
it turned out that we can use this (until now not used) endpoint also:
https://go-api.ifrc.org/api/PublicSiteDonorResponses?AppealCode=MDRZM021

Here we find the searched one:

<ArrayOfPublicSiteDonorResponse>
  <PublicSiteDonorResponse>
    <APP_Name>Zambia - Cholera Outbreak</APP_Name>
    <AmountCHF>2944515.210000000000</AmountCHF>
    <AppealCode>MDRZM021</AppealCode>
    <BaseDirectory>https://www.ifrc.org/docs/appeals/active/</BaseDirectory>
    <BaseFileName>MDRZM021.pdf</BaseFileName>
    <OSR_Code>S1</OSR_Code>
    <OSR_sname>Region: Africa</OSR_sname>
    <Region>Africa</Region>
    <RegionShort>AF</RegionShort>
    <StartDate>2024-01-01T00:00:00</StartDate>
  </PublicSiteDonorResponse>
</ArrayOfPublicSiteDonorResponse>

From this we can get a nice url: https://www.ifrc.org/docs/appeals/active/MDRZM021.pdf
Which is even more concise than the recently kept:
https://go-api.ifrc.org/publicfile/download?path=/docs/appeals/Active/&name=MDRZM021.pdf

(The error that should be fixed (not mentioning the multiple and wrongly tagged entities) means that we avoid the recently used "/docs/appeals/Active/&name=MDRZM021.pdf" parts, e.g. in https://goadmin.ifrc.org/en/admin/api/appealdocument/11473/ – which is not crystal clear how could get into the database, manually or via an already nonexistent record of the old appealdoc go-api url – because that /docs.... is simply prepended by our go.ifrc.org domain name and this way results an erroneous URL.)

After using the PublicSiteDonorResponses go-api endpoint we can delete manually the wrongly showed ones.

@szabozoltan69
Copy link
Contributor Author

szabozoltan69 commented Jul 12, 2024

The wrong data were fixed manually, via removing the redundant 3 records and fixing the missing "www.ifrc.org" at the beginning of the 8 URL-s. (ID-s: 11469, 11472, 11473, 11474, 11475, 11489, 14553, 14554)

Recently the normal sync_appealdocs recreates these kind of erroneous entities.

@szabozoltan69
Copy link
Contributor Author

Deployed to Staging and (via cherry-pick) to Prod also.

@tovari tovari closed this as completed Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants