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
 
(4 intermediate revisions by one other user not shown)
Line 2: Line 2:


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 sellOfferPricing, even ones created by other users, but only the user who created the sellOfferPrice can change it.


= Repository =
= Repository =


https://bitbucket.org/izara-market-products/izara-market-products-sell-offer-plan
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]]==
 
=== Nodes ===


.... continue here
; priceType
: ''sellOfferQuantity''|''orderQuantity''|''orderValue''


=== sellOfferPrice ===


<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "{SellOfferPlanLib.SELLOFFERPLAN_GRAPH_NODE_LABEL}", // "sellOfferPlan"
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']
sellOfferPlanId: {
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
},
},
currencyId: {
storageResourceTags: ['myGraph']
immutable: true, // all added deliveryMethods must match
},
price: {
type: "number",
requiredOnCreate: true,
validation: {
pattern: pattern
},
},
storageResourceTags: ['myGraph']
}
    },
    identifiers: [
{
type: "identifier",
fieldName: "sellOfferPriceId"
}
    ]
}
</syntaxhighlight>
== Object Relationships ==
=== 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>
</syntaxhighlight>


=== disabledSellOfferPricing ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "{SellOfferPlanLib.SELLOFFERPLAN_DELIVERYMETHODLINK_GRAPH_NODE_LABEL}", // "sellOfferPlanDeliveryMethodLink"
"disabledSellOfferPricing": {
schema: {
fieldNames: {
identifier: true,
"originTimestamp": {
restrictProperties: true,
    type: "number",           // "string" | "number" ...
restrictRelationships: true,
requiredOnCreate: true,  // default = false
properties: {
canUpdate: false,          // default = true
sellOfferPlanDeliveryMethodLinkId: {
validation: {}            // ajv syntax
identifier: true, // create unique id from request params and uniqueMessageId
}
},
},
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>
</syntaxhighlight>


=== hasSellOfferPrice ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "{SellOfferPlanLib.SELLOFFERPLAN_USERPAYMENTMETHODLINK_GRAPH_NODE_LABEL}", // "sellOfferPlanUserPaymentMethodLink"
"hasSellOfferPrice": {
schema: {
fieldNames: {
identifier: true,
"originTimestamp": {
restrictProperties: true,
    type: "number",           // "string" | "number" ...
restrictRelationships: true,
requiredOnCreate: true,  // default = false
properties: {
canUpdate: false,          // default = true
sellOfferPlanUserPaymentMethodLinkId: {
validation: {}            // ajv syntax
identifier: true, // create unique id from request params and uniqueMessageId
}
},
},
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
}
}
]
}
}
}
}
</syntaxhighlight>
</syntaxhighlight>


=== Versioned data ===
=== disabledSellOfferPrice ===
 
==== sellOfferPriceSettings ====
 
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
properties: {
"disabledSellOfferPrice": {
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: "SellOfferPrice",
objectType: "sellOfferPricing"
},
linkType: "one",
handler: true
},
},
// ...
to: {
],
objType: {
orderQuantity: [ // orderQuantity type price settings, ordered low to high
serviceTag: "SellOfferPrice",
{
objectType: "sellOfferPrice"
upToValue: "xx.xx",
},
price: "xx.xx",
linkType: "many",
},
handler: true
// ...
}
]
}
orderValue: [ // orderValue type price settings, ordered low to high
]
{
}
upToValue: "xx.xx",
price: "xx.xx",
},
// ...
]
},
 
},
}
}
</syntaxhighlight>
</syntaxhighlight>


= 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