Service - Variant Standard: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
No edit summary
 
(9 intermediate revisions by the same user not shown)
Line 23: Line 23:
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
configTag: "ProductsGraphServiceName"
configTag: "ProductGraphServiceName"
configKey: "ProductsGraphServiceName"
configKey: "ProductGraphServiceName"
configValue: xxx // eg: "ProductsGraph"
configValue: xxx // eg: "ProductGraph"
}
}
</syntaxhighlight>
</syntaxhighlight>
Line 37: Line 37:
</syntaxhighlight>
</syntaxhighlight>


== LogicalResults ==
Stores results for any requests to perform logical searches on variant data
<syntaxhighlight lang="JavaScript">
{
resultId: xxx // eg: filterMainId for a single logical element
dataId: xxx // one variantId
}
</syntaxhighlight>
* partition key: resultId
* sort key: dataId


= Graph database =  
= Graph database =  
Line 46: Line 59:
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "variant",
nodeLabel: "{VariantStandardLib.VARIANT_GRAPH_NODE_LABEL}",
schema: {
schema: {
identifier: true,
identifier: true,
Line 55: Line 68:
identifier: true, //(random uuid)
identifier: true, //(random uuid)
},
},
VariantHandlerServiceNameTag: {
variantHandlerServiceNameTag: {
idempotent: true,
immutable: true,
},
},
}
}
</syntaxhighlight>
 
<syntaxhighlight lang="JavaScript">
{
nodeLabel: "{VariantStandardLib.VARIANT_PRODUCT_LINK_GRAPH_NODE_LABEL}",
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
variantId: {
identifier: true,
},
variantHandlerServiceNameTag: {
immutable: true,
},
productId: {
identifier: true,
},
},
productHandlerServiceNameTag: {
immutable: true,
},
},
}
}
</syntaxhighlight>
* adds a node between each variant to product relationship, we do this so we can add variantProductLink specific relationships, eg to media that only relates to this link, not to other parent variants the product has
=== Relationships ===
<syntaxhighlight lang="JavaScript">
{
relationshipType: "{VariantStandardLib.createHasVariantProductLinkGraphRelationshipType()}", // "has_variantProductLink"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
</syntaxhighlight>
<syntaxhighlight lang="JavaScript">
{
relationshipType: "{VariantStandardLib.createDisabledVariantProductLinkGraphRelationshipType()}", //"disabled_variantProductLink"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
},
}
}
}
}
</syntaxhighlight>
</syntaxhighlight>
* links variant to a variantProductLink, or a variantProductLink to a product


= Working documents =
= Working documents =

Latest revision as of 13:33, 24 October 2021

Overview

Handler service for the standard variant type.

Repository

https://bitbucket.org/izara-market-products/izara-market-products-variant-standard/src/master/

DynamoDB tables

Standard Config Table Per Service

Configuration tags

{
	configTag: "VariantHandlerServiceNameTag"
	configKey: "VariantHandlerServiceNameTag"
	configValue: xxx // this own services ServiceNameTag, eg "VariantStandard"
}
{
	configTag: "ProductGraphServiceName"
	configKey: "ProductGraphServiceName"
	configValue: xxx // eg: "ProductGraph"
}
{
	configTag: "VariantManagerServiceName"
	configKey: "VariantManagerServiceName"
	configValue: xxx // eg: "ProductManager"
}

LogicalResults

Stores results for any requests to perform logical searches on variant data

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

Graph database

Service - Products Graph

Nodes

{
	nodeLabel: "{VariantStandardLib.VARIANT_GRAPH_NODE_LABEL}",
	schema: {
		identifier: true,
		restrictProperties: true,
		restrictRelationships: true,
		properties: {
			variantId: {
				identifier: true, //(random uuid)
			},
			variantHandlerServiceNameTag: {
				immutable: true,
			},
		},
	}
}
{
	nodeLabel: "{VariantStandardLib.VARIANT_PRODUCT_LINK_GRAPH_NODE_LABEL}",
	schema: {
		identifier: true,
		restrictProperties: true,
		restrictRelationships: true,
		properties: {
			variantId: {
				identifier: true,
			},
			variantHandlerServiceNameTag: {
				immutable: true,
			},
			productId: {
				identifier: true,
			},
			productHandlerServiceNameTag: {
				immutable: true,
			},
		},
	}
}
  • adds a node between each variant to product relationship, we do this so we can add variantProductLink specific relationships, eg to media that only relates to this link, not to other parent variants the product has

Relationships

{
	relationshipType: "{VariantStandardLib.createHasVariantProductLinkGraphRelationshipType()}", // "has_variantProductLink"
	schema: {
		elementCanBeRemoved: true,
		allPropertiesImmutable: true,
		restrictProperties: true,
		properties: {
			originTimestamp: //timestamp the request to create/change this relationship was sent
		},
	}
}
{
	relationshipType: "{VariantStandardLib.createDisabledVariantProductLinkGraphRelationshipType()}", //"disabled_variantProductLink"
	schema: {
		elementCanBeRemoved: true,
		allPropertiesImmutable: true,
		restrictProperties: true,
		properties: {
			originTimestamp: //timestamp the request to create/change this relationship was sent
		},
	}
}
  • links variant to a variantProductLink, or a variantProductLink to a product

Working documents

Variant Standard