Service - Variant Standard: Difference between revisions
Jump to navigation
Jump to search
(→Nodes) |
|||
(8 intermediate revisions by the same user not shown) | |||
Line 23: | Line 23: | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
configTag: " | configTag: "ProductGraphServiceName" | ||
configKey: " | configKey: "ProductGraphServiceName" | ||
configValue: xxx // eg: " | 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: " | nodeLabel: "{VariantStandardLib.VARIANT_GRAPH_NODE_LABEL}", | ||
schema: { | schema: { | ||
identifier: true, | identifier: true, | ||
Line 56: | Line 69: | ||
}, | }, | ||
variantHandlerServiceNameTag: { | variantHandlerServiceNameTag: { | ||
immutable: true, | |||
}, | }, | ||
}, | }, | ||
Line 62: | Line 75: | ||
} | } | ||
</syntaxhighlight> | </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> | |||
* 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