Client
Purpose
The Client collection defines the structure of company clients. Its purpose is to store company information, associated profiles, catalogs, orders, and legal details.
Document schema
{
"address": {
"city": "string",
"country": "string",
"postalCode": "string",
"state": "string",
"street": "string"
},
"allProfileList": ["string"],
"catalogsList": ["string"],
"companyName": "string",
"licenseList": ["string"],
"list_orders": ["string"],
"mainProfileList": ["string"],
"pec": "string",
"registrationDate": {
"__time__": "timestamp"
},
"vatNumber": "string"
}
Indexes
- catalogsList is a
[]ofstrings that refer to the IDs of theCataloguescollection - allProfileList is a
[]ofstrings that refer to the IDs of theProfilescollection - list_orders is a
[]ofstrings that refer to the IDs of theCataloguesOrderscollection - mainProfileList is a
stringthat refers to the ID of theClientcollection;
Query examples
// Fetch the Reference Doc from Firebase
const clientRefDoc = doc(db, "Client", clientId);
// Get the Document Snapshot from the Reference Doc
const clientRefSnap = await getDoc(clientRefDoc);