Service - Delivery Method Standard: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 123: | Line 123: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
relationshipType: "{DeliveryMethodStandardLib.createHasDeliveryMethodRateTableGraphRelationshipType()}", // "owns_deliveryMethodRateTable" | |||
schema: { | |||
elementCanBeRemoved: true, | |||
allPropertiesImmutable: true, | |||
restrictProperties: true, | |||
properties: { | |||
originTimestamp: //timestamp the request to create/change this relationship was sent | |||
}, | |||
} | |||
} | |||
</syntaxhighlight> | |||
* controls ownership of a rateTable, many deliveryMethods can point to one rateTable but only one deliveryMethod controls it (RBAC for that deliveryMethods allows control over the rateTable) | |||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> |
Revision as of 13:03, 23 October 2021
Overview
Handler service for basic delivery methods that use Service - Delivery Method Rate Table for pricing.
Repository
https://bitbucket.org/izara-market-products/izara-market-products-delivery-method-standard
DynamoDB tables
Standard Config Table Per Service
Configuration tags
{
configTag: "DeliveryMethodHandlerServiceNameTag"
configKey: "DeliveryMethodHandlerServiceNameTag"
configValue: xxx // this own services ServiceNameTag, eg "DeliveryMethodStandard"
}
{
configTag: "ProductGraphServiceName"
configKey: "ProductGraphServiceName"
configValue: xxx // eg: "ProductGraph"
}
{
configTag: "DeliveryMethodManagerServiceName"
configKey: "DeliveryMethodManagerServiceName"
configValue: xxx // eg: "DeliveryMethodManager"
}
{
configTag: "DeliveryMethodRateTableServiceName"
configKey: "DeliveryMethodRateTableServiceName"
configValue: xxx // eg: "DeliveryMethodRateTable"
}
Graph database
Service - Products Graph
Nodes
{
nodeLabel: "{DeliveryMethodStandardLib.DELIVERYMETHOD_GRAPH_NODE_LABEL}", // "deliveryMethod"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
deliveryMethodId: {
identifier: true, // create unique id from translation
},
deliveryMethodHandlerServiceNameTag: {
immutable: true,
},
defaultValueType: {},
defaultValueId: {},
},
}
}
{
nodeLabel: "{DeliveryMethodStandardLib.DELIVERYMETHOD_GRAPH_NODE_LABEL}PropertyLabel",
}
{
nodeLabel: "{DeliveryMethodStandardLib.DELIVERYMETHOD_GRAPH_NODE_LABEL}Property",
}
- see DataSchemaLib
Relationships
{
relationshipType: "{DeliveryMethodStandardLib.createfromLocationNodeRelationshipType()}", // "from_LocationNode"
schema: {
elementCanBeRemoved: false,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
{
relationshipType: "{DeliveryMethodStandardLib.createHasDeliveryMethodRateTableGraphRelationshipType()}", // "has_deliveryMethodRateTable"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
{
relationshipType: "{DeliveryMethodStandardLib.createDisabledDeliveryMethodRateTableGraphRelationshipType()}", // "disabled_deliveryMethodRateTable"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
{
relationshipType: "{DeliveryMethodStandardLib.createHasDeliveryMethodRateTableGraphRelationshipType()}", // "owns_deliveryMethodRateTable"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
- controls ownership of a rateTable, many deliveryMethods can point to one rateTable but only one deliveryMethod controls it (RBAC for that deliveryMethods allows control over the rateTable)
{
relationshipType: "has_{DeliveryMethodStandardLib.DELIVERYMETHOD_GRAPH_NODE_LABEL}Property",
}
{
relationshipType: "disabled_{DeliveryMethodStandardLib.DELIVERYMETHOD_GRAPH_NODE_LABEL}Property",
}
{
relationshipType: "is_{DeliveryMethodStandardLib.DELIVERYMETHOD_GRAPH_NODE_LABEL}PropertyLabel",
}
- see DataSchemaLib
Basic node schemas
{
nodeLabel: "{DeliveryMethodStandardLib.DELIVERYMETHOD_GRAPH_NODE_LABEL}"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
deliveryMethodId: {
identifier: true,
},
},
}
}
Schema comes from BasicNodeSchemaLib
- deliveryMethodPropertyLabel
- deliveryMethodProperty
Data structure notes
- Users can create new deliveryMethods which are uniquely identified by their translation
- deliveryMethods have RBAC structure, default to creator having admin permissions, but admin can add other roles etc..
- Any user can attach any deliveryMethod to a SellOfferPlan