Service - Delivery Method Standard: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(→Nodes) |
||
Line 75: | Line 75: | ||
currencyId: { | currencyId: { | ||
immutable: true, // cannot change after creating | immutable: true, // cannot change after creating | ||
} | } | ||
}, | }, | ||
} | } |
Revision as of 14:01, 25 November 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"
}
{
configTag: "DeliveryMethodRbacServiceName"
configKey: "DeliveryMethodRbacServiceName"
configValue: xxx // eg: "Rbac"
}
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,
},
currencyId: {
immutable: true, // cannot change after creating
}
},
}
}
{
nodeLabel: "{DeliveryMethodStandardLib.DELIVERYMETHOD_GRAPH_NODE_LABEL}PropertyLabel",
}
{
nodeLabel: "{DeliveryMethodStandardLib.DELIVERYMETHOD_GRAPH_NODE_LABEL}Property",
}
- see DataSchemaLib
Versioned data
deliveryMethodSettings
{
properties: {
defaultValueType: {}, // orderQuantity|orderValue|productAttributeId|sellOfferTermId
defaultValueId: {}, // used for productAttributeId|sellOfferTermId
defaultAccumulateValue: true // default: true, if set to false will find the largest value out of all sellOffers in the order
},
}
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
},
}
}
- currently this is set when creating the deliveryMethod and cannot be changed, if in future we allow to be changed, will need to validate all sellOffers that link to this deliveryMethod and ensure sellOffer's stock location still slots into the deliveryMethods new from_LocationNode
{
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,
},
deliveryMethodHandlerServiceNameTag: {
immutable: true,
},
},
}
}
Schema comes from BasicNodeSchemaLib
- deliveryMethodPropertyLabel
- deliveryMethodProperty
Complex Filter requests
{
filterType: "deliveryMethod" //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: "deliveryMethodRateTable",
// see [[Service - Delivery Method Rate Table|Complex Filter requests]]
}
},
{
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
},
]
}
},
...
]
}
Translate Ids - deliveryMethodRateTable to deliveryMethod
- only find deliveryMethodIds that are enabled
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