Service - Variant Standard: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 106: Line 106:
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "{VariantStandardLib.createHasVariantProductLinkGraphRelationshipType()}", // "hasVariantProductLink"
relationshipType: "{VariantStandardLib.createHasVariantProductLinkGraphRelationshipType()}", // "has_variantProductLink"
schema: {
schema: {
elementCanBeRemoved: true,
elementCanBeRemoved: true,
Line 119: Line 119:
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "{VariantStandardLib.createDisabledVariantProductLinkGraphRelationshipType()}", //"disabledVariantProductLink"
relationshipType: "{VariantStandardLib.createDisabledVariantProductLinkGraphRelationshipType()}", //"disabled_variantProductLink"
schema: {
schema: {
elementCanBeRemoved: true,
elementCanBeRemoved: true,

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