I am working on a mobile app where users will be able to login with their phone and invite other people to groups if they have their phone number. I setup the following in the Firestore.
I am planning on writing rules that make it so that users can only edit their own documents. And they can invite each other via invitations so a user can join a group himself. And they will only be able to lookup users that are in their phone by number.
But I would like to know is if I am playing with fire here? What are the risks of using a phone number as a document id? I am new to this and I would like to keep the user's data as safe as possible. But also I don't want to have too many lookups/queries for documents. Any tips on how I could improve my design?