Skip to main content
Version: 1.0.0

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 [] of strings that refer to the IDs of the Catalogues collection;
  • privacy_policy is a string that refers to the ID of the PrivacyPolicy collection;
  • terms_and_conditions is a string that refers to the ID of the TermsAndCondition collection;
  • version_config is a string that refers to the ID of the Version_Config collection.

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)
);