Skip to main content
Version: 1.0.0

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 [] of strings that refer to the IDs of the Catalogues collection
  • allProfileList is a [] of strings that refer to the IDs of the Profiles collection
  • list_orders is a [] of strings that refer to the IDs of the CataloguesOrders collection
  • mainProfileList is a string that refers to the ID of the Client collection;

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);