Service - Sell Offer Plan
Overview
A user's plan that connects a user's sell offer to any number of payment methods and delivery methods, including optional adjustments to the values of those methods.
Repository
https://bitbucket.org/izara-market-products/izara-market-products-sell-offer-plan
DynamoDB tables
Standard Config Table Per Service
Configuration tags
{
configTag: "DeliveryMethodManagerServiceName"
configKey: "DeliveryMethodManagerServiceName"
configValue: xxx // eg: "DeliveryMethodManager"
}
{
configTag: "PaymentMethodManagerServiceName"
configKey: "PaymentMethodManagerServiceName"
configValue: xxx // eg: "PaymentMethodManager"
}
{
configTag: "ProductGraphServiceName"
configKey: "ProductGraphServiceName"
configValue: xxx // eg: "ProductGraph"
}
Graph database
Service - Products Graph
Nodes
{
nodeLabel: "{SellOfferPlanLib.SELLOFFERPLAN_GRAPH_NODE_LABEL}", // "sellOfferPlan"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
SellOfferPlanId: {
identifier: true, // create unique id from request params and uniqueMessageId
},
currencyId: {
immutable: true, // all added deliveryMethods must match
},
},
}
}
{
nodeLabel: "{SellOfferPlanLib.SELLOFFERPLAN_DELIVERYMETHODLINK_GRAPH_NODE_LABEL}", // "sellOfferPlanDeliveryMethodLink"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
sellOfferPlanDeliveryMethodLinkId: {
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.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
},
}
}
- many sell offer plans can link to one delivery method link, or one payment method link, this allows user to share settings in the link nodes across multiple sell offer plans
{
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
},
}
}