Service - Product Attributes: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 37: Line 37:
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "productAttributeLabel",
nodeLabel: "{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Label",
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
productAttributeLabelId: {
identifier: true, //(random uuid)
},
},
}
}
}
</syntaxhighlight>
* groups product attributes, eg: "colour", "size", etc..
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "productAttribute",
nodeLabel: "{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}",
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
productAttributeId: {
identifier: true, //(random uuid)
},
},
}
}
}
</syntaxhighlight>
* one product attributes value inside one product label, eg: "green" under the "colour" label
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "productAttributeLink",
nodeLabel: "{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Link",
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
productAttributeLinkId: {
identifier: true, //(random uuid)
},
productId: {
immutable: true,
},
productAttributeId: {
immutable: true,
},
},
}
}
}
</syntaxhighlight>
* creates the attribute tree links
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "productAttributePropertyLabel",
nodeLabel: "{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}PropertyLabel",
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
propertyLabelId: {
identifier: true,
},
},
}
}
}
</syntaxhighlight>
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "productAttributeProperty",
nodeLabel: "{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Property",
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
propertyId: {
identifier: true, //(random uuid)
},
productAttributeId: {
immutable: true,
},
},
}
}
}
</syntaxhighlight>
</syntaxhighlight>
* see [[NPM module - Izara Core - Attribute Tree|DataSchemaLib]]


=== Relationships ===
=== Relationships ===
Line 131: Line 58:
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "hasProductAttributeLink",
relationshipType: "has_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Link",
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
}
</syntaxhighlight>
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "disabledProductAttributeLink",
relationshipType: "disabled_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Link",
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
}
</syntaxhighlight>
* creates a link in attribute tree between a Product or ProductAttributeLink, and a child ProductAttributeLink
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "isProductAttribute",
relationshipType: "is_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}",
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
}
</syntaxhighlight>
* links one ProductAttributeLink to one ProductAttribute
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "isProductAttributeLabel",
relationshipType: "is_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Label",
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
}
</syntaxhighlight>
* links one ProductAttribute to one ProductAttributeLabel
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "hasProductAttributeProperty",
relationshipType: "has_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Property",
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
}
</syntaxhighlight>
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "disabledProductAttributeProperty",
relationshipType: "disabled_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Property",
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
}
</syntaxhighlight>
* links a ProductAttribute node to it's Properties
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "isProductAttributePropertyLabel",
relationshipType: "is_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}PropertyLabel",
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
}
</syntaxhighlight>
</syntaxhighlight>
* links one ProductAttributeProperty to one ProductAttributePropertyLabel
* see [[NPM module - Izara Core - Attribute Tree|DataSchemaLib]]


== Basic node schemas ==
== Basic node schemas ==


productAttributeLabel
Schema comes from [[NPM module - Izara Core - Attribute Tree|BasicNodeSchemaLib]]
* [[Service - Translations Graph]]
 
productAttribute
* [[Service - Media Graph]]
* [[Service - Translations Graph]]
 
productAttributePropertyLabel
* [[Service - Translations Graph]]


productAttributeProperty
# {ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Label
* [[Service - Translations Graph]]
#* [[Service - Translations Graph]]
# {ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}
#* [[Service - Media Graph]]
#* [[Service - Translations Graph]]
# {ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}PropertyLabel
#* [[Service - Translations Graph]]
# {ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Property
#* [[Service - Translations Graph]]


= Working documents =
= Working documents =

Latest revision as of 12:18, 18 September 2021

Overview

Manages Product Attributes and ProductAttributeLinks. Product Attributes can be shared by many Products, ProductAttributeLinks are used to create an attribute tree for one Product.

Repository

https://bitbucket.org/izara-market-products/izara-market-products-product-attributes/src/master/

DynamoDB tables

Standard Config Table Per Service

Configuration tags

..

LogicalResults

Stores results for any requests to perform logical searches on media links

{
	resultId: xxx // eg: filterMainId for a single logical element
	dataId: xxx // one productAttributeLinkId
}
  • partition key: resultId
  • sort key: dataId

Graph database

Service - Products Graph

Nodes

{
	nodeLabel: "{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Label",
}
{
	nodeLabel: "{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}",
}
{
	nodeLabel: "{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Link",
}
{
	nodeLabel: "{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}PropertyLabel",
}
{
	nodeLabel: "{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Property",
}

Relationships

{
	relationshipType: "has_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Link",
}
{
	relationshipType: "disabled_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Link",
}
{
	relationshipType: "is_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}",
}
{
	relationshipType: "is_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Label",
}
{
	relationshipType: "has_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Property",
}
{
	relationshipType: "disabled_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Property",
}
{
	relationshipType: "is_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}PropertyLabel",
}

Basic node schemas

Schema comes from BasicNodeSchemaLib

  1. {ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Label
  2. {ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}
  3. {ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}PropertyLabel
  4. {ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Property

Working documents

Product Attributes