Service - Product Attributes: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
| Line 6: | Line 6: | ||
https://bitbucket.org/izara-market-products/izara-market-products-product-attributes/src/master/ | https://bitbucket.org/izara-market-products/izara-market-products-product-attributes/src/master/ | ||
= Schemas = | |||
==ObjectSchemas== | |||
=== productAttribute === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "productAttribute", | |||
"canDelete": true, | |||
"storageResources": { | |||
"mainGraph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"addOnDataStructure": [ | |||
{ | |||
"type": "translation" | |||
} | |||
], | |||
"fieldNames": { | |||
"productAttributeId": { | |||
"type": "string", | |||
"randomOnCreate": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9_-]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"mainGraph" | |||
] | |||
} | |||
}, | |||
"compositeKeyDeliminator": "_", | |||
"identifiers": [ | |||
{ | |||
"type": "identifier", | |||
"fieldName": "productAttributeId" | |||
} | |||
], | |||
"generatedBy": "userGenerated" | |||
} | |||
</syntaxhighlight> | |||
=== productAttributeLink === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "productAttributeLink", | |||
"canDelete": true, | |||
"storageResources": { | |||
"mainGraph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"fieldNames": { | |||
"productAttributeLinkId": { | |||
"type": "string", | |||
"randomOnCreate": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9_-]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"mainGraph" | |||
] | |||
} | |||
}, | |||
"compositeKeyDeliminator": "_", | |||
"identifiers": [ | |||
{ | |||
"type": "identifier", | |||
"fieldName": "productAttributeLinkId" | |||
} | |||
], | |||
"generatedBy": "userGenerated" | |||
} | |||
</syntaxhighlight> | |||
=== productAttributeLabel === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "productAttributeLabel", | |||
"canDelete": true, | |||
"storageResources": { | |||
"mainGraph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"addOnDataStructure": [ | |||
{ | |||
"type": "translation" | |||
} | |||
], | |||
"fieldNames": { | |||
"labelId": { | |||
"type": "string", | |||
"randomOnCreate": true, | |||
"optionalOnCreate": false, | |||
"requiredOnCreate": false, | |||
"canUpdate": false, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9_-]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"mainGraph" | |||
] | |||
} | |||
}, | |||
"compositeKeyDeliminator": "_", | |||
"identifiers": [ | |||
{ | |||
"type": "identifier", | |||
"fieldName": "labelId" | |||
} | |||
], | |||
"generatedBy": "userGenerated" | |||
} | |||
</syntaxhighlight> | |||
== RelationshipSchemas == | |||
=== isProductAttribute === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"relationshipServiceTag": "ProductAttribute", | |||
"fieldNames": { | |||
"originTimestamp": { | |||
"type": "number", | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": true, | |||
"canUpdate": true, | |||
"validation": { | |||
} | |||
}, | |||
"relId": { | |||
"type": "string", | |||
"generatedField": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"validation": { | |||
} | |||
} | |||
}, | |||
"storageResources": { | |||
"mainGraph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"links": [ | |||
{ | |||
"storageResourceTags": [ | |||
"mainGraph" | |||
], | |||
"from": { | |||
"objType": { | |||
"serviceTag": "ProductAttribute", | |||
"objectType": "productAttributeLink" | |||
}, | |||
"linkType": "one", | |||
"requiredOnCreate": true, | |||
"handler": false | |||
}, | |||
"to": { | |||
"objType": { | |||
"serviceTag": "ProductAttribute", | |||
"objectType": "productAttribute" | |||
}, | |||
"requiredOnCreate": false, | |||
"linkType": "one", | |||
"handler": true | |||
}, | |||
"canDelete": false | |||
} | |||
], | |||
"canMove": false | |||
} | |||
</syntaxhighlight> | |||
=== isProductAttributeLabel === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"relationshipServiceTag": "ProductAttribute", | |||
"fieldNames": { | |||
"originTimestamp": { | |||
"type": "number", | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": true, | |||
"canUpdate": true, | |||
"validation": { | |||
} | |||
}, | |||
"relId": { | |||
"type": "string", | |||
"generatedField": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"validation": { | |||
} | |||
} | |||
}, | |||
"storageResources": { | |||
"mainGraph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"links": [ | |||
{ | |||
"storageResourceTags": [ | |||
"mainGraph" | |||
], | |||
"from": { | |||
"objType": { | |||
"serviceTag": "ProductAttribute", | |||
"objectType": "productAttribute" | |||
}, | |||
"linkType": "many", | |||
"requiredOnCreate": true, | |||
"handler": false | |||
}, | |||
"to": { | |||
"objType": { | |||
"serviceTag": "ProductAttribute", | |||
"objectType": "productAttributeLabel" | |||
}, | |||
"requiredOnCreate": false, | |||
"linkType": "one", | |||
"handler": true | |||
}, | |||
"canDelete": false | |||
} | |||
], | |||
"canMove": false | |||
} | |||
</syntaxhighlight> | |||
=== hasProductAttributeLink === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"relationshipServiceTag": "ProductAttribute", | |||
"fieldNames": { | |||
"originTimestamp": { | |||
"type": "number", | |||
"optionalOnCreate": true, | |||
"canUpdate": true, | |||
"validation": { | |||
}, | |||
"requiredOnCreate": false | |||
}, | |||
"relId": { | |||
"type": "string", | |||
"generatedField": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"validation": { | |||
} | |||
} | |||
}, | |||
"storageResources": { | |||
"mainGraph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"links": [ | |||
{ | |||
"storageResourceTags": [ | |||
"mainGraph" | |||
], | |||
"from": { | |||
"objType": { | |||
"serviceTag": "ProductManager", | |||
"objectType": "product" | |||
}, | |||
"linkType": "one", | |||
"requiredOnCreate": false, | |||
"handler": false | |||
}, | |||
"to": { | |||
"objType": { | |||
"serviceTag": "ProductAttribute", | |||
"objectType": "productAttributeLink" | |||
}, | |||
"requiredOnCreate": true, | |||
"linkType": "many", | |||
"handler": true | |||
}, | |||
"canDelete": false | |||
}, | |||
{ | |||
"storageResourceTags": [ | |||
"mainGraph" | |||
], | |||
"from": { | |||
"objType": { | |||
"serviceTag": "ProductAttribute", | |||
"objectType": "productAttributeLink" | |||
}, | |||
"linkType": "one", | |||
"requiredOnCreate": false, | |||
"handler": false | |||
}, | |||
"to": { | |||
"objType": { | |||
"serviceTag": "ProductAttribute", | |||
"objectType": "productAttributeLink" | |||
}, | |||
"requiredOnCreate": true, | |||
"linkType": "many", | |||
"handler": true | |||
}, | |||
"canDelete": false | |||
} | |||
], | |||
"canChangeToRelTypes": [ | |||
{ | |||
"serviceTag": "ProductAttribute", | |||
"relationshipTag": "disabledProductAttributeLink" | |||
} | |||
], | |||
"canMove": false | |||
} | |||
</syntaxhighlight> | |||
=== disabledProductAttributeLink === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"relationshipServiceTag": "ProductAttribute", | |||
"fieldNames": { | |||
"originTimestamp": { | |||
"type": "number", | |||
"requiredOnCreate": true, | |||
"optionalOnCreate": true, | |||
"canUpdate": true, | |||
"validation": { | |||
} | |||
}, | |||
"relId": { | |||
"type": "string", | |||
"generatedField": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"validation": { | |||
} | |||
} | |||
}, | |||
"storageResources": { | |||
"mainGraph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"links": [ | |||
{ | |||
"storageResourceTags": [ | |||
"mainGraph" | |||
], | |||
"from": { | |||
"objType": { | |||
"serviceTag": "ProductManager", | |||
"objectType": "product" | |||
}, | |||
"linkType": "one", | |||
"requiredOnCreate": false, | |||
"handler": false | |||
}, | |||
"to": { | |||
"objType": { | |||
"serviceTag": "ProductAttribute", | |||
"objectType": "productAttributeLink" | |||
}, | |||
"requiredOnCreate": false, | |||
"linkType": "many", | |||
"handler": true | |||
}, | |||
"canDelete": false | |||
} | |||
], | |||
"canChangeToRelTypes": [ | |||
{ | |||
"serviceTag": "ProductAttribute", | |||
"relationshipTag": "hasProductAttributeLink" | |||
} | |||
], | |||
"canMove": false | |||
} | |||
</syntaxhighlight> | |||
= DynamoDB tables = | = DynamoDB tables = | ||
Revision as of 08:01, 23 December 2025
Overview
Manages Product Attributes and ProductAttributeLinks. Product Attributes can be shared by many Products, ProductAttributeLinks are used to create an attribute tree for one Product.
Repository
https://bitbucket.org/izara-market-products/izara-market-products-product-attributes/src/master/
Schemas
ObjectSchemas
productAttribute
{
"objectType": "productAttribute",
"canDelete": true,
"storageResources": {
"mainGraph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"addOnDataStructure": [
{
"type": "translation"
}
],
"fieldNames": {
"productAttributeId": {
"type": "string",
"randomOnCreate": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"validation": {
"pattern": "^[a-zA-Z0-9_-]+$"
},
"storageResourceTags": [
"mainGraph"
]
}
},
"compositeKeyDeliminator": "_",
"identifiers": [
{
"type": "identifier",
"fieldName": "productAttributeId"
}
],
"generatedBy": "userGenerated"
}
productAttributeLink
{
"objectType": "productAttributeLink",
"canDelete": true,
"storageResources": {
"mainGraph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"fieldNames": {
"productAttributeLinkId": {
"type": "string",
"randomOnCreate": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"validation": {
"pattern": "^[a-zA-Z0-9_-]+$"
},
"storageResourceTags": [
"mainGraph"
]
}
},
"compositeKeyDeliminator": "_",
"identifiers": [
{
"type": "identifier",
"fieldName": "productAttributeLinkId"
}
],
"generatedBy": "userGenerated"
}
productAttributeLabel
{
"objectType": "productAttributeLabel",
"canDelete": true,
"storageResources": {
"mainGraph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"addOnDataStructure": [
{
"type": "translation"
}
],
"fieldNames": {
"labelId": {
"type": "string",
"randomOnCreate": true,
"optionalOnCreate": false,
"requiredOnCreate": false,
"canUpdate": false,
"validation": {
"pattern": "^[a-zA-Z0-9_-]+$"
},
"storageResourceTags": [
"mainGraph"
]
}
},
"compositeKeyDeliminator": "_",
"identifiers": [
{
"type": "identifier",
"fieldName": "labelId"
}
],
"generatedBy": "userGenerated"
}
RelationshipSchemas
isProductAttribute
{
"relationshipServiceTag": "ProductAttribute",
"fieldNames": {
"originTimestamp": {
"type": "number",
"requiredOnCreate": false,
"optionalOnCreate": true,
"canUpdate": true,
"validation": {
}
},
"relId": {
"type": "string",
"generatedField": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"validation": {
}
}
},
"storageResources": {
"mainGraph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"links": [
{
"storageResourceTags": [
"mainGraph"
],
"from": {
"objType": {
"serviceTag": "ProductAttribute",
"objectType": "productAttributeLink"
},
"linkType": "one",
"requiredOnCreate": true,
"handler": false
},
"to": {
"objType": {
"serviceTag": "ProductAttribute",
"objectType": "productAttribute"
},
"requiredOnCreate": false,
"linkType": "one",
"handler": true
},
"canDelete": false
}
],
"canMove": false
}
isProductAttributeLabel
{
"relationshipServiceTag": "ProductAttribute",
"fieldNames": {
"originTimestamp": {
"type": "number",
"requiredOnCreate": false,
"optionalOnCreate": true,
"canUpdate": true,
"validation": {
}
},
"relId": {
"type": "string",
"generatedField": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"validation": {
}
}
},
"storageResources": {
"mainGraph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"links": [
{
"storageResourceTags": [
"mainGraph"
],
"from": {
"objType": {
"serviceTag": "ProductAttribute",
"objectType": "productAttribute"
},
"linkType": "many",
"requiredOnCreate": true,
"handler": false
},
"to": {
"objType": {
"serviceTag": "ProductAttribute",
"objectType": "productAttributeLabel"
},
"requiredOnCreate": false,
"linkType": "one",
"handler": true
},
"canDelete": false
}
],
"canMove": false
}
hasProductAttributeLink
{
"relationshipServiceTag": "ProductAttribute",
"fieldNames": {
"originTimestamp": {
"type": "number",
"optionalOnCreate": true,
"canUpdate": true,
"validation": {
},
"requiredOnCreate": false
},
"relId": {
"type": "string",
"generatedField": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"validation": {
}
}
},
"storageResources": {
"mainGraph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"links": [
{
"storageResourceTags": [
"mainGraph"
],
"from": {
"objType": {
"serviceTag": "ProductManager",
"objectType": "product"
},
"linkType": "one",
"requiredOnCreate": false,
"handler": false
},
"to": {
"objType": {
"serviceTag": "ProductAttribute",
"objectType": "productAttributeLink"
},
"requiredOnCreate": true,
"linkType": "many",
"handler": true
},
"canDelete": false
},
{
"storageResourceTags": [
"mainGraph"
],
"from": {
"objType": {
"serviceTag": "ProductAttribute",
"objectType": "productAttributeLink"
},
"linkType": "one",
"requiredOnCreate": false,
"handler": false
},
"to": {
"objType": {
"serviceTag": "ProductAttribute",
"objectType": "productAttributeLink"
},
"requiredOnCreate": true,
"linkType": "many",
"handler": true
},
"canDelete": false
}
],
"canChangeToRelTypes": [
{
"serviceTag": "ProductAttribute",
"relationshipTag": "disabledProductAttributeLink"
}
],
"canMove": false
}
disabledProductAttributeLink
{
"relationshipServiceTag": "ProductAttribute",
"fieldNames": {
"originTimestamp": {
"type": "number",
"requiredOnCreate": true,
"optionalOnCreate": true,
"canUpdate": true,
"validation": {
}
},
"relId": {
"type": "string",
"generatedField": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"validation": {
}
}
},
"storageResources": {
"mainGraph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"links": [
{
"storageResourceTags": [
"mainGraph"
],
"from": {
"objType": {
"serviceTag": "ProductManager",
"objectType": "product"
},
"linkType": "one",
"requiredOnCreate": false,
"handler": false
},
"to": {
"objType": {
"serviceTag": "ProductAttribute",
"objectType": "productAttributeLink"
},
"requiredOnCreate": false,
"linkType": "many",
"handler": true
},
"canDelete": false
}
],
"canChangeToRelTypes": [
{
"serviceTag": "ProductAttribute",
"relationshipTag": "hasProductAttributeLink"
}
],
"canMove": false
}
DynamoDB tables
Standard Config Table Per Service
Configuration tags
..
LogicalResults
Stores results for any requests to perform logical searches on media links
{
resultId: xxx // eg: filterMainId for a single logical element
dataId: xxx // one productAttributeLinkId
}
- partition key: resultId
- sort key: dataId
Graph database
Service - Products Graph
Nodes
{
nodeLabel: "{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Label",
}
{
nodeLabel: "{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}",
}
{
nodeLabel: "{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Link",
}
{
nodeLabel: "{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}PropertyLabel",
}
{
nodeLabel: "{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Property",
}
- see DataSchemaLib
Relationships
{
relationshipType: "has_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Link",
}
{
relationshipType: "disabled_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Link",
}
{
relationshipType: "is_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}",
}
{
relationshipType: "is_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Label",
}
{
relationshipType: "has_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Property",
}
{
relationshipType: "disabled_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Property",
}
{
relationshipType: "is_{ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}PropertyLabel",
}
- see DataSchemaLib
Basic node schemas
Schema comes from BasicNodeSchemaLib
- {ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Label
- {ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}
- {ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}PropertyLabel
- {ProductAttributesLib.PRODUCT_ATTRIBUTE_GRAPH_NODE_LABEL}Property