simra-project / simra-ios

Apache License 2.0
4 stars 6 forks source link

Add profiles for separate regions #32

Closed selphiron closed 4 years ago

selphiron commented 4 years ago

We have a problem with the profiles and regions.

Assume a user has 100 rides in region A, and that profile is uploaded for region A. The user then moves to region B, records rides and uploads. Now there are two profile of the user. One in region A, where only rides of region A are. And one in region B containing the statistics for region A and region B.

solution:

We need different statistics for different regions alongside a global profile. Tag each ride with the region that was chosen in the "Profile" menu. When Uploading, upload each ride according to that tag and update the global profile and the corresponding region's profile, before uploading the global and region profile.

Any comments @ckrey ?

ckrey commented 4 years ago

It seems to me this is only an edge case. The problem occurs because profiles are not kept globally but stored on a region level causing duplication when the region changes. A simpler solution would be to reset the profile/statistics when the region is changed.

But if you opt for the sophisticated solution,

selphiron commented 4 years ago

One of the main use cases for this, is when a user changes his profile from UNKNOWN or other to a specific region. Maybe because the region was not supported before, or the person didn't bother to choose one.

For the ease of implementation and maintenance, I would suggest, that all profile data should contain the same types of information. The statistics which are shown to the user are derived from the global profile on his smartphone. That way, he can accumulate his statistics throughout different regions. With each upload, the rides and profiles would be uploaded to their corresponding region endpoint. Additionally, there should be a "global" region, where the global region file could be uploaded.

What do you think?

ckrey commented 4 years ago

As agreed on the phone: