Skip to main content
Version: 1.0.0

CataloguesVariants

Purpose​

The CataloguesVariants collection stores detailed information about each product variant within a catalogue. Each document represents a specific variant, including its color, size, .glb and .usdz URLs, images, 3D/AR model links, and references to related products, brands, and tags.

Document schema​

{
"batch": "string",
"catalogProductRef": "string",
"dataTaken": "boolean",
"eanCode": "string",
"frameColor": "string",
"glassesName": "string",
"id": "string",
"isVisible": "boolean",
"lastUpdate": "timestamp",
"lensesColor": "string",
"list_size_color_tags": ["string"],
"loadingId": "string",
"mainBrandRef": "string",
"mainModel": "boolean",
"mainVariantRef": "string",
"modelPriority": "string",
"modelViewerUrl": "string",
"modify_model": {
"rejectCount": "number",
"requestCount": "number",
"status": "boolean"
},
"poster": "string",
"poster2": "string",
"poster3": "string",
"poster4": "string",
"posterNoBackground": "string",
"primaryFrameColorHex": "string",
"primaryLensesColorHex": "string",
"priority": "number",
"productRef": "string",
"publishedInARSLibrary": "timestamp",
"refLogVariant": "string",
"secondaryFrameColorHex": "string",
"secondaryLensesColorHex": "string",
"size": {
"bridge": "string",
"frameWidth": "string",
"lensHeight": "string",
"lensWidth": "string",
"size": "string",
"templeLength": "string"
},
"skuModel": "string",
"status": "string",
"templeColor": "string",
"upcCode": "string",
"urlDE": "string",
"urlES": "string",
"urlFR": "string",
"urlGlobal": "string",
"urlGlobalComplete": "string",
"urlGlobalCompleteSize": "number",
"urlGlobalSize": "number",
"urlProductPage": "string",
"urlUsdz": "string",
"urlUsdzComplete": "string",
"urlUsdzCompleteSize": "number",
"urlUsdzSize": "number",
"variantCode": "string"
}

Indexes​

  • catalogProductRef is a string that refers to the ID of CataloguesProducts collection;
  • id is a string that refers to the specific ID of a document of this collection;
  • list_size_color_tags is a [] of strings that refer to the IDs of Tags collection;
  • mainBrandRef is a string that refers to the ID of MainBrands collection;
  • mainVariantRef is a string that refers to the ID of Variants collection;
  • productRef is a string that refers to the ID of Products collection;
  • refLogVariant is a string that refers to the ID of LogVariant collection.

Query examples​

// Fetch the CatalogueVariant Reference Doc from Firebase
const catalogueVariantRefDoc = doc(db, CataloguesVariants, catalogueVariantID);

// Get the Document Snapshot from the CatalogueVariant Reference Doc
const catalogueVariantRefSnap = await getDoc(catalogueVariantRefDoc);

// Query to fetch a catalogueVariant by skuModel field
const variantBySku = query(collection(db, "CataloguesVariants"), where("skuModel", "==", skuValue));