Skip to main content
Version: 1.0.0

Profiles

Purpose​

The Profiles collection defines the structure of user profiles. Its purpose is to store authentication data, access role, catalog associations, and user preferences.

Document schema​

{
"_email": "string",
"accountCreationDate": {
"__time__": "timestamp"
},
"avatarURL": "string",
"canPlaceOrders": "boolean",
"catalogsList": ["string"],
"clientRef": "string",
"firstName": "string",
"lastName": "string",
"orderList": ["any"],
"ref_log_access": "string",
"role": "string"
}

Indexes​

  • catalogsList is a [] of strings that refer to the IDs of the Catalogues collection
  • orderList is a [] of strings that refer to the IDs of the CataloguesOrders collection
  • clientRef is a string that refers to the ID of Client collection;

Query examples​

// Fetch the Reference Doc from Firebase
const profileRefDoc = doc(db, "Profiles", profileId);

// Get the Document Snapshot from the Reference Doc
const profileRefSnap = await getDoc(profileRefDoc);