Service - Sell Offer Terms: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(12 intermediate revisions by the same user not shown)
Line 37: Line 37:
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "sellOfferTermLabel",
nodeLabel: "{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Label", // sellOfferTermLabel
schema: {
}
identifier: true,
{
restrictProperties: true,
nodeLabel: "{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}", // sellOfferTerm
restrictRelationships: true,
properties: {
sellOfferTermId: {
identifier: true, //(random uuid)
},
},
}
}
}
</syntaxhighlight>
* groups sell offer terms, eg: "Accept returns?", "Time allowed to complete payment", etc..
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "sellOfferTerm",
nodeLabel: "{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Link", // sellOfferTermLink
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
sellOfferTermId: {
identifier: true, //(random uuid)
},
},
}
}
}
</syntaxhighlight>
* one sell offer term value inside one sell offer term label, eg: "yes" under the "Accept returns?" label
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "sellOfferTermLink",
nodeLabel: "{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}PropertyLabel", // sellOfferTermPropertyLabel
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
sellOfferTermLinkId: {
identifier: true, //(random uuid)
},
sellOfferId: {
immutable: true,
},
sellOfferTermId: {
immutable: true,
},
},
}
}
}
</syntaxhighlight>
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "sellOfferTermProperty",
nodeLabel: "{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Property", // sellOfferTermProperty
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
propertyId: {
identifier: true, //(random uuid)
},
sellOfferTermId: {
immutable: true,
},
},
}
}
}
</syntaxhighlight>
</syntaxhighlight>
* see [[NPM module - Izara Core - Attribute Tree|DataSchemaLib]]


=== Relationships ===
=== Relationships ===
Line 114: Line 58:
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "hasSellOfferTermLink",
relationshipType: "has_{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Link", // has_sellOfferTermLink
schema: {
}
elementCanBeRemoved: true,
{
allPropertiesImmutable: true,
relationshipType: "disabled_{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Link", // disabled_sellOfferTermLink
restrictProperties: true,
}
properties: {
{
originTimestamp: //timestamp the request to create/change this relationship was sent
relationshipType: "is_{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Term", // is_sellOfferTermLink
},
}
}
}
</syntaxhighlight>
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "disabledSellOfferTermLink",
relationshipType: "is_{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Label", // is_sellOfferTermLabel
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
}
</syntaxhighlight>
* creates a link in attribute tree between a SellOffer or SellOfferTermLink, and a child SellOfferTermLink
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "isSellOfferTerm",
relationshipType: "has_{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Property", // has_sellOfferTermProperty
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
}
</syntaxhighlight>
* links one SellOfferTermLink to one SellOfferTerm
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "isSellOfferTermLabel",
relationshipType: "disabled_{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Property", // disabled_sellOfferTermProperty
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
}
</syntaxhighlight>
* links one SellOfferTerm to one SellOfferTermLabel
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "hasSellOfferTermProperty",
relationshipType: "is_{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}PropertyLabel", // is_sellOfferTermPropertyLabel
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
}
</syntaxhighlight>
</syntaxhighlight>
* SellOfferTerm links to it's Properties
* see [[NPM module - Izara Core - Attribute Tree|DataSchemaLib]]


== [[Service - Translations Graph]]==
== Basic node schemas ==


=== Nodes ===
Schema comes from [[NPM module - Izara Core - Attribute Tree|BasicNodeSchemaLib]]


<syntaxhighlight lang="JavaScript">
# {SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Label // sellOfferTermLabel
{
#* [[Service - Translations Graph]]
nodeLabel: "sellOfferTermLabel",
# {SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL} // sellOfferTerm
schema: {
#* [[Service - Translations Graph]]
identifier: true,
# {SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}PropertyLabel // sellOfferTermPropertyLabel
restrictProperties: true,
#* [[Service - Translations Graph]]
restrictRelationships: true,
# {SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Property // sellOfferTermProperty
properties: {
#* [[Service - Translations Graph]]
sellOfferTermId: {
identifier: true,
},
},
}
}
</syntaxhighlight>


<syntaxhighlight lang="JavaScript">
= Complex Filter requests =
{
nodeLabel: "sellOfferTermValue",
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
sellOfferTermId: {
identifier: true,
},
},
}
}
</syntaxhighlight>


