Service - Sell Offer Price: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
(Created page with "= Overview = Standard pricing config that can be shared by many sellOffers. Can create other pricing services in the future, each SellOffer Handler service chooses which pric...")
 
No edit summary
Line 26: Line 26:


=== Nodes ===
=== Nodes ===
.... continue here


<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "{SellOfferPlanLib.SELLOFFERPLAN_GRAPH_NODE_LABEL}", // "sellOfferPlan"
nodeLabel: "{SellOfferPriceLib.SELLOFFERPRICE_GRAPH_NODE_LABEL}", // "sellOfferPrice"
schema: {
schema: {
identifier: true,
identifier: true,
Line 38: Line 35:
restrictRelationships: true,
restrictRelationships: true,
properties: {
properties: {
sellOfferPlanId: {
sellOfferPriceId: {
identifier: true, // create unique id from request params and uniqueMessageId
identifier: true, // create unique id from request params and uniqueMessageId
},
},
userId: {
userId: {
immutable: true, // a sellOfferPlan can only be used by one user (because links to their userPaymentMethods)
immutable: true, // a sellOfferPlan can only be used by one user (because links to their userPaymentMethods)
},
currencyId: {
immutable: true, // all added deliveryMethods must match
},
},
}
}
</syntaxhighlight>
<syntaxhighlight lang="JavaScript">
{
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
},
},
}
}
</syntaxhighlight>
<syntaxhighlight lang="JavaScript">
{
nodeLabel: "{SellOfferPlanLib.SELLOFFERPLAN_USERPAYMENTMETHODLINK_GRAPH_NODE_LABEL}", // "sellOfferPlanUserPaymentMethodLink"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
sellOfferPlanUserPaymentMethodLinkId: {
identifier: true, // create unique id from request params and uniqueMessageId
},
},
},
},

Revision as of 14:05, 22 November 2021

Overview

Standard pricing config that can be shared by many sellOffers. Can create other pricing services in the future, each SellOffer Handler service chooses which pricing service it uses (or many if it wants).

Repository

https://bitbucket.org/izara-market-products/izara-market-products-sell-offer-plan

DynamoDB tables

Standard Config Table Per Service

Configuration tags

{
	configTag: "ProductGraphServiceName"
	configKey: "ProductGraphServiceName"
	configValue: xxx // eg: "ProductGraph"
}

Graph database

Service - Products Graph

Nodes

{
	nodeLabel: "{SellOfferPriceLib.SELLOFFERPRICE_GRAPH_NODE_LABEL}", // "sellOfferPrice"
	schema: {
		identifier: true,
		restrictProperties: true,
		restrictRelationships: true,
		properties: {
			sellOfferPriceId: {
				identifier: true, // create unique id from request params and uniqueMessageId
			},
			userId: {
				immutable: true, // a sellOfferPlan can only be used by one user (because links to their userPaymentMethods)
			},
		},
	}
}

Versioned data

sellOfferPriceSettings

{
	properties: {
		minimumQuantity: xx,
		prices: {
			sellOfferQuantity: [ // sellOfferQuantity type price settings, ordered low to high
				{
					upToValue: "xx.xx",
					price: "xx.xx",
				},
				// ...
			],
			orderQuantity: [ // orderQuantity type price settings, ordered low to high
				{
					upToValue: "xx.xx",
					price: "xx.xx",
				},
				// ...
			]				
			orderValue: [ // orderValue type price settings, ordered low to high
				{
					upToValue: "xx.xx",
					price: "xx.xx",
				},
				// ...
			]					
		},

	},
}


Working documents

Sell Offer Price