Service - Product Standard: 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-standard/src/master/ | https://bitbucket.org/izara-market-products/izara-market-products-product-standard/src/master/ | ||
= Schemas = | |||
==ObjectSchemas== | |||
=== productStandard === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "productStandard", | |||
"extendObjType": { | |||
"serviceTag": "ProductManager", | |||
"objectType": "product" | |||
}, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"addOnDataStructure": [], | |||
"fieldNames": { | |||
"productId": { | |||
"storageResourceTags": [ | |||
"graph" | |||
] | |||
} | |||
}, | |||
"generatedBy": "userGenerated" | |||
} | |||
</syntaxhighlight> | |||
=== productRecord === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "productRecord", | |||
"canDelete": true, | |||
"belongTo": { | |||
"serviceTag": "UserAccount", | |||
"objectType": "user" | |||
}, | |||
"storageResources": { | |||
"dynamoDB": { | |||
"storageType": "dynamoDB", | |||
"tableName": "ProductStandard", | |||
"serviceTag": "ProductManager" | |||
}, | |||
"myGraph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"addOnDataStructure": [ | |||
{ | |||
"type": "propertyValue" | |||
} | |||
], | |||
"fieldNames": { | |||
"productId": { | |||
"type": "string", | |||
"randomOnCreate": false, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": true, | |||
"canUpdate": false, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9_-]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"dynamoDB" | |||
] | |||
}, | |||
"productHandlerServiceNameTag": { | |||
"type": "string", | |||
"randomOnCreate": false, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": true, | |||
"canUpdate": false, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9_-]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"dynamoDB" | |||
] | |||
} | |||
}, | |||
"compositeKeyDeliminator": "_", | |||
"identifiers": [ | |||
{ | |||
"type": "partitionKey", | |||
"fieldName": "productId" | |||
} | |||
], | |||
"generatedBy": "userGenerated" | |||
} | |||
</syntaxhighlight> | |||
== RelationshipSchemas == | |||
=== isProduct === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"relationshipServiceTag": "ProductManager", | |||
"fieldNames": { | |||
"originTimeStamp": { | |||
"type": "number", | |||
"requiredOnCreate": false, | |||
"canUpdate": true, | |||
"validation": { | |||
}, | |||
"optionalOnCreate": false | |||
}, | |||
"relId": { | |||
"type": "string", | |||
"generatedField": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"validation": { | |||
} | |||
} | |||
}, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"links": [ | |||
{ | |||
"storageResourceTags": [ | |||
"graph" | |||
], | |||
"from": { | |||
"objType": { | |||
"serviceTag": "VariantStandard", | |||
"objectType": "variantProductLink" | |||
}, | |||
"linkType": "one", | |||
"requiredOnCreate": true, | |||
"handler": true | |||
}, | |||
"to": { | |||
"objType": { | |||
"serviceTag": "ProductStandard", | |||
"objectType": "productStandard" | |||
}, | |||
"linkType": "one", | |||
"handler": true, | |||
"requiredOnCreate": false | |||
}, | |||
"canDelete": false | |||
} | |||
], | |||
"canMove": false | |||
} | |||
</syntaxhighlight> | |||
= DynamoDB tables = | = DynamoDB tables = | ||
Revision as of 07:03, 23 December 2025
Overview
Handler service for the standard product type.
Repository
https://bitbucket.org/izara-market-products/izara-market-products-product-standard/src/master/
Schemas
ObjectSchemas
productStandard
{
"objectType": "productStandard",
"extendObjType": {
"serviceTag": "ProductManager",
"objectType": "product"
},
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"addOnDataStructure": [],
"fieldNames": {
"productId": {
"storageResourceTags": [
"graph"
]
}
},
"generatedBy": "userGenerated"
}
productRecord
{
"objectType": "productRecord",
"canDelete": true,
"belongTo": {
"serviceTag": "UserAccount",
"objectType": "user"
},
"storageResources": {
"dynamoDB": {
"storageType": "dynamoDB",
"tableName": "ProductStandard",
"serviceTag": "ProductManager"
},
"myGraph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"addOnDataStructure": [
{
"type": "propertyValue"
}
],
"fieldNames": {
"productId": {
"type": "string",
"randomOnCreate": false,
"requiredOnCreate": false,
"optionalOnCreate": true,
"canUpdate": false,
"validation": {
"pattern": "^[a-zA-Z0-9_-]+$"
},
"storageResourceTags": [
"dynamoDB"
]
},
"productHandlerServiceNameTag": {
"type": "string",
"randomOnCreate": false,
"requiredOnCreate": false,
"optionalOnCreate": true,
"canUpdate": false,
"validation": {
"pattern": "^[a-zA-Z0-9_-]+$"
},
"storageResourceTags": [
"dynamoDB"
]
}
},
"compositeKeyDeliminator": "_",
"identifiers": [
{
"type": "partitionKey",
"fieldName": "productId"
}
],
"generatedBy": "userGenerated"
}
RelationshipSchemas
isProduct
{
"relationshipServiceTag": "ProductManager",
"fieldNames": {
"originTimeStamp": {
"type": "number",
"requiredOnCreate": false,
"canUpdate": true,
"validation": {
},
"optionalOnCreate": false
},
"relId": {
"type": "string",
"generatedField": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"validation": {
}
}
},
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"links": [
{
"storageResourceTags": [
"graph"
],
"from": {
"objType": {
"serviceTag": "VariantStandard",
"objectType": "variantProductLink"
},
"linkType": "one",
"requiredOnCreate": true,
"handler": true
},
"to": {
"objType": {
"serviceTag": "ProductStandard",
"objectType": "productStandard"
},
"linkType": "one",
"handler": true,
"requiredOnCreate": false
},
"canDelete": false
}
],
"canMove": false
}
DynamoDB tables
Standard Config Table Per Service
Configuration tags
{
configTag: "ProductHandlerServiceNameTag"
configKey: "ProductHandlerServiceNameTag"
configValue: xxx // this own services ServiceNameTag, eg "ProductStandard"
}
{
configTag: "ProductGraphServiceName"
configKey: "ProductGraphServiceName"
configValue: xxx // eg: "ProductGraph"
}
{
configTag: "ProductManagerServiceName"
configKey: "ProductManagerServiceName"
configValue: xxx // eg: "ProductManager"
}
LogicalResults
Stores results for any requests to perform logical searches on product data
{
resultId: xxx // eg: filterMainId for a single logical element
dataId: xxx // one productId
}
- partition key: resultId
- sort key: dataId
Graph database
Service - Products Graph
Nodes
{
nodeLabel: "{ProductStandardLib.PRODUCT_GRAPH_NODE_LABEL}",
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
productId: {
identifier: true, //(random uuid)
},
productHandlerServiceNameTag: {
immutable: true,
},
},
}
}