<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "sellOfferTermPropertyName",
filterType: "sellOfferTermLink" //unique id is sellOfferTermLinkId
schema: {
type: "group",
identifier: true,
elements:
restrictProperties: true,
[
restrictRelationships: true,
{
properties: {
// find all sellOfferTermLinks that link to a specific sellOfferTermId
propertyId: {
type: "logical",
identifier: true,
logicalTag: "sellOfferTermId",
comparison: "equals",
value: "lksdflkfldfgldfkgjldfg"
},
},
{
type: "complexFilter",
complexFilter: {
filterType: "sellOfferTerm",  //unique id is sellOfferTermId
type: "group",
elements:
[
{
type: "complexFilter",
complexFilter: {
filterType: "sellOfferTermProperty",  //unique id is propertyId
type: "group",
elements:
[
{
// find all propertyIds that link to a specific propertyLabelId
type: "logical",
logicalTag: "propertyLabelId",
comparison: "equals",
value: "lksdflkfldfgldfkgjldfg"
},
]
}
},
{
type: "complexFilter",
complexFilter: {
filterType: "sellOfferTermPropertyTranslation" //unique id is propertyId
type: "group",
elements:
[
{
// find all propertyIds that have current translation that matches text
type: "logical",
logicalTag: "textTag_languageId_text",
resultType: "sellOfferTermProperty",
textTag: "sellOfferTermPropertyValue",
languageId: "en",
text: "Is a great term",
subjectIdentifierPropertyName: "propertyId",
caseSensitive: true
},
]
}
},
]
}
},
},
}
{
}
type: "complexFilter",
</syntaxhighlight>
complexFilter: {
 
filterType: "sellOfferTermTranslation" //unique id is sellOfferTermId
<syntaxhighlight lang="JavaScript">
type: "group",
{
elements:
nodeLabel: "sellOfferTermPropertyValue",
[
schema: {
{
identifier: true,
// find all sellOfferTermIds that have current translation that matches text
restrictProperties: true,
type: "logical",
restrictRelationships: true,
logicalTag: "textTag_languageId_text",
properties: {
resultType: "sellOfferTerm",
propertyId: {
textTag: "sellOfferTermValue",
identifier: true,
languageId: "en",
},
text: "Accepts",
subjectIdentifierPropertyName: "sellOfferTermId", // finds an identifier property on the subjects node and stores in LogicalResults for the request
caseSensitive: true
},
]
}
},
},
}
...
]
}
}
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 12:27, 7 November 2021

Overview

Manages SellOffer Terms and SellOfferTermLinks. SellOffer Terms can be shared by many Sell Offers, SellOfferTermLinks are used to create an attribute tree for one Sell Offer.

Repository

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

DynamoDB tables

Standard Config Table Per Service

Configuration tags

..

LogicalResults

Stores results for any requests to perform logical searches on media links

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

Graph database

Service - Products Graph

Nodes

{
	nodeLabel: "{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Label", // sellOfferTermLabel
}
{
	nodeLabel: "{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}", // sellOfferTerm
}
{
	nodeLabel: "{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Link", // sellOfferTermLink
}
{
	nodeLabel: "{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}PropertyLabel", // sellOfferTermPropertyLabel
}
{
	nodeLabel: "{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Property", // sellOfferTermProperty
}

Relationships

{
	relationshipType: "has_{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Link", // has_sellOfferTermLink
}
{
	relationshipType: "disabled_{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Link", // disabled_sellOfferTermLink
}
{
	relationshipType: "is_{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Term", // is_sellOfferTermLink
}
{
	relationshipType: "is_{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Label", // is_sellOfferTermLabel
}
{
	relationshipType: "has_{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Property", // has_sellOfferTermProperty
}
{
	relationshipType: "disabled_{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Property", // disabled_sellOfferTermProperty
}
{
	relationshipType: "is_{SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}PropertyLabel", // is_sellOfferTermPropertyLabel
}

Basic node schemas

Schema comes from BasicNodeSchemaLib

  1. {SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Label // sellOfferTermLabel
  2. {SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL} // sellOfferTerm
  3. {SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}PropertyLabel // sellOfferTermPropertyLabel
  4. {SellOfferTermsLib.SELL_OFFER_TERM_GRAPH_NODE_LABEL}Property // sellOfferTermProperty

Complex Filter requests

{
	filterType: "sellOfferTermLink" //unique id is sellOfferTermLinkId
	type: "group",
	elements:
	[
			{
				// find all sellOfferTermLinks that link to a specific sellOfferTermId
				type: "logical",
				logicalTag: "sellOfferTermId",
				comparison: "equals",
				value: "lksdflkfldfgldfkgjldfg"
			},
			{
				type: "complexFilter",
				complexFilter: {
				filterType: "sellOfferTerm",  //unique id is sellOfferTermId
				type: "group",
				elements: 
				[
					{
						type: "complexFilter",
						complexFilter: {
							filterType: "sellOfferTermProperty",  //unique id is propertyId
							type: "group",
							elements: 
							[
								{
									// find all propertyIds that link to a specific propertyLabelId
									type: "logical",
									logicalTag: "propertyLabelId",
									comparison: "equals",
									value: "lksdflkfldfgldfkgjldfg"
								},
							]
						}
					},
					{
						type: "complexFilter",
						complexFilter: {
							filterType: "sellOfferTermPropertyTranslation" //unique id is propertyId
							type: "group",
							elements: 
							[
								{
									// find all propertyIds that have current translation that matches text
									type: "logical",
									logicalTag: "textTag_languageId_text",
									resultType: "sellOfferTermProperty",
									textTag: "sellOfferTermPropertyValue",
									languageId: "en",
									text: "Is a great term",
									subjectIdentifierPropertyName: "propertyId",
									caseSensitive: true
								},
							]
						}
					},
				]
			}
		},
		{
			type: "complexFilter",
			complexFilter: {
				filterType: "sellOfferTermTranslation" //unique id is sellOfferTermId
				type: "group",
				elements: 
				[
					{
						// find all sellOfferTermIds that have current translation that matches text
						type: "logical",
						logicalTag: "textTag_languageId_text",
						resultType: "sellOfferTerm",
						textTag: "sellOfferTermValue",
						languageId: "en",
						text: "Accepts",
						subjectIdentifierPropertyName: "sellOfferTermId", // finds an identifier property on the subjects node and stores in LogicalResults for the request
						caseSensitive: true
					},
				]
			}
		},
		...
		
	]
}

Working documents

Sell Offer Terms