Service - Delivery Method Rate Table: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
No edit summary
Line 118: Line 118:
{
{
type: "logical",
type: "logical",
logicalTag: "deliversToLocationNodeId",
logicalTag: "deliverToLocationId",
comparison: "equals",
comparison: "equals",
value: "xx"
value: "xx"
},
},
{
// finds all rateTables that has at >=1 has_deliveryMethodRateTable incomming relationship from give sellOfferPlanDeliveryMethodLinkId
type: "logical",
logicalTag: "activeSellOfferPlanDeliveryMethodLinkId",
comparison: "equals",
value: "xx"
},
{
{
// finds all rateTables that has at >=1 has_deliveryMethodRateTable incomming relationship
// finds all rateTables that has at >=1 has_deliveryMethodRateTable incomming relationship

Revision as of 11:03, 27 November 2021

Overview

Manages delivery rate tables for delivery methods (possible other objects). Rate tables combine set rates at a certain value with increment settings to easily maintain rate table calculations.

Repository

https://bitbucket.org/izara-market-products/izara-market-products-delivery-method-rate-table

DynamoDB tables

Standard Config Table Per Service

Configuration tags

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

Graph database

Service - Products Graph

Nodes

{
	nodeLabel: "{DeliveryMethodRateTableLib.RATETABLE_GRAPH_NODE_LABEL}", // "rateTable"
	schema: {
		identifier: true,
		restrictProperties: true,
		restrictRelationships: true,
		properties: {
			rateTableId: {
				identifier: true, // create unique id from request params and uniqueMessageId
			},
		},
	}
}

Versioned data

rateTableRates

{
	properties: {
		rates: [
			{
				type: "setRate",
				upToValue: xx, // numeric value that this setRate goes up to
				rate: xx, // numeric rate
			},
			{
				type: "increment",
				upToValue: xx, // numeric value that this setRate goes up to
				ratePerIncrement: xx, // numeric amount that rate increases per increment
				increment: xx, // numeric incremental amount
			},
			// ..
		],
	},
}

Relationships

{
	relationshipType: "{DeliveryMethodRateTableLib.createDeliversToLocationNodeRelationshipType()}", // "deliversTo_locationNode"
	schema: {
		elementCanBeRemoved: false,
		allPropertiesImmutable: true,
		restrictProperties: true,
		properties: {
			originTimestamp: //timestamp the request to create/change this relationship was sent
			addedByuserId: //userId that added this relationship
		},
	}
}
  • no versionedData or disabled link, just create a relationship from rateTable to user each time locationNode removed
{
	relationshipType: "{DeliveryMethodRateTableLib.createRemovedDeliversToLocationNodeRelationshipType()}", // "removed_deliversToLocationNode"
	schema: {
		elementCanBeRemoved: false,
		allPropertiesImmutable: true,
		restrictProperties: true,
		properties: {
			originTimestamp: //timestamp the request to create/change this relationship was sent
			locationNodeId: // the locationNode removed
		},
	}
}
  • creates a relationship between user and rateTable each time a user removes a deliversTo locationNode

Data structure notes

  • multiple deliveryMethods could point to a single rateTable

Complex Filter requests

{
	filterType: "deliveryMethodRateTable" //unique id is rateTableId
	type: "group",
	elements:
	[
		{
			type: "logical",
			logicalTag: "deliverToLocationId",
			comparison: "equals",
			value: "xx"
		},
		{
			// finds all rateTables that has at >=1 has_deliveryMethodRateTable incomming relationship from give sellOfferPlanDeliveryMethodLinkId
			type: "logical",
			logicalTag: "activeSellOfferPlanDeliveryMethodLinkId",
			comparison: "equals",
			value: "xx"
		},	
		{
			// finds all rateTables that has at >=1 has_deliveryMethodRateTable incomming relationship
			type: "logical",
			logicalTag: "isEnabled",
			comparison: "true",
		},		
		...
	]
}

Working documents

Delivery Method Rate Table