Service - Cart: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 72: Line 72:
totalQuantity: {},
totalQuantity: {},
totalValue: {}, // will be in the currency of the paymentMethod selected (when changes need to re-calculate)
totalValue: {}, // will be in the currency of the paymentMethod selected (when changes need to re-calculate)
name: {},
},
},
}
}
Line 88: Line 89:
identifier: true, // create unique id from request params and uniqueMessageId
identifier: true, // create unique id from request params and uniqueMessageId
},
},
quantity: {},
valid: {}, // true|false depending on last validation check
},
},
}
}
}
}
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang="JavaScript">
{
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
},
},
}
}
</syntaxhighlight>
=== 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 ===
=== Relationships ===
Line 145: Line 100:
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "{SellOfferPlanLib.createOwnsSellOfferPlanGraphRelationshipType()}", // "owns_sellOfferPlan"
relationshipType: "{CartPlanLib.createHasActiveCartGraphRelationshipType()}", // "hasActive_cart"
schema: {
schema: {
elementCanBeRemoved: true,
elementCanBeRemoved: true,
Line 156: Line 111:
}
}
</syntaxhighlight>
</syntaxhighlight>
* links a sell offer to a sell offer plan
* a sell offer has only one sell offer plan
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "{SellOfferPlanLib.createHasSellOfferPlanGraphRelationshipType()}", // "has_sellOfferPlan"
relationshipType: "{CartPlanLib.createHasCompletedCartGraphRelationshipType()}", // "hasCompleted_cart"
schema: {
schema: {
elementCanBeRemoved: true,
elementCanBeRemoved: true,
Line 172: Line 124:
}
}
</syntaxhighlight>
</syntaxhighlight>
* links a user to one of their sell offer plans
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "{SellOfferPlanLib.createHasDeliveryMethodLinkGraphRelationshipType()}", // "has_deliveryMethodLink"
relationshipType: "{CartPlanLib.createHasDeletedCartGraphRelationshipType()}", // "hasDeleted_cart"
schema: {
schema: {
elementCanBeRemoved: true,
elementCanBeRemoved: true,
Line 187: Line 137:
}
}
</syntaxhighlight>
</syntaxhighlight>
* links a user to a cart
* a cart can either be active, completed, or deleted
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "{SellOfferPlanLib.createDisabledDeliveryMethodLinkGraphRelationshipType()}", // "disabled_deliveryMethodLink"
relationshipType: "{CartPlanLib.cartPaymentMethodGraphRelationshipType()}", // "cart_paymentMethod"
schema: {
schema: {
elementCanBeRemoved: true,
elementCanBeRemoved: true,
Line 200: Line 153:
}
}
</syntaxhighlight>
</syntaxhighlight>
* links a cart to it's current paymentMethod setting


<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "{SellOfferPlanLib.createHasPaymentMethodLinkGraphRelationshipType()}", // "has_paymentMethodLink"
relationshipType: "{CartPlanLib.cartDeliveryMethodGraphRelationshipType()}", // "cart_deliveryMethod"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
</syntaxhighlight>
<syntaxhighlight lang="JavaScript">
{
relationshipType: "{SellOfferPlanLib.createDisabledPaymentMethodLinkGraphRelationshipType()}", // "disabled_paymentMethodLink"
schema: {
schema: {
elementCanBeRemoved: true,
elementCanBeRemoved: true,
Line 227: Line 168:
}
}
</syntaxhighlight>
</syntaxhighlight>
* links a cart to it's current deliveryMethod setting


<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "{SellOfferPlanLib.createIsDeliveryMethodGraphRelationshipType()}", // "is_deliveryMethod"
relationshipType: "{CartPlanLib.createHasCartSellOfferLinkGraphRelationshipType()}", // "has_cartSellOfferLink"
schema: {
schema: {
elementCanBeRemoved: true,
elementCanBeRemoved: true,
Line 241: Line 183:
}
}
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "{SellOfferPlanLib.createIsPaymentMethodGraphRelationshipType()}", // "is_paymentMethod"
relationshipType: "{CartPlanLib.createCartSellOfferLinkIsSellOfferGraphRelationshipType()}", // "cartSellOfferLinkIs_sellOffer"
schema: {
schema: {
elementCanBeRemoved: true,
elementCanBeRemoved: true,
Line 258: Line 199:
= Working documents =
= Working documents =


[[:Category:Working_documents - Sell Offer Plan|Sell Offer Plan]]
[[:Category:Working_documents - Cart|Cart]]


[[Category:Backend services| Sell Offer Plan]]
[[Category:Backend services| Cart]]

Revision as of 15:13, 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)
			name: {},
		},
	}
}
{
	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
		},
	}
}

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
		},
	}
}

Working documents

Cart