ARShadesSubscriptions
Purpose
The ARShadesSubscriptions collection manages subscription records for clients. Each document contains details about the subscription period, allowed domains and referrers, associated catalogues and services, consumption limits, status, and references to related entities. This collection is used to control access, enforce limits, and track the status of client subscriptions.
Document schema
{
"clientRef": "string",
"endDate": "string",
"id": "string",
"isAllowIframe": "boolean",
"isMainSubscription": "boolean",
"list_allowed_domains": ["string"],
"list_allowed_referrers": ["string"],
"list_catalogues": {
"catalogLimit": "number",
"consumptionLimit": "number",
"list_catalogues_refs": ["string"],
"skuLimit": "number"
},
"list_consumptions": {
"arpdMeterConsumption": "string",
"consumptionRef": "string"
},
"list_services": ["string"],
"mainCatalogRef": "string",
"mainSubscriptionRef": "string",
"name": "string",
"notifications": [
{
"sendDate": "timestamp",
"type": "string"
}
],
"startDate": "string",
"status": "string",
"store": "string",
"subscriptionDetailsRef": "string",
"subscriptionType": "string",
"webUrl": "string"
}
Indexes
- clientRef is a
stringthat refers to the ID of theClientcollection; - id is a
stringthat refers to the ID of this collection; - list_catalogues_refs is a
[]ofstrings that refer to the IDs of theCataloguescollection; - consumptionRef is a
stringthat refers to the ID of theContatori_Brandcollection; - list_services is a
[]ofstrings that refer to the IDs of theService_ARShadescollection; - mainCatalogRef is a
stringthat refers to the ID of theCataloguescollection; - mainSubscriptionRef is a
stringthat refers to the ID of theARShadesSubscriptionscollection;
Query examples
// Fetch the Reference Doc from Firebase
const subscriptionRefDoc = doc(db, "ARShadesSubscriptions", subscriptionsId);
// Get the Document Snapshot from the Reference Doc
const subscriptionRefSnap = await getDoc(subscriptionRefDoc);
// Query for active subscriptions
const subscriptionsByActiveStatus = query(
collection(db, "ARShadesSubscriptions"),
where("status", "==", "Active")
);
// Query subscriptions for a specific catalogue
const subscriptionsByCatalogue = query(
collection(db, "ARShadesSubscriptions"),
where("list_catalogues_refs", "array-contains", catalogueId)
);