Service - Delivery Method Manager: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| (2 intermediate revisions by one other user not shown) | |||
| Line 8: | Line 8: | ||
https://bitbucket.org/izara-market-products/izara-market-products-delivery-method-manager | https://bitbucket.org/izara-market-products/izara-market-products-delivery-method-manager | ||
= Schemas = | |||
== deliveryMethod == | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "deliveryMethod", | |||
"canDelete": false, | |||
"storageResources": { | |||
"dynamoDB": { | |||
"storageType": "dynamoDB", | |||
"tableName": "DeliveryMethodRecord", | |||
"serviceTag": "DeliveryMethodMgr" | |||
}, | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"fieldNames": { | |||
"deliveryMethodId": { | |||
"type": "string", | |||
"randomOnCreate": true, | |||
"optionalOnCreate": false, | |||
"requiredOnCreate": false, | |||
"canUpdate": false, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9_-]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"dynamoDB" | |||
] | |||
}, | |||
"deliveryMethodHandlerServiceNameTag": { | |||
"type": "string", | |||
"randomOnCreate": false, | |||
"optionalOnCreate": true, | |||
"requiredOnCreate": false, | |||
"canUpdate": true, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9_-]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"dynamoDB" | |||
] | |||
} | |||
}, | |||
"identifiers": [ | |||
{ | |||
"type": "identifier", | |||
"fieldName": "deliveryMethodId" | |||
} | |||
], | |||
"generatedBy": "userGenerated" | |||
} | |||
</syntaxhighlight> | |||
= DynamoDB tables = | = DynamoDB tables = | ||
| Line 46: | Line 102: | ||
* partition key: deliveryMethodId | * partition key: deliveryMethodId | ||
* sort key: (none) | * sort key: (none) | ||
== [[Service - Products Graph]]== | |||
=== Nodes === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
nodeLabel: "{DeliveryMethodManagerLib.DELIVERYMETHOD_GRAPH_NODE_LABEL}", // "deliveryMethod" | |||
schema: { | |||
identifier: true, | |||
restrictProperties: true, | |||
restrictRelationships: true, | |||
properties: { | |||
deliveryMethodId: { | |||
identifier: true, // create unique id from translation | |||
}, | |||
deliveryMethodHandlerServiceNameTag: { | |||
immutable: true, | |||
}, | |||
currencyId: { | |||
immutable: true, // cannot change after creating | |||
} | |||
}, | |||
} | |||
} | |||
</syntaxhighlight> | |||
== Basic node schemas == | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
nodeLabel: "{DeliveryMethodStandardLib.DELIVERYMETHOD_GRAPH_NODE_LABEL}" | |||
schema: { | |||
identifier: true, | |||
restrictProperties: true, | |||
restrictRelationships: true, | |||
properties: { | |||
deliveryMethodId: { | |||
identifier: true, | |||
}, | |||
deliveryMethodHandlerServiceNameTag: { | |||
immutable: true, | |||
}, | |||
}, | |||
} | |||
} | |||
</syntaxhighlight> | |||
* [[Service - Translations Graph]] | |||
* [[Service - Orders Graph]] | |||
=== Schema comes from [[NPM module - Izara Core - Property Node|BasicNodeSchemaLib]] === | |||
# deliveryMethodPropertyLabel | |||
#* [[Service - Translations Graph]] | |||
# deliveryMethodProperty | |||
#* [[Service - Translations Graph]] | |||
= Complex Filter requests = | = Complex Filter requests = | ||
* Not yet used at the Manager level, would send requests to all handlers, could perhaps setup to automatically pass on processLogical requests to all handlers, and not have a processLogical function in the Manager service | |||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
Latest revision as of 07:03, 24 November 2025
Overview
Each delivery method is handled by a Service - Delivery Method (handlers) service, with Service - Delivery Method Standard handling simple delivery methods with rate tables.
The Delivery Method Manager service handles shared orchestration of Delivery Method Handler services.
Repository
https://bitbucket.org/izara-market-products/izara-market-products-delivery-method-manager
Schemas
deliveryMethod
{
"objectType": "deliveryMethod",
"canDelete": false,
"storageResources": {
"dynamoDB": {
"storageType": "dynamoDB",
"tableName": "DeliveryMethodRecord",
"serviceTag": "DeliveryMethodMgr"
},
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"fieldNames": {
"deliveryMethodId": {
"type": "string",
"randomOnCreate": true,
"optionalOnCreate": false,
"requiredOnCreate": false,
"canUpdate": false,
"validation": {
"pattern": "^[a-zA-Z0-9_-]+$"
},
"storageResourceTags": [
"dynamoDB"
]
},
"deliveryMethodHandlerServiceNameTag": {
"type": "string",
"randomOnCreate": false,
"optionalOnCreate": true,
"requiredOnCreate": false,
"canUpdate": true,
"validation": {
"pattern": "^[a-zA-Z0-9_-]+$"
},
"storageResourceTags": [
"dynamoDB"
]
}
},
"identifiers": [
{
"type": "identifier",
"fieldName": "deliveryMethodId"
}
],
"generatedBy": "userGenerated"
}
DynamoDB tables
Standard Config Table Per Service
Configuration tags
{
configKey: "ProductGraphServiceName"
configTag: "ProductGraphServiceName"
configValue: xxx // eg: "ProductGraph"
}
{
configKey: "DeliveryMethodHandlerService"
configTag: xxx // deliveryMethodHandlerServiceNameTag, eg: "DeliveryMethodStandard"
configValue: {
serviceName: xxx // eg: "DeliveryMethodStandard", this is the actual deployed service name
}
}
DeliveryMethodRecord
Records which Handler manages each payment method
{
deliveryMethodId
deliveryMethodHandlerServiceNameTag
}
- partition key: deliveryMethodId
- sort key: (none)
Service - Products Graph
Nodes
{
nodeLabel: "{DeliveryMethodManagerLib.DELIVERYMETHOD_GRAPH_NODE_LABEL}", // "deliveryMethod"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
deliveryMethodId: {
identifier: true, // create unique id from translation
},
deliveryMethodHandlerServiceNameTag: {
immutable: true,
},
currencyId: {
immutable: true, // cannot change after creating
}
},
}
}
Basic node schemas
{
nodeLabel: "{DeliveryMethodStandardLib.DELIVERYMETHOD_GRAPH_NODE_LABEL}"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
deliveryMethodId: {
identifier: true,
},
deliveryMethodHandlerServiceNameTag: {
immutable: true,
},
},
}
}
Schema comes from BasicNodeSchemaLib
- deliveryMethodPropertyLabel
- deliveryMethodProperty
Complex Filter requests
- Not yet used at the Manager level, would send requests to all handlers, could perhaps setup to automatically pass on processLogical requests to all handlers, and not have a processLogical function in the Manager service
{
filterType: "managerDeliveryMethod" //unique id is deliveryMethodId
type: "group",
elements:
[
{
type: "logical",
logicalTag: "currencyId",
comparison: "equals",
value: "xx"
},
{
type: "logical",
logicalTag: "fromLocationNodeId",
comparison: "equals",
value: "xx"
},
{
type: "complexFilter",
complexFilter: {
filterType: "deliveryMethodProperty",
// see [[NPM module - Izara Core - Property Node|Complex Filter requests]]
}
},
{
type: "complexFilter",
complexFilter: {
filterType: "deliveryMethodNameTranslation" //unique id is deliveryMethodId
type: "group",
elements:
[
{
// see [[Service - Translations|Complex Filter requests]]
type: "logical",
logicalTag: "textTag_languageId_text",
resultType: "deliveryMethod",
textTag: "deliveryMethodName",
languageId: "en",
text: "Is a great term",
subjectIdentifierPropertyName: "deliveryMethodId",
caseSensitive: true
},
]
}
},
...
]
}