Service - Product Attributes: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 38: Line 38:
{
{
nodeLabel: "productAttributeLabel",
nodeLabel: "productAttributeLabel",
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: "productAttribute",
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: "productAttributeLink",
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: "productAttributePropertyLabel",
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
propertyLabelId: {
identifier: true,
},
},
}
}
}
</syntaxhighlight>
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "productAttributeProperty",
nodeLabel: "productAttributeProperty",
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
propertyId: {
identifier: true, //(random uuid)
},
productAttributeId: {
immutable: true,
},
},
}
}
}
</syntaxhighlight>
</syntaxhighlight>
* see [[https://izara.io/wiki/index.php/NPM_module_-_Izara_Core_-_Attribute_Tree|DataSchemaLib]]


=== Relationships ===
=== Relationships ===
Line 132: Line 59:
{
{
relationshipType: "hasProductAttributeLink",
relationshipType: "hasProductAttributeLink",
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: "disabledProductAttributeLink",
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: "isProductAttribute",
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: "isProductAttributeLabel",
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: "hasProductAttributeProperty",
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: "disabledProductAttributeProperty",
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: "isProductAttributePropertyLabel",
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 [[https://izara.io/wiki/index.php/NPM_module_-_Izara_Core_-_Attribute_Tree|DataSchemaLib]]


== Basic node schemas ==
== Basic node schemas ==
schema comes from [[NPM module - Izara Core - Attribute Tree|BasicNodeSchemaLib]]


productAttributeLabel
productAttributeLabel

Revision as of 08:52, 11 August 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: "productAttributeLabel",
}
{
	nodeLabel: "productAttribute",
}
{
	nodeLabel: "productAttributeLink",
}
{
	nodeLabel: "productAttributePropertyLabel",
}
{
	nodeLabel: "productAttributeProperty",
}

Relationships

{
	relationshipType: "hasProductAttributeLink",
}
{
	relationshipType: "disabledProductAttributeLink",
}
{
	relationshipType: "isProductAttribute",
}
{
	relationshipType: "isProductAttributeLabel",
}
{
	relationshipType: "hasProductAttributeProperty",
}
{
	relationshipType: "disabledProductAttributeProperty",
}
{
	relationshipType: "isProductAttributePropertyLabel",
}

Basic node schemas

schema comes from BasicNodeSchemaLib

productAttributeLabel

productAttribute

productAttributePropertyLabel

productAttributeProperty

Working documents

Product Attributes