Coll_Clienti
Purpose
The Coll_Clienti collection defines the structure of client accounts within the system.
It contains company details, references to brands, services, subscriptions, and account metadata.
Document schema
{
"codiceDestinatario": "string",
"cognome": "string",
"dataRegistrazione": "timestamp",
"idAccount": "string",
"licenza": "string",
"lista_brand": [
"reference(Brand)"
],
"nome": "string",
"pIva": "string",
"pec": "string",
"phone_number": "string",
"photoURL": "string",
"regione_sociale": "string",
"service_list": [
"string"
],
"strada": {
"cap": "string",
"citta": "string",
"indirizzo": "string",
"nazione": "string"
},
"subscription_list": [
"string"
]
}
Indexes
- lista_brand is a
referencesto theBrandcollections; - service_list is a
referencesto theServicescollections; - subscription_list is a
referencesto theARShades_Subscriptioncollections.
Query examples
// Fetch client by reference
const clientRefDoc = doc(db, "Coll_Clienti", clientId);
const clientSnap = await getDoc(clientRefDoc);
// Query clients by subscription
const clientsBySubscription = query(
collection(db, "Coll_Clienti"),
where("subscription_list", "array-contains", subscriptionId)
);
// Query clients by brand
const clientsByBrand = query(
collection(db, "Coll_Clienti"),
where("lista_brand", "array-contains", brandId)
);