Service - Sell Offer Price: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
No edit summary
 
Line 3: Line 3:
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).
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).


A user can point their sellOffer standard to any sellOfferPrice, even ones created by other users, but only the user who created the sellOfferPrice can change it.
A user can point their sellOffer standard to any sellOfferPricing, even ones created by other users, but only the user who created the sellOfferPrice can change it.


= Repository =
= Repository =
Line 9: Line 9:
https://bitbucket.org/izara-market-products/izara-market-products-sell-offer-price/
https://bitbucket.org/izara-market-products/izara-market-products-sell-offer-price/


= DynamoDB tables =
= Object Schemas =


== [[Standard Config Table Per Service]] ==
; Additional Information: [[Per Service Schemas]]


=== Configuration tags ===
== objType ==
 
=== sellOfferPricing ===
 
* Groups many sellOfferPrice together
* sellOfferPricing have only one priceType of ''sellOfferQuantity'' or ''orderQuantity'' or ''orderValue''


<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
configTag: "ProductGraphServiceName"
objectType: "sellOfferPricing",
configKey: "ProductGraphServiceName"
canDelete: false,
configValue: xxx // eg: "ProductGraph"
complexFilterServiceTag: "ComplexFilter",
    overWriteHandlers: { // optional, if not set will create default handlers, if empty will not create handler and main function
create: ['hdrApi', 'hdrSqs'], // default: ['hdrApi', 'hdrSqs']
update: ['hdrSqs'], // default: ['hdrApi', 'hdrSqs']
get: [], // default: ['hdrApi', 'hdrInv']
delete: [], // default: ['hdrApi', 'hdrSqs']
},
    storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "GraphHandler"
}
    },
    fieldNames: {
sellOfferPricingId: {
    type: "string",
randomOnCreate: true,
canUpdate: false,
validation: {
pattern: pattern
},
storageResourceTags: ['myGraph']
},
priceType: {
type: "string",
requiredOnCreate: true,
validation: {
pattern: pattern
},
storageResourceTags: ['myGraph']
},
minimumQuantity: {
type: "number",
requiredOnCreate: true,
validation: {
pattern: pattern
},
storageResourceTags: ['myGraph']
}
    },
    identifiers: [
{
type: "identifier",
fieldName: "sellOfferPricingId"
}
    ]
}
}
</syntaxhighlight>
</syntaxhighlight>


= Graph database =  
==== fieldNames ====


== [[Service - Products Graph]]==
; priceType
: ''sellOfferQuantity''|''orderQuantity''|''orderValue''


=== Nodes ===
=== sellOfferPrice ===


<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "{SellOfferPriceLib.SELLOFFERPRICE_GRAPH_NODE_LABEL}", // "sellOfferPrice"
objectType: "sellOfferPrice",
schema: {
canDelete: false,
identifier: true,
complexFilterServiceTag: "ComplexFilter",
restrictProperties: true,
    overWriteHandlers: { // optional, if not set will create default handlers, if empty will not create handler and main function
restrictRelationships: true,
create: ['hdrApi', 'hdrSqs'], // default: ['hdrApi', 'hdrSqs']
properties: {
update: [], // default: ['hdrApi', 'hdrSqs']
sellOfferPriceId: {
get: [], // default: ['hdrApi', 'hdrInv']
identifier: true, // create unique id from request params and uniqueMessageId
delete: [], // default: ['hdrApi', 'hdrSqs']
},
    storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "GraphHandler"
}
    },
    fieldNames: {
sellOfferPriceId: {
    type: "string",
randomOnCreate: true,
canUpdate: false,
validation: {
pattern: pattern
},
},
userId: {
storageResourceTags: ['myGraph']
immutable: true, // a sellOfferPlan can only be used by one user (because links to their userPaymentMethods)
},
uptoValue: {
type: "number",
requiredOnCreate: true,
validation: {
pattern: pattern
},
},
storageResourceTags: ['myGraph']
},
},
}
price: {
type: "number",
requiredOnCreate: true,
validation: {
pattern: pattern
},
storageResourceTags: ['myGraph']
}
    },
    identifiers: [
{
type: "identifier",
fieldName: "sellOfferPriceId"
}
    ]
}
}
</syntaxhighlight>
</syntaxhighlight>


=== Versioned data ===
== Object Relationships ==


==== sellOfferPriceSettings ====
=== hasSellOfferPricing ===
<syntaxhighlight lang="JavaScript">
{
"hasSellOfferPricing": {
fieldNames: {
"originTimestamp": {
    type: "number",            // "string" | "number" ...
requiredOnCreate: true,  // default = false
canUpdate: false,          // default = true
validation: {}            // ajv syntax
}
},
storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "graphHandler"
}
},
links: [
{
storageResourceTags: ["myGraph"],
from: {
objType: {
serviceTag: "SellOfferManager",
objectType: "sellOffer"
},
linkType: "many",
},
to: {
objType: {
serviceTag: "SellOfferPrice",
objectType: "sellOfferPricing"
},
linkType: "many",
handler: true
}
}
]
}
}
</syntaxhighlight>


