Service - Variant Standard

From Izara Wiki
Jump to navigation Jump to search

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