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
referencesto theClientcollection; - ref_log_access is a
referencesto theLog_Accesscollection; - lista_brand is a array of
referencesto theBrandcollection.
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")
);