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

update donors list handling #64

Open
4 tasks done
drfaustusfade opened this issue Mar 4, 2021 · 28 comments
Open
4 tasks done

update donors list handling #64

drfaustusfade opened this issue Mar 4, 2021 · 28 comments

Comments

@drfaustusfade
Copy link
Owner

drfaustusfade commented Mar 4, 2021

as per previous works

@fakhrihawari
Copy link
Collaborator

Link Donor from FE ,some don't have cluster so i make it to 'all'
https://docs.google.com/spreadsheets/d/1UI7NJ-01MvUgLO4fdhSNcriExgQ2kMHVeHjNVLC2bzw/edit?usp=sharing

@drfaustusfade
Copy link
Owner Author

that's exactly right

@fakhrihawari
Copy link
Collaborator

for the API the filter is just country cluster ? or donor_id donor_name too?
engine: https://github.com/fakhrihawari/ngm-reportEngine/tree/migrate-newdonor

@drfaustusfade
Copy link
Owner Author

for the api contry cluster should be enough, but in general like for activities country list should be fetched + default ALL country list, on FE, project country cluster list should be used, if no cluster default country ALL cluster, if no country list default ALL global list

@fakhrihawari
Copy link
Collaborator

for the api contry cluster should be enough, but in general like for activities country list should be fetched + default ALL country list, on FE, project country cluster list should be used, if no cluster default country ALL cluster, if no country list default ALL global list

updated

@drfaustusfade
Copy link
Owner Author

drfaustusfade commented Mar 18, 2021

for the api contry cluster should be enough, but in general like for activities country list should be fetched + default ALL country list, on FE, project country cluster list should be used, if no cluster default country ALL cluster, if no country list default ALL global list

updated

alright, why would use aggregate rather than find? also, should there be FE updates?

@fakhrihawari
Copy link
Collaborator

fakhrihawari commented Mar 18, 2021

for the api contry cluster should be enough, but in general like for activities country list should be fetched + default ALL country list, on FE, project country cluster list should be used, if no cluster default country ALL cluster, if no country list default ALL global list

updated

alright, why would use aggregate rather than find? also, should there be FE updates?

You mean inside native?

i just take a look from other that using native its using aggregate
and i already change from aggregate to find now.
is it more fast using find??
link FE: https://github.com/fakhrihawari/ngm-reportHub/tree/migrate-newdonor-api

@fakhrihawari
Copy link
Collaborator

fakhrihawari commented Mar 22, 2021

Updated link:
https://github.com/fakhrihawari/ngm-reportHub/tree/migrate-newdonor-api
https://github.com/fakhrihawari/ngm-reportEngine/tree/migrate-newdonor

and for stock donor just need to update in FE right? coz it use same data that use in project plan right?

@drfaustusfade
Copy link
Owner Author

right, that should be the same, but as stock cluster could be changed donors should be updated on change

@fakhrihawari
Copy link
Collaborator

right, that should be the same, but as stock cluster could be changed donors should be updated on change

okay , updated

@drfaustusfade
Copy link
Owner Author

please make pull so that i would check, and please prepare file and script for import, getStockLists: function (org) org param is it report or organization?

@fakhrihawari
Copy link
Collaborator

please make pull so that i would check, and please prepare file and script for import, getStockLists: function (org) org param is it report or organization?

i chenge it again to same as before so now is just admin0pcode when set stock lists

@fakhrihawari
Copy link
Collaborator

please make pull so that i would check, and please prepare file and script for import, getStockLists: function (org) org param is it report or organization?

file:
https://drive.google.com/file/d/1turEG34jseQZBGbI-EfN8gHCmvIQX3Z5/view?usp=sharing

script:
mongoimport -d ngmHealthCluster -c donors --drop --headerline --type csv --file /home/ubuntu/nginx/www/ngm-reportEngine/donors.csv

PR:
drfaustusfade/ngm-reportEngine#26
drfaustusfade/ngm-reportHub#129

@drfaustusfade
Copy link
Owner Author

  • there are project donors duplicates

for the api contry cluster should be enough, but in general like for activities country list should be fetched + default ALL country list, on FE, project country cluster list should be used, if no cluster default country ALL cluster, if no country list default ALL global list

  • is it working like next? if cluster list use it, if previous not defined, use all country list, if previous not defined use global all cluster list, if previous not defined use global all admin0, for example, get AF, ENSFI; if not get AF, ALL; if not get ALL, ENSFI; if not get ALL, ALL

right, that should be the same, but as stock cluster could be changed donors should be updated on change

  • that's not correct, should be filtered to cluster ones (probably with custom filter) and reset on change, as a possible solution; because updating on different stock records affect other selection lists, as the common list is used

@fakhrihawari
Copy link
Collaborator

fakhrihawari commented Mar 24, 2021

  • there are project donors duplicates

for the api contry cluster should be enough, but in general like for activities country list should be fetched + default ALL country list, on FE, project country cluster list should be used, if no cluster default country ALL cluster, if no country list default ALL global list

  • is it working like next? if cluster list use it, if previous not defined, use all country list, if previous not defined use global all cluster list, if previous not defined use global all admin0, for example, get AF, ENSFI; if not get AF, ALL; if not get ALL, ENSFI; if not get ALL, ALL

right, that should be the same, but as stock cluster could be changed donors should be updated on change

  • that's not correct, should be filtered to cluster ones (probably with custom filter) and reset on change, as a possible solution; because updating on different stock records affect other selection lists, as the common list is used

Point 1
for project donor duplicate what should we do ? i dont how we should merge it coz some have different cluster id or admin0pcode for example :

wash | danida | DANIDA
esnfi | danida | DANIDA

it become [wash,esnfi] | danida | DANIDA (array) or wash,esnfi | danida | DANIDA (string);

Point 2
rightnow in the last commit
if get AF ESNFI => then get donors with AF and ALL with cluster ESNFI; if not get AF then just ALL with cluster ESNFI

point 3. so we need to make different list for each stock record right?

@drfaustusfade
Copy link
Owner Author

  1. that should be fixed if 2 is correct ( that is no duplicates per cluster list )
  2. is it as per logic below next? please also reference the code block to check
If ESNFI
1 get AF ESNFI
2 or (if not 1) get AF ALL
3 or (if not 2) get ALL ESNFI
4 or (if not 3) get ALL ALL
  1. or filter donors by stock cluster ( if 2 logic, then with angularjs custom filter )

@fakhrihawari
Copy link
Collaborator

  1. that should be fixed if 2 is correct ( that is no duplicates per cluster list )
  2. is it as per logic below next? please also reference the code block to check
If ESNFI
1 get AF ESNFI
2 or (if not 1) get AF ALL
3 or (if not 2) get ALL ESNFI
4 or (if not 3) get ALL ALL
  1. or filter donors by stock cluster ( if 2 logic, then with angularjs custom filter )

Updated:
file:
https://drive.google.com/file/d/1FDfqlSBWZoSbVhTKRbj9xJaSJx49GF_X/view?usp=sharing

script:
mongoimport -d ngmHealthCluster -c donors --drop --headerline --type csv --file /home/ubuntu/nginx/www/ngm-reportEngine/donors.csv

PR:
drfaustusfade/ngm-reportEngine#26
drfaustusfade/ngm-reportHub#129

@drfaustusfade
Copy link
Owner Author

alright, for multi-country role users will that return corresponding donors or of their registered country?

@fakhrihawari
Copy link
Collaborator

it based on country that user have coz i used admin0pcode from user profie

@drfaustusfade
Copy link
Owner Author

alright, let's do multicountry in another issue,

for AF donors are already on db, but they are without admin0pcode, that should be included

also for

If ESNFI
1 get AF ESNFI
2 or (if not 1) get AF ALL
3 or (if not 2) get ALL ESNFI
4 or (if not 3) get ALL ALL

that should apply when setting lists for project or stocks, I think right now on BE does it check for cluster if not in params? as project or stock can have a cluster to it, I guess with the current setup default global list and country-specific could be requested, and then filtered correspondingly

@fakhrihawari
Copy link
Collaborator

fakhrihawari commented Mar 25, 2021

You mean this one?
https://docs.google.com/spreadsheets/d/1aCXr6SqC4OK-CvcH8IS9m-01Wljf94UvoKuD6EsBQWE/edit?usp=sharing

if yes , i already put it but i set all to admin0pcode as 'ALL'

@drfaustusfade
Copy link
Owner Author

Yes, this is actually used by AF

@fakhrihawari
Copy link
Collaborator

fakhrihawari commented Mar 25, 2021

alright, let's do multicountry in another issue,

for AF donors are already on db, but they are without admin0pcode, that should be included

also for

If ESNFI
1 get AF ESNFI
2 or (if not 1) get AF ALL
3 or (if not 2) get ALL ESNFI
4 or (if not 3) get ALL ALL

that should apply when setting lists for project or stocks, I think right now on BE does it check for cluster if not in params? as project or stock can have a cluster to it, I guess with the current setup default global list and country-specific could be requested, and then filtered correspondingly

yes its check cluster params and also for filter like this:

If ESNFI
1 get AF ESNFI
2 or (if not 1) get AF ALL
3 or (if not 2) get ALL ESNFI
4 or (if not 3) get ALL ALL

i already do that in BE

@drfaustusfade
Copy link
Owner Author

drfaustusfade commented Mar 25, 2021

if we define for example one donor admin0pcode AF and cluster protection as somedonor we will get on protection project somedonor and other checkboxes?

@fakhrihawari
Copy link
Collaborator

other will be add on getDonors function on ngmClusterLists

@fakhrihawari
Copy link
Collaborator

fakhrihawari commented Mar 26, 2021

@drfaustusfade
Copy link
Owner Author

Alright, looks good,
Minor comment, why having run sequence, rather than simple conditional like check (AF ESNFI) than if no donors length than check ( AF all )...
I think also we could later make a general 4 rule fn for other list use

@fakhrihawari
Copy link
Collaborator

fakhrihawari commented Mar 26, 2021

Alright, looks good,
Minor comment, why having run sequence, rather than simple conditional like check (AF ESNFI) than if no donors length than check ( AF all )...
I think also we could later make a general 4 rule fn for other list use

just to make sure donors not return empty string;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants