Service - Variant Standard: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
Line 59: Line 59:
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "variant",
nodeLabel: "{VariantStandardLib.VARIANT_GRAPH_NODE_LABEL}",
schema: {
schema: {
identifier: true,
identifier: true,
Line 78: Line 78:
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "variantProductLink",
nodeLabel: "{VariantStandardLib.VARIANT_PRODUCT_LINK_GRAPH_NODE_LABEL}",
schema: {
schema: {
identifier: true,
identifier: true,
Line 106: Line 106:
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "hasVariantProductLink",
relationshipType: "{VariantStandardLib.createHasVariantProductLinkGraphRelationshipType()}", // "hasVariantProductLink"
schema: {
schema: {
elementCanBeRemoved: true,
elementCanBeRemoved: true,
Line 119: Line 119:
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "disabledVariantProductLink",
relationshipType: "{VariantStandardLib.createDisabledVariantProductLinkGraphRelationshipType()}", //"disabledVariantProductLink"
schema: {
schema: {
elementCanBeRemoved: true,
elementCanBeRemoved: true,

Revision as of 12:23, 18 September 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: {
				immutable: true,
			},
			variantHandlerServiceNameTag: {
				immutable: true,
			},
			productId: {
				immutable: 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()}", // "hasVariantProductLink"
	schema: {
		elementCanBeRemoved: true,
		allPropertiesImmutable: true,
		restrictProperties: true,
		properties: {
			originTimestamp: //timestamp the request to create/change this relationship was sent
		},
	}
}
{
	relationshipType: "{VariantStandardLib.createDisabledVariantProductLinkGraphRelationshipType()}", //"disabledVariantProductLink"
	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