ARShades_Subscription
Purpose
The ARShades_Subscription collection defines the structure of client subscriptions for ARShades services.
Its purpose is to manage subscription metadata, associated brands, services, limits, consumption tracking, and status.
Document schema
{
"api_ARPDMeter_limit": "number",
"api_consumption": "string",
"arpd_meter_consumption": "string",
"bandwidth_limit": "number",
"brandRef_list": ["string"],
"clientRef": "string",
"end_date": { "__time__": "timestamp" },
"receipt_details": "string",
"service_list": ["string"],
"start_date": { "__time__": "timestamp" },
"status": "string",
"store": "string",
"subscription_title": "string",
"type": "string"
}
Indexes
- clientRef is a reference to
Clientcollection; - brandRef_list is a
[]of references toBrandcollection; - service_list is a
[]of references toService_ARShades
Query examples
// Fetch the Reference Doc from Firebase
const subscriptionRefDoc = doc(db, "ARShades_Subscription", subscriptionId);
// Get the Document Snapshot from the Reference Doc
const subscriptionRefSnap = await getDoc(subscriptionRefDoc);
// Query subscriptions by client
const subscriptionsByClient = query(
collection(db, "ARShades_Subscription"),
where("clientRef", "==", doc(db, "Client", clientId))
);
// Query subscriptions by brand reference
const subscriptionsByBrand = query(
collection(db, "ARShades_Subscription"),
where("brandRef_list", "array-contains", doc(db, "Brand", brandId))
);