Service - Sell Offer Price

From Izara Wiki
Revision as of 05:41, 19 November 2024 by Pong (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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