Service - Sell Offer System Terms: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
(Created page with "= Overview = Sell Offer System Terms can be applied to SellOffers to set buyer requirements linked to system level properties such as what role the buyer has. = Examples = * Only allowing buyers with verifierUser role to purchase * Blocking buyers who have a number of issues decided against them over a period of time * Excluding buyers with verified address in specific locations, regardless of delivery address = Notes = * Anyone can create a sellOfferSystemTerm * se...")
 
(No difference)

Latest revision as of 13:13, 12 August 2025

Overview

Sell Offer System Terms can be applied to SellOffers to set buyer requirements linked to system level properties such as what role the buyer has.

Examples

  • Only allowing buyers with verifierUser role to purchase
  • Blocking buyers who have a number of issues decided against them over a period of time
  • Excluding buyers with verified address in specific locations, regardless of delivery address

Notes

  • Anyone can create a sellOfferSystemTerm
  • sellOfferSystemTerms are immutable, new settings make new sellOfferSystemTerm
  • hash settings to create sellOfferSystemTermId, so no duplicates
  • anyone can link an existing sellOfferSystemTerm to their sellOffer

Repository

https://bitbucket.org/izara-market-services/izara-market-products-sell-offer-system-terms

Object Schemas

Additional Information
Per Service Schemas

objType

sellOfferSystemTerm

{
	objectType: "sellOfferSystemTerm",
	canDelete: false,
	storageResources: {
		myGraph: {
			storageType: "graph",
			graphServerTag: "GraphHandler"
		}
    },
    fieldNames: {
		sellOfferSystemTermId: {
			type: "string",
			hashOnCreate: ["systemTermType", "systemTypeSettings"],
			canUpdate: false,
			storageResourceTags: ['myGraph']
		}
		systemTermType: {
			type: "string", // list? systemRole|issuesDecided|verifiedAddressNotLocationId|...
			canUpdate: false,
			storageResourceTags: ['myGraph']
		}
		systemTypeSettings:{
			type: "object",
			canUpdate: false,
			storageResourceTags: ['myGraph']
		}
    },
    identifiers: [
		{
			type: "identifier",
			fieldName: "sellOfferSystemTermId"
		}
    ]
}

userPassSellOfferSystemTerm

{
	objectType: "userPassSellOfferSystemTerm",
	canDelete: false,
	storageResources: {
		dynamoDB: {
			storageType: "dynamoDB",
			tableName: "userPassSellOfferSystemTerm"
		}
    },
    fieldNames: {
		userId: {
			type: "string",
			canUpdate: false,
			storageResourceTags: ['dynamoDB']
		}
		sellOfferSystemTermId: {
			type: "string",
			canUpdate: false,
			storageResourceTags: ['dynamoDB']
		}
		userPass: {
			type: "boolean",
			canUpdate: true,
			storageResourceTags: ['dynamoDB']
		}
    },
    identifiers: [
		{
			type: "partitionKey",
			fieldName: "userId"
		},
		{
			type: "sortKey",
			fieldName: "sellOfferSystemTermId"
		},
    ]
}
  • used to cache check if user passes a sellOfferSystemTerm
  • stores only one sellOfferSystemTerm, so one sellOffer may need to check many to confirm a user can complete purchase
  • storedCache, so if any detail in a user changes stale result may return (user could manually processes again)

Object Relationships

hasSellOfferSystemTerm

{
	"hasSellOfferSystemTerm": {
		canChangeToRelTypes: [
			{
				serviceTag:"sellOfferSystemTerm",
				relationshipTag: "disabledSellOfferSystemTerm"
			},
		],
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "GraphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "sellOfferManager",
						objectType: "sellOffer"
					},
					linkType: "many",
				},
				to: {
					objType: {
						serviceTag: "sellOfferSystemTerm",
						objectType: "sellOfferSystemTerm"
					},
					linkType: "many"
				}
			}
		]
	}
}

disabledSellOfferSystemTerm

{
	"disabledSellOfferSystemTerm": {
		canChangeToRelTypes: [
			{
				serviceTag:"sellOfferSystemTerm",
				relationshipTag: "hasSellOfferSystemTerm"
			},
		],
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "GraphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "sellOfferManager",
						objectType: "sellOffer"
					},
					linkType: "many",
				},
				to: {
					objType: {
						serviceTag: "sellOfferSystemTerm",
						objectType: "sellOfferSystemTerm"
					},
					linkType: "many"
				}
			}
		]
	}
}
  • Connects a sellOffer to a sellOfferSystemTerm

Flows

checkSellOfferSystemTerms

{ 
	flowTag: "checkSellOfferSystemTerms",
	handleObj: "one",
	statusType: "storedCache",
	objType:{
		serviceTag: "sellOfferSystemTerm",
		objectType: "sellOfferSystemTerm"
	},
	event:["ownTopic"],
	outputTopic: true,
    stepProperties:{
		"uuid1":{
			objectField:{ 
				objType:{
					serviceTag: "user",
					objectType: "user" 
				},
				fieldName:"userId"
			},
		},
		"uuid2":{
			objectField:{ 
				objType:{
					serviceTag: "sellOfferSystemTerm",
					objectType: "sellOfferSystemTerm" 
				},
				fieldName:"sellOfferSystemTermId"
			},
		},
		"uuid3":{
			objectField:{ 
				objType:{
					serviceTag: "sellOfferSystemTerm",
					objectType: "sellOfferSystemTerm" 
				},
				fieldName:"userPass"
			},
		},
    },
	flowSteps:{
		In:{
			properties:["uuid1", "uuid2"],
		},
		Out:{
			properties:["uuid1", "uuid2", "uuid3"],
		},
	}
}
  • checks if a user passes a specific sellOfferSystemTerm

Working documents

Sell Offer System Terms