Open jum-s opened 7 years ago
That make sense, and it doesn't look that complex from a data perspective: only the user model is affected. We could replace the current: [ lat, lng ]
array, by an array of objects to include (optional) labels or other data. If for some reason, something needs to access only one position, the first one in the array can plays that role (so the user interface should give the possibility to re-order them)
[
{ label: 'home', coordinates: [ lat, lng ] },
{ label: 'work', coordinates: [ lat, lng ] }
]
The server currently only have to handle an update operation, which works for
We could re-use the same approach by requesting the whole serialized list of positions for each updates, to keep it simple (instead of having to handle add/update/remove for each localization)
The associated feature we should have in mind is the possibility to associate a subset of the user inventory per-localization, which could be a feature of books list
I would add, that I have book shelves in different locations. I would like to share their books but I am not always there and certainly do not take the books with me. So, a location would be attached to a book.
now that we have shelves (#371, https://github.com/inventaire/inventaire-client/pull/224), that should be much easier to implement
On my user profile, i can only set one position, although i am a movable being. If I work 30km from home or more generally if im routinely somewhere and sleep somewhere else, I would like other people to see where they can make a transaction with me.
feedback from @Gui11aume
to start :
models/tests/commons.js
data model of geo position as stored in user model