Service - Product Manager: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 8: | Line 8: | ||
https://bitbucket.org/izara-market-products/izara-market-products-product-manager/src/master/ | https://bitbucket.org/izara-market-products/izara-market-products-product-manager/src/master/ | ||
= Schemas = | |||
==ObjectSchemas== | |||
=== product === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "product", | |||
"canDelete": true, | |||
"belongTo": { | |||
"serviceTag": "UserAccount", | |||
"objectType": "user" | |||
}, | |||
"addOnDataStructure": [], | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"fieldNames": { | |||
"productId": { | |||
"type": "string", | |||
"randomOnCreate": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9_-]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"graph" | |||
] | |||
} | |||
}, | |||
"compositeKeyDeliminator": "_", | |||
"identifiers": [ | |||
{ | |||
"type": "identifier", | |||
"fieldName": "productId" | |||
} | |||
], | |||
"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 06:46, 23 December 2025
Overview
Each product is handled by a Service - Product (handlers) service.
The Product Manager service handles shared orchestration of the Product Handler services.
Repository
https://bitbucket.org/izara-market-products/izara-market-products-product-manager/src/master/
Schemas
ObjectSchemas
product
{
"objectType": "product",
"canDelete": true,
"belongTo": {
"serviceTag": "UserAccount",
"objectType": "user"
},
"addOnDataStructure": [],
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"fieldNames": {
"productId": {
"type": "string",
"randomOnCreate": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"validation": {
"pattern": "^[a-zA-Z0-9_-]+$"
},
"storageResourceTags": [
"graph"
]
}
},
"compositeKeyDeliminator": "_",
"identifiers": [
{
"type": "identifier",
"fieldName": "productId"
}
],
"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
{
configKey: "ProductGraphServiceName"
configTag: "ProductGraphServiceName"
configValue: xxx // eg: "ProductGraph"
}
{
configKey: "ProductHandlerService"
configTag: xxx // productHandlerServiceNameTag, eg: "ProductStandard", this is what is saved in each catalog record
configValue: {
serviceName: xxx // eg: "ProductStandard", this is the actual deployed service name}
}
}
ProductRecord
Records which Handler manages each product
{
productId
productHandlerServiceNameTag
}
- partition key: productId
- sort key: (none)