Service - Cart: Difference between revisions
(Created page with "= Overview = Manages a shopping cart of sell offers prior to confirming as order/s. = Repository = https://bitbucket.org/izara-market-orders/izara-market-orders-cart = Dyn...") |
No edit summary |
||
Line 23: | Line 23: | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
configTag: " | configTag: "DeliveryMethodManagerServiceName" | ||
configKey: " | configKey: "DeliveryMethodManagerServiceName" | ||
configValue: xxx // eg: "DeliveryMethodManager" | configValue: xxx // eg: "DeliveryMethodManager" | ||
} | } | ||
Line 31: | Line 31: | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
configTag: " | configTag: "PaymentMethodManagerServiceName" | ||
configKey: " | configKey: "PaymentMethodManagerServiceName" | ||
configValue: xxx // eg: " | configValue: xxx // eg: "PaymentMethodManager" | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 39: | Line 39: | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
configTag: " | configTag: "SellOfferPlanServiceName" | ||
configKey: " | configKey: "SellOfferPlanServiceName" | ||
configValue: xxx // eg: " | configValue: xxx // eg: "SellOfferPlan" | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 55: | Line 55: | ||
= Graph database = | = Graph database = | ||
== [[Service - Orders Graph]]== | == [[Service - Orders Graph]] == | ||
=== Nodes === | === Nodes === | ||
Line 70: | Line 70: | ||
identifier: true, // create unique id from request params and uniqueMessageId | identifier: true, // create unique id from request params and uniqueMessageId | ||
}, | }, | ||
totalQuantity: {}, | |||
totalValue: {}, // will be in the currency of the paymentMethod selected (when changes need to re-calculate) | |||
}, | }, | ||
} | } | ||
Line 77: | Line 79: | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
nodeLabel: "{ | nodeLabel: "{CartPlanLib.CART_SELLOFFERLINK_GRAPH_NODE_LABEL}", // "cartSellOfferLink" | ||
schema: { | schema: { | ||
identifier: true, | identifier: true, | ||
Line 83: | Line 85: | ||
restrictRelationships: true, | restrictRelationships: true, | ||
properties: { | properties: { | ||
cartSellOfferLinkId: { | |||
identifier: true, // create unique id from request params and uniqueMessageId | identifier: true, // create unique id from request params and uniqueMessageId | ||
}, | }, |
Revision as of 13:56, 27 October 2021
Overview
Manages a shopping cart of sell offers prior to confirming as order/s.
Repository
https://bitbucket.org/izara-market-orders/izara-market-orders-cart
DynamoDB tables
Standard Config Table Per Service
Configuration tags
{
configTag: "SellOfferManagerServiceName"
configKey: "SellOfferManagerServiceName"
configValue: xxx // eg: "SellOfferManager"
}
{
configTag: "DeliveryMethodManagerServiceName"
configKey: "DeliveryMethodManagerServiceName"
configValue: xxx // eg: "DeliveryMethodManager"
}
{
configTag: "PaymentMethodManagerServiceName"
configKey: "PaymentMethodManagerServiceName"
configValue: xxx // eg: "PaymentMethodManager"
}
{
configTag: "SellOfferPlanServiceName"
configKey: "SellOfferPlanServiceName"
configValue: xxx // eg: "SellOfferPlan"
}
{
configTag: "OrderGraphServiceName"
configKey: "OrderGraphServiceName"
configValue: xxx // eg: "OrderGraph"
}
Graph database
Service - Orders Graph
Nodes
{
nodeLabel: "{CartPlanLib.CART_GRAPH_NODE_LABEL}", // "cart"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
cartId: {
identifier: true, // create unique id from request params and uniqueMessageId
},
totalQuantity: {},
totalValue: {}, // will be in the currency of the paymentMethod selected (when changes need to re-calculate)
},
}
}
{
nodeLabel: "{CartPlanLib.CART_SELLOFFERLINK_GRAPH_NODE_LABEL}", // "cartSellOfferLink"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
cartSellOfferLinkId: {
identifier: true, // create unique id from request params and uniqueMessageId
},
},
}
}
{
nodeLabel: "{SellOfferPlanLib.SELLOFFERPLAN_PAYMENTMETHODLINK_GRAPH_NODE_LABEL}", // "sellOfferPlanPaymentMethodLink"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
sellOfferPlanPaymentMethodLinkId: {
identifier: true, // create unique id from request params and uniqueMessageId
},
},
}
}
Versioned data
sellOfferPlanDeliveryMethodLinkSettings
{ properties: { oneTimeAmountSetting: {}, // "value"|"rate", do we add one time cost to the value before calculating, or is it a straight rate added after calculating oneTimeAmount: {}, // value of the one time amount oneTimeAmountAccumulate: {}, // boolean true|false, if TRUE for combined orders then add oneTimeAmount for each included Sell Offer, if FALSE only gets added once valueType: "xx", // quantity|productValue|productAttribute|sellOfferTerm, if set overwrites deliveryMethod defaultValueType valueId: "xx", // if set overwrites deliveryMethod defaultValueId }, }
sellOfferPlanPaymentMethodLinkSettings
{ properties: { oneTimeAmountSetting: {}, // "cost"|"percentage", do we add a one time cost, or add a % to the order total oneTimeAmount: {}, // value of the one time amount }, }
sellOfferPlanSettings
{ properties: { combineWins: {}, // true|false }, }
Relationships
{
relationshipType: "{SellOfferPlanLib.createOwnsSellOfferPlanGraphRelationshipType()}", // "owns_sellOfferPlan"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
- links a sell offer to a sell offer plan
- a sell offer has only one sell offer plan
{
relationshipType: "{SellOfferPlanLib.createHasSellOfferPlanGraphRelationshipType()}", // "has_sellOfferPlan"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
- links a user to one of their sell offer plans
{
relationshipType: "{SellOfferPlanLib.createHasDeliveryMethodLinkGraphRelationshipType()}", // "has_deliveryMethodLink"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
{
relationshipType: "{SellOfferPlanLib.createDisabledDeliveryMethodLinkGraphRelationshipType()}", // "disabled_deliveryMethodLink"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
{
relationshipType: "{SellOfferPlanLib.createHasPaymentMethodLinkGraphRelationshipType()}", // "has_paymentMethodLink"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
{
relationshipType: "{SellOfferPlanLib.createDisabledPaymentMethodLinkGraphRelationshipType()}", // "disabled_paymentMethodLink"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
{
relationshipType: "{SellOfferPlanLib.createIsDeliveryMethodGraphRelationshipType()}", // "is_deliveryMethod"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
{
relationshipType: "{SellOfferPlanLib.createIsPaymentMethodGraphRelationshipType()}", // "is_paymentMethod"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}