Service - Sell Offer Standard: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 150: Line 150:
</syntaxhighlight>
</syntaxhighlight>
* [[Service - Orders Graph]]
* [[Service - Orders Graph]]
= Complex Filter requests =
<syntaxhighlight lang="JavaScript">
{
filterType: "sellOffer" //unique id is sellOfferId
type: "group",
elements:
[
// ...
{
type: "complexFilter",
complexFilter: {
filterType: "sellOfferPlan",
// see [[Service - Sell Offer Plan|Complex Filter requests]]
}
},
{
type: "complexFilter",
complexFilter: {
filterType: "sellOfferTermLink",
// see [[Service - Sell Offer Terms|Complex Filter requests]]
}
},
...
]
}
</syntaxhighlight>


= SellOffer currency =
= SellOffer currency =

Revision as of 13:08, 7 November 2021

Overview

Handler service for the standard sell offer type.

Repository

https://bitbucket.org/izara-market-products/izara-market-products-sell-offer-standard/src/master/

DynamoDB tables

Standard Config Table Per Service

Configuration tags

{
	configTag: "SellOfferHandlerServiceNameTag"
	configKey: "SellOfferHandlerServiceNameTag"
	configValue: xxx // this own services ServiceNameTag, eg "SellOfferStandard"
}
{
	configTag: "ProductGraphServiceName"
	configKey: "ProductGraphServiceName"
	configValue: xxx // eg: "ProductGraph"
}
{
	configTag: "SellOfferManagerServiceName"
	configKey: "SellOfferManagerServiceName"
	configValue: xxx // eg: "SellOfferManager"
}

LogicalResults

Stores results for any requests to perform logical searches on sell offer data

{
	resultId: xxx // eg: filterMainId for a single logical element
	dataId: xxx // one sellofferId
}
  • partition key: resultId
  • sort key: dataId

Graph database

Service - Products Graph

Nodes

{
	nodeLabel: "{SellOfferStandardLib.SELL_OFFER_GRAPH_NODE_LABEL}",
	schema: {
		identifier: true,
		restrictProperties: true,
		restrictRelationships: true,
		properties: {
			sellOfferId: {
				identifier: true, //(random uuid)
			},
			productId: {
				immutable: true,
			},
			sellOfferHandlerServiceNameTag: {
				immutable: true,
			},
			currencyId: {
				immutable: true, // matches the sellOfferPlan's currencyId
			},
		},
	}
}

Relationships

{
	relationshipType: "{SellOfferStandardLib.createHasSellOfferGraphRelationshipType()}", //"has_sellOffer"
	schema: {
		elementCanBeRemoved: true,
		allPropertiesImmutable: true,
		restrictProperties: true,
		properties: {
			originTimestamp: //timestamp the request to create/change this relationship was sent
		},
	}
}
{
	relationshipType: "{SellOfferStandardLib.createDisabledSellOfferGraphRelationshipType()}", //"disabled_sellOffer"
	schema: {
		elementCanBeRemoved: true,
		allPropertiesImmutable: true,
		restrictProperties: true,
		properties: {
			originTimestamp: //timestamp the request to create/change this relationship was sent
		},
	}
}
  • SellOffer relationship links the sell offer with it's parent product, the sell offer can be enabled (hasSellOffer) or disabled (disabledSellOffer)
  • when enabling/disabling we remove the old relationship and replace it with the new setting
{
	relationshipType: "{SellOfferPlanLib.createUsesSellOfferPlanGraphRelationshipType()}", // "uses_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

Basic node schemas

{
	nodeLabel: "{SellOfferStandardLib.SELL_OFFER_GRAPH_NODE_LABEL}",
	schema: {
		identifier: true,
		restrictProperties: true,
		restrictRelationships: true,
		properties: {
			sellOfferId: {
				identifier: true,
			},
			sellOfferHandlerServiceNameTag: {
				immutable: true,
			},
		},
	}
}

Complex Filter requests

{
	filterType: "sellOffer" //unique id is sellOfferId
	type: "group",
	elements:
	[
		// ...
		{
			type: "complexFilter",
			complexFilter: {
				filterType: "sellOfferPlan",
				// see [[Service - Sell Offer Plan|Complex Filter requests]]
			}
		},		
		{
			type: "complexFilter",
			complexFilter: {
				filterType: "sellOfferTermLink",
				// see [[Service - Sell Offer Terms|Complex Filter requests]]
			}
		},		
		...
	]
}

SellOffer currency

  • When creating a sellOffer it's currency will be set to the same as the sellOfferPlan chosen
  • All deliveryMethods added to the sellOfferPlan must be the same currency as the sellOfferPlan, so total price can be calculated accurately
  • paymentMethod does not need to match the sellOfferPlan currency, seller can have sellOfferTerms to explain currency conversion when making payment

Working documents

Sell Offer Standard