=== disabledSellOfferPricing ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
properties: {
"disabledSellOfferPricing": {
minimumQuantity: xx,
fieldNames: {
prices: {
"originTimestamp": {
sellOfferQuantity: [ // sellOfferQuantity type price settings, ordered low to high
    type: "number",           // "string" | "number" ...
{
requiredOnCreate: true,  // default = false
upToValue: "xx.xx",
canUpdate: false,          // default = true
price: "xx.xx",
validation: {}            // ajv syntax
}
},
storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "graphHandler"
}
},
links: [
{
storageResourceTags: ["myGraph"],
from: {
objType: {
serviceTag: "SellOfferManager",
objectType: "sellOffer"
},
linkType: "many",
},
},
// ...
to: {
],
objType: {
orderQuantity: [ // orderQuantity type price settings, ordered low to high
serviceTag: "SellOfferPrice",
{
objectType: "sellOfferPricing"
upToValue: "xx.xx",
},
price: "xx.xx",
linkType: "many",
handler: true
}
}
]
}
}
</syntaxhighlight>
 
=== hasSellOfferPrice ===
<syntaxhighlight lang="JavaScript">
{
"hasSellOfferPrice": {
fieldNames: {
"originTimestamp": {
    type: "number",            // "string" | "number" ...
requiredOnCreate: true,  // default = false
canUpdate: false,          // default = true
validation: {}            // ajv syntax
}
},
storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "graphHandler"
}
},
links: [
{
storageResourceTags: ["myGraph"],
from: {
objType: {
serviceTag: "SellOfferPrice",
objectType: "sellOfferPricing"
},
linkType: "one",
handler: true
},
},
// ...
to: {
]
objType: {
orderValue: [ // orderValue type price settings, ordered low to high
serviceTag: "SellOfferPrice",
{
objectType: "sellOfferPrice"
upToValue: "xx.xx",
},
price: "xx.xx",
requiredOnCreate: true,
},
linkType: "many",
// ...
handler: true
]
}
},
}
 
]
},
}
}
}
</syntaxhighlight>
</syntaxhighlight>


=== Relationships ===
=== disabledSellOfferPrice ===
 
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "{SellOfferPriceLib.USES_SELLOFFERPRICE_GRAPH_REL_TYPE}", // "uses_sellOfferPrice"
"disabledSellOfferPrice": {
schema: {
fieldNames: {
elementCanBeRemoved: true,
"originTimestamp": {
allPropertiesImmutable: true,
    type: "number",           // "string" | "number" ...
restrictProperties: true,
requiredOnCreate: true,  // default = false
properties: {
canUpdate: false,          // default = true
originTimestamp: //timestamp the request to create/change this relationship was sent
validation: {}            // ajv syntax
}
},
storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "graphHandler"
}
},
},
links: [
{
storageResourceTags: ["myGraph"],
from: {
objType: {
serviceTag: "SellOfferPrice",
objectType: "sellOfferPricing"
},
linkType: "one",
handler: true
},
to: {
objType: {
serviceTag: "SellOfferPrice",
objectType: "sellOfferPrice"
},
linkType: "many",
handler: true
}
}
]
}
}
}
}
</syntaxhighlight>
</syntaxhighlight>
* links a sell offer to a sell offer price node


= Working documents =
= Working documents =

Latest revision as of 05:41, 19 November 2024

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).

A user can point their sellOffer standard to any sellOfferPricing, even ones created by other users, but only the user who created the sellOfferPrice can change it.

Repository

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

Object Schemas

Additional Information
Per Service Schemas

objType

sellOfferPricing

  • Groups many sellOfferPrice together
  • sellOfferPricing have only one priceType of sellOfferQuantity or orderQuantity or orderValue
{
	objectType: "sellOfferPricing",
	canDelete: false,
	complexFilterServiceTag: "ComplexFilter",
    overWriteHandlers: { // optional, if not set will create default handlers, if empty will not create handler and main function
		create: ['hdrApi', 'hdrSqs'], 	// default: ['hdrApi', 'hdrSqs']
		update: ['hdrSqs'], 			// default: ['hdrApi', 'hdrSqs']
		get: [], 						// default: ['hdrApi', 'hdrInv']
		delete: [], 					// default: ['hdrApi', 'hdrSqs']
	},	 
    storageResources: {
		myGraph: {
			storageType: "graph",
			graphServerTag: "GraphHandler"
		}
    },
    fieldNames: {
		sellOfferPricingId: {
		    type: "string",
			randomOnCreate: true,
			canUpdate: false,
			validation: {
				pattern: pattern
			},
			storageResourceTags: ['myGraph']
		},
		priceType: {
			type: "string",
			requiredOnCreate: true,
			validation: {
				pattern: pattern
			},
			storageResourceTags: ['myGraph']
		},
		minimumQuantity: {
			type: "number",
			requiredOnCreate: true,
			validation: {
				pattern: pattern
			},
			storageResourceTags: ['myGraph']		
		}
    },
    identifiers: [
		{
			type: "identifier",
			fieldName: "sellOfferPricingId"
		}
    ]
}

fieldNames

priceType
sellOfferQuantity|orderQuantity|orderValue

sellOfferPrice

{
	objectType: "sellOfferPrice",
	canDelete: false,
	complexFilterServiceTag: "ComplexFilter",
    overWriteHandlers: { // optional, if not set will create default handlers, if empty will not create handler and main function
		create: ['hdrApi', 'hdrSqs'], 	// default: ['hdrApi', 'hdrSqs']
		update: [], 					// default: ['hdrApi', 'hdrSqs']
		get: [], 						// default: ['hdrApi', 'hdrInv']
		delete: [], 					// default: ['hdrApi', 'hdrSqs']
	},	 
    storageResources: {
		myGraph: {
			storageType: "graph",
			graphServerTag: "GraphHandler"
		}
    },
    fieldNames: {
		sellOfferPriceId: {
		    type: "string",
			randomOnCreate: true,
			canUpdate: false,
			validation: {
				pattern: pattern
			},
			storageResourceTags: ['myGraph']
		},
		uptoValue: {
			type: "number",
			requiredOnCreate: true,
			validation: {
				pattern: pattern
			},
			storageResourceTags: ['myGraph']
		},
		price: {
			type: "number",
			requiredOnCreate: true,
			validation: {
				pattern: pattern
			},
			storageResourceTags: ['myGraph']		
		}
    },
    identifiers: [
		{
			type: "identifier",
			fieldName: "sellOfferPriceId"
		}
    ]
}

Object Relationships

hasSellOfferPricing

{
	"hasSellOfferPricing": {
		fieldNames: {
			"originTimestamp": {
			    type: "number",            	// "string" | "number" ...
				requiredOnCreate: true,  	// default = false
				canUpdate: false,          	// default = true
				validation: {}            	// ajv syntax
			}
		},
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "graphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "SellOfferManager",					
						objectType: "sellOffer"
					},
					linkType: "many",
				},
				to: {
					objType: {
						serviceTag: "SellOfferPrice",				
						objectType: "sellOfferPricing"					
					},					
					linkType: "many",
					handler: true
				}
			}
		]
	}
}

disabledSellOfferPricing

{
	"disabledSellOfferPricing": {
		fieldNames: {
			"originTimestamp": {
			    type: "number",            	// "string" | "number" ...
				requiredOnCreate: true,  	// default = false
				canUpdate: false,          	// default = true
				validation: {}            	// ajv syntax
			}
		},
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "graphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "SellOfferManager",					
						objectType: "sellOffer"
					},
					linkType: "many",
				},
				to: {
					objType: {
						serviceTag: "SellOfferPrice",				
						objectType: "sellOfferPricing"					
					},					
					linkType: "many",
					handler: true
				}
			}
		]
	}
}

hasSellOfferPrice

{
	"hasSellOfferPrice": {
		fieldNames: {
			"originTimestamp": {
			    type: "number",            	// "string" | "number" ...
				requiredOnCreate: true,  	// default = false
				canUpdate: false,          	// default = true
				validation: {}            	// ajv syntax
			}
		},
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "graphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "SellOfferPrice",					
						objectType: "sellOfferPricing"
					},
					linkType: "one",
					handler: true
				},
				to: {
					objType: {
						serviceTag: "SellOfferPrice",				
						objectType: "sellOfferPrice"					
					},		
					requiredOnCreate: true,			
					linkType: "many",
					handler: true
				}
			}
		]
	}
}

disabledSellOfferPrice

{
	"disabledSellOfferPrice": {
		fieldNames: {
			"originTimestamp": {
			    type: "number",            	// "string" | "number" ...
				requiredOnCreate: true,  	// default = false
				canUpdate: false,          	// default = true
				validation: {}            	// ajv syntax
			}
		},
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "graphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "SellOfferPrice",					
						objectType: "sellOfferPricing"
					},
					linkType: "one",
					handler: true
				},
				to: {
					objType: {
						serviceTag: "SellOfferPrice",				
						objectType: "sellOfferPrice"					
					},		
					linkType: "many",
					handler: true
				}
			}
		]
	}
}

Working documents

Sell Offer Price