thewca / worldcubeassociation.org

All of the code that runs on worldcubeassociation.org
https://www.worldcubeassociation.org/
GNU General Public License v3.0
324 stars 175 forks source link

Ability to cross list Delegates for two or more regions #7874

Open JonEsparaz opened 1 year ago

JonEsparaz commented 1 year ago

Is your feature request related to a problem? Please describe. I'll provide a specific example: my co-Delegate, Abdullah Gulab, is mainly based in Ontario, Canada, but regularly runs competitions in Pakistan (at least pre-pandemic and hopefully again soon), thus it is important that he is recognized by both the Canadian and Pakistani cubing communities. Currently, he is only (and can only) be listed under Asia West & South > Pakistan.

Describe the solution you'd like Delegates who cover two regions and/or live in two or more locations during the year (e.g., Delegates who are in university live at school for 6-8 months and somewhere else for 6-8 months) should be cross listed.

This means we require a many-to-many relationship between Delegates and Senior Delegates (a Delegate can have multiple Senior Delegates and Senior Delegates obviously have many Delegates under them). We would probably want a table that defines this hierarchical link with at least three fields: delegate_id, senior_delegate_id, and region.

Describe alternatives you've considered N/A

Additional context I could see some overlap with https://github.com/thewca/worldcubeassociation.org/issues/4851 since we'd be redefining the structure of how Delegates are stored in the DB anyways, so we might want to same idea as above, but more generalized to be: delegate_id, supervising_delegate_id, and region, which would allow Delegate -> Regional Delegate, Regional Delegate -> Senior Delegate linkings.

gregorbg commented 1 year ago

There is a rework of the Delegates table being planned over at https://github.com/thewca/worldcubeassociation.org/pull/5417

With the proposed table structure of that PR, listing a Delegate multiple times would be as simple as inserting a second (or third, fourth, etc.) table row referencing the same user account ID

dunkOnIT commented 1 year ago

The rework in Gregor's comment is now being worked on at #8122.

dunkOnIT commented 1 year ago

@danieljames-dj just confirming that your current rework takes this requirement into account? It looks like a delegate could have multiple regions as specified under the Type Enum, but just want to confirm

danieljames-dj commented 1 year ago

Yes this is already taken into account.