AppConfig
Purpose
The AppConfig collection contains the configurations of the ARShades applications. Its purpose is to keep track of the catalogues, the privacy policies, terms and conditions, and version configurations that are applied for each specific app.
Document schema
{
"brands": ["string"],
"privacy_policy": "string",
"terms_and_conditions": "string",
"version_config": "string"
}
Indexes
- brands is a
[]ofstrings that refer to the IDs of theCataloguescollection; - privacy_policy is a
stringthat refers to the ID of thePrivacyPolicycollection; - terms_and_conditions is a
stringthat refers to the ID of theTermsAndConditioncollection; - version_config is a
stringthat refers to the ID of theVersion_Configcollection.
Query examples
// Fetch the Reference Doc from Firebase
const appConfigRef = doc(db, "AppConfig", appConfigId);
// Get the Document Snapshot from the Reference Doc
const appConfigSnap = await getDoc(appConfigRef);
// Query appConfig by catalog
const appConfigByCatalog = query(
collection(db, "AppConfig"),
where("brands", "array-contains", catalogueId)
);
// Query appConfig by privacy_policy
const appConfigByPrivacyPolicy = query(
collection(db, "AppConfig"),
where("privacy_policy", "==", privacyId)
);
// Query appConfig by terms_and_conditions
const appConfigByTermsAndCond = query(
collection(db, "AppConfig"),
where("terms_and_conditions", "==", termsAndCondId)
);
// Query appConfig by version_config
const appConfigByVersionConfg = query(
collection(db, "AppConfig"),
where("version_config", "==", versionConfgId)
);