Service - Cart: Difference between revisions
Jump to navigation
Jump to search
(→Nodes) |
No edit summary |
||
Line 93: | Line 93: | ||
quantity: {}, | quantity: {}, | ||
valid: {}, // true|false depending on last validation check | valid: {}, // true|false depending on last validation check | ||
}, | |||
} | |||
} | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
nodeLabel: "{CartPlanLib.CARTORDER_GRAPH_NODE_LABEL}", // "cartOrder" | |||
schema: { | |||
identifier: true, | |||
restrictProperties: true, | |||
restrictRelationships: true, | |||
properties: { | |||
cartOrderId: { | |||
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 199: | Line 217: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* Links cartSellOfferLink to one sellOffer | * Links cartSellOfferLink to one sellOffer | ||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
relationshipType: "{CartPlanLib.createCarthasCartOrderGraphRelationshipType()}", // "has_cartOrder" | |||
schema: { | |||
elementCanBeRemoved: true, | |||
allPropertiesImmutable: true, | |||
restrictProperties: true, | |||
properties: { | |||
originTimestamp: //timestamp the request to create/change this relationship was sent | |||
}, | |||
} | |||
} | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
relationshipType: "{CartPlanLib.createCartOrderHasCartSellOfferLinkGraphRelationshipType()}", // "cartOrderHas_cartSellOfferLink" | |||
schema: { | |||
elementCanBeRemoved: true, | |||
allPropertiesImmutable: true, | |||
restrictProperties: true, | |||
properties: { | |||
originTimestamp: //timestamp the request to create/change this relationship was sent | |||
}, | |||
} | |||
} | |||
</syntaxhighlight> | |||
= Working documents = | = Working documents = |
Revision as of 11:25, 31 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)
name: {},
status: {}, // validating|valid|invalid
dateValidated: {}, // date last time validated
},
}
}
{
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
},
quantity: {},
valid: {}, // true|false depending on last validation check
},
}
}
{
nodeLabel: "{CartPlanLib.CARTORDER_GRAPH_NODE_LABEL}", // "cartOrder"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
cartOrderId: {
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)
},
}
}
Relationships
{
relationshipType: "{CartPlanLib.createHasActiveCartGraphRelationshipType()}", // "hasActive_cart"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
{
relationshipType: "{CartPlanLib.createHasCompletedCartGraphRelationshipType()}", // "hasCompleted_cart"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
{
relationshipType: "{CartPlanLib.createHasDeletedCartGraphRelationshipType()}", // "hasDeleted_cart"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
- links a user to a cart
- a cart can either be active, completed, or deleted
{
relationshipType: "{CartPlanLib.cartPaymentMethodGraphRelationshipType()}", // "cart_paymentMethod"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
- links a cart to it's current paymentMethod setting
{
relationshipType: "{CartPlanLib.cartDeliveryMethodGraphRelationshipType()}", // "cart_deliveryMethod"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
- links a cart to it's current deliveryMethod setting
{
relationshipType: "{CartPlanLib.createHasCartSellOfferLinkGraphRelationshipType()}", // "has_cartSellOfferLink"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
{
relationshipType: "{CartPlanLib.createCartSellOfferLinkIsSellOfferGraphRelationshipType()}", // "cartSellOfferLinkIs_sellOffer"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
- Links cartSellOfferLink to one sellOffer
{
relationshipType: "{CartPlanLib.createCarthasCartOrderGraphRelationshipType()}", // "has_cartOrder"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
{
relationshipType: "{CartPlanLib.createCartOrderHasCartSellOfferLinkGraphRelationshipType()}", // "cartOrderHas_cartSellOfferLink"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}