PowerlineApp / powerline-mobile

Other
4 stars 16 forks source link

AU / EU Support #534

Open jterps08 opened 7 years ago

jterps08 commented 7 years ago

I changed the address of zxc3 to a Nigerian Address and then a German address... I would have expected the user to be auto-linked to African Union (AU) and European Union (EU) group, but did not see it.

image image

https://github.com/PowerlineApp/powerline-server/issues/37

https://github.com/PowerlineApp/powerline-server/pull/43 https://github.com/PowerlineApp/powerline-server/pull/42 https://github.com/PowerlineApp/powerline-server/pull/41

jterps08 commented 7 years ago

I thought that Habibillah had built this, but I guess the logic got screwed up when we moved to API v2... All users in an AU or EU country (e.g. Nigeria or France), should be linked to their town group, their state group, and their country group in addition to the AU group or EU group.

igaponov commented 7 years ago

@jterps08 the problem here is all these groups (eu/afu country's groups) should have a parent group (eu/afu), but there is no one. Should add it in admin dashboard.

jterps08 commented 7 years ago

@igaponov just to make sure we're aligned...

Someone living in Nairobi, Kenya should be linked to Nairobi, Nairobi province (whatever it is), Kenya, and AU group. Someone living in Paris, France should be linked to Paris, Paris province (whatever it is), France, and EU group.

I do not have ability to add this parent group to admin dashboard - I am assuming action is still on backend?

igaponov commented 7 years ago

@jterps08 there is a code on backend:

if (!is_null($parentCountryGroup) &&
        ($parentCountryGroup->getLocationName() == Group::GROUP_LOCATION_NAME_EROPEAN_UNION
            || $parentCountryGroup->getLocationName() == Group::GROUP_LOCATION_NAME_AFRICAN_UNION)) {
        $this->joinToGroup($user, $parentCountryGroup);
}

that means there must be a group (EU or AFU) and country group have to have one of these groups as a parent, so user can join it. Now there is no EU and AFU groups on prod and no one country group has a parent one.

igaponov commented 7 years ago

@jterps08 I suppose we add country groups automatically if it doesn't exists, so EU and AFU groups should be created automatically too. So we can do next:

  1. check if google returns that information about a union
  2. add a creation of a union group
  3. check all country groups with a google and add a parent group if needed
jterps08 commented 7 years ago

I trust your judgment @igaponov - I just want to make sure the linkage to AU and EU happens accurately without changing the rest of the system.

igaponov commented 7 years ago

@jterps08 AU is a code of Australia, that's why AFU was used before for African Union

jterps08 commented 7 years ago

sounds good. Thanks @igaponov