Skip to main content
Version: 1.0.0

Coll_Account

Purpose​

The Coll_Account collection defines the structure of user accounts within the system.
It stores references to the associated client, accessible brands, access logs, and user profile information.


Document schema​

{
"_email": "string",
"lista_brand": ["string"],
"nome_completo": "string",
"profile_image": "string",
"ref_cliente": "string",
"ref_log_access": "string",
"role": "string"
}

Indexes​

  • ref_cliente is a references to the Client collection;
  • ref_log_access is a references to the Log_Access collection;
  • lista_brand is a array of references to the Brand collection.

Query examples​

// Fetch account by reference
const accountRefDoc = doc(db, "Coll_Account", accountId);
const accountSnap = await getDoc(accountRefDoc);

// Query accounts by client reference
const accountsByClient = query(
collection(db, "Coll_Account"),
where("ref_cliente", "==", clientId)
);

// Query accounts by role
const adminAccounts = query(
collection(db, "Coll_Account"),
where("role", "==", "Admin")
);