Service - Sell Offer Price

From Izara Wiki
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 sellOfferPrice, 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/

DynamoDB tables

Standard Config Table Per Service

Configuration tags

{
	configTag: "ProductGraphServiceName"
	configKey: "ProductGraphServiceName"
	configValue: xxx // eg: "ProductGraph"
}

Graph database

Service - Products Graph

Nodes

{
	nodeLabel: "{SellOfferPriceLib.SELLOFFERPRICE_GRAPH_NODE_LABEL}", // "sellOfferPrice"
	schema: {
		identifier: true,
		restrictProperties: true,
		restrictRelationships: true,
		properties: {
			sellOfferPriceId: {
				identifier: true, // create unique id from request params and uniqueMessageId
			},
			userId: {
				immutable: true, // a sellOfferPlan can only be used by one user (because links to their userPaymentMethods)
			},
		},
	}
}

Versioned data

sellOfferPriceSettings

{
	properties: {
		minimumQuantity: xx,
		prices: {
			sellOfferQuantity: [ // sellOfferQuantity type price settings, ordered low to high
				{
					upToValue: "xx.xx",
					price: "xx.xx",
				},
				// ...
			],
			orderQuantity: [ // orderQuantity type price settings, ordered low to high
				{
					upToValue: "xx.xx",
					price: "xx.xx",
				},
				// ...
			]				
			orderValue: [ // orderValue type price settings, ordered low to high
				{
					upToValue: "xx.xx",
					price: "xx.xx",
				},
				// ...
			]					
		},

	},
}

Relationships

{
	relationshipType: "{SellOfferPriceLib.USES_SELLOFFERPRICE_GRAPH_REL_TYPE}", // "uses_sellOfferPrice"
	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 price node

Working documents

Sell Offer Price