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
stringthat refers to the ID ofCataloguesProductscollection; - id is a
stringthat refers to the specific ID of a document of this collection; - list_size_color_tags is a
[]ofstrings that refer to the IDs ofTagscollection; - mainBrandRef is a
stringthat refers to the ID ofMainBrandscollection; - mainVariantRef is a
stringthat refers to the ID ofVariantscollection; - productRef is a
stringthat refers to the ID ofProductscollection; - refLogVariant is a
stringthat refers to the ID ofLogVariantcollection.
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));