Service - Sale: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
(Created page with "= Overview = Sales of inventory to customers. = Repository = ... = Object Schemas = ; Additional Information: Per Service Schemas == sale == <syntaxhighlight lang="JavaScript"> { objectType: "customer", canDelete: false, belongTo: { serviceTag: "user", objectType: "user" }, addOnDataStructure: [], storageResources: { myGraph: { storageType: "graph", graphServerTag: "GraphHandler" } }, fieldNames: { saleId: { type: "string", randomO...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 14: Line 14:
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
objectType: "customer",
objectType: "sale",
canDelete: false,
canDelete: false,
belongTo: {
belongTo: {
serviceTag: "user",
serviceTag: "Business",
objectType: "user"
objectType: "business"
},
addOnDataStructure: [
{
type:"versionedData",
versionedDataLabel: "saleDetail",
storageResourceTag : "myGraph",
fieldNames: {
saleCurrencyId: {
type: "string",
storageResourceTags: ['myGraph']
},
}
        },
],
storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "GraphHandler"
},
"dynamo": {
"storageType": "dynamoDB",
"tableName": "sale",
},
fieldNames: {
saleId: {
type: "string",
randomOnCreate: true,
storageResourceTags: ['myGraph']
},
saleTotal:  {
type: "numeric",
storageResourceTags: ['myGraph']
},
saleCommitted: { // "working"|"updateWorking"|"processing"|"committed"
type: "string",
storageResourceTags: ['dynamo']
},
},
identifiers: [
{
type: "identifier",
fieldName: "saleId"
}
]
}
</syntaxhighlight>
 
* when building a sale it is in working stage, must click complete to become an actual sale
* saleCompleted sets to processing once compelteSale begins, probably needs uniqueRequestId also
* when a change is made to a sale (that affects accounting data) saleCompleted resets to updateWorking
 
== invoiceGroup ==
 
<syntaxhighlight lang="JavaScript">
{
objectType: "invoiceGroup",
canDelete: false,
belongTo: {
serviceTag: "Business",
objectType: "business"
},
},
addOnDataStructure: [],
addOnDataStructure: [],
Line 28: Line 89:
},
},
fieldNames: {
fieldNames: {
saleId: {
invoiceGroupId: {
type: "string",
randomOnCreate: true,
storageResourceTags: ['myGraph']
},
numberingType: {
type: "string",
type: "string",
randomOnCreate: true,
randomOnCreate: true,
storageResourceTags: ['myGraph']
},
numberingSettings: {
type: "object",
storageResourceTags: ['myGraph']
storageResourceTags: ['myGraph']
},
},
Line 37: Line 107:
{
{
type: "identifier",
type: "identifier",
fieldName: "saleId"
fieldName: "invoiceGroupId"
}
}
]
]
}
}
</syntaxhighlight>
</syntaxhighlight>
* groups sales into classifications
* invoice numbers can be separated by groups, eg separate sequencial numbering
* numberingSettings saves details such as prefix, suffix, method of sequencial ordering, period when numbering resets


== Relationships ==
== Relationships ==
Line 61: Line 135:
from: {
from: {
objType: {
objType: {
serviceTag: "customer",
serviceTag: "Customer",
objectType: "customer"
objectType: "customer"
},
},
Line 67: Line 141:
},
},
to: {
to: {
objType: {
serviceTag: "Sale",
objectType: "sale"
},
linkType: "many"
}
},
]
}
}
</syntaxhighlight>
=== hasSaleLineItem ===
<syntaxhighlight lang="JavaScript">
{
hasSaleLineItem: {
canChangeToRelTypes: [
{
serviceTag:"SaleLineItemManager",
relationshipTag: "oldSaleLineItem"
},
],
storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "GraphHandler"
}
},
links: [
{
storageResourceTags: ["myGraph"],
from: {
objType: {
objType: {
serviceTag: "sale",
serviceTag: "sale",
objectType: "sale"
objectType: "sale"
},
linkType: "one",
},
to: {
objType: {
serviceTag: "SaleLineItemManager",
objectType: "saleLineItem"
},
},
linkType: "many"
linkType: "many"
Line 78: Line 192:
}
}
</syntaxhighlight>
</syntaxhighlight>
=== oldSaleLineItem ===
<syntaxhighlight lang="JavaScript">
{
oldSaleLineItem: {
canChangeToRelTypes: [
{
serviceTag:"SaleLineItemManager",
relationshipTag: "hasSaleLineItem"
},
],
storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "GraphHandler"
}
},
links: [
{
storageResourceTags: ["myGraph"],
from: {
objType: {
serviceTag: "Sale",
objectType: "sale"
},
linkType: "one",
},
to: {
objType: {
serviceTag: "SaleLineItemManager",
objectType: "saleLineItem"
},
linkType: "many"
}
},
]
}
}
</syntaxhighlight>
= flowSchemas =
== commitNewSale ==
* uses saleCommitted setting to complete sale, which sends saleLineItems and details to ComAcc plugin to create account entries
== commitUpdateSale ==
* after changes made uses saleCommitted setting to complete the sale update, sending saleLineItems and details to ComAcc plugin to update account entries
== updateSale ==
* if have ComAcc plugin enabled, send request to plugin to check if sale has been locked on Accounting


= Addresses =
= Addresses =

Latest revision as of 14:53, 18 January 2026

Overview

Sales of inventory to customers.

Repository

...

Object Schemas

Additional Information
Per Service Schemas

sale

{
	objectType: "sale",
	canDelete: false,
	belongTo: {
		serviceTag: "Business",
		objectType: "business"
	},
	addOnDataStructure: [
		{
			type:"versionedData",
			versionedDataLabel: "saleDetail",
			storageResourceTag : "myGraph",
			fieldNames: {
				saleCurrencyId: {
					type: "string",
					storageResourceTags: ['myGraph']
				},
			}
        },	
	],
	storageResources: {
		myGraph: {
			storageType: "graph",
			graphServerTag: "GraphHandler"
		},
		"dynamo": {
			"storageType": "dynamoDB",
			"tableName": "sale",
		}  
	},
	fieldNames: {
		saleId: {
			type: "string",
			randomOnCreate: true,
			storageResourceTags: ['myGraph']
		},
		saleTotal:  {
			type: "numeric",
			storageResourceTags: ['myGraph']
		},
		saleCommitted: { // "working"|"updateWorking"|"processing"|"committed"
			type: "string",
			storageResourceTags: ['dynamo']
		},
	},
	identifiers: [
		{
			type: "identifier",
			fieldName: "saleId"
		}
	]
}
  • when building a sale it is in working stage, must click complete to become an actual sale
  • saleCompleted sets to processing once compelteSale begins, probably needs uniqueRequestId also
  • when a change is made to a sale (that affects accounting data) saleCompleted resets to updateWorking

invoiceGroup

{
	objectType: "invoiceGroup",
	canDelete: false,
	belongTo: {
		serviceTag: "Business",
		objectType: "business"
	},
	addOnDataStructure: [],
	storageResources: {
		myGraph: {
			storageType: "graph",
			graphServerTag: "GraphHandler"
		}
	},
	fieldNames: {
		invoiceGroupId: {
			type: "string",
			randomOnCreate: true,
			storageResourceTags: ['myGraph']
		},
		numberingType: {
			type: "string",
			randomOnCreate: true,
			storageResourceTags: ['myGraph']
		},
		numberingSettings: {
			type: "object",
			storageResourceTags: ['myGraph']
		},
	},
	identifiers: [
		{
			type: "identifier",
			fieldName: "invoiceGroupId"
		}
	]
}
  • groups sales into classifications
  • invoice numbers can be separated by groups, eg separate sequencial numbering
  • numberingSettings saves details such as prefix, suffix, method of sequencial ordering, period when numbering resets

Relationships

hasSale

{
	hasSale: {
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "GraphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "Customer",
						objectType: "customer"
					},
					linkType: "one",
				},
				to: {
					objType: {
						serviceTag: "Sale",
						objectType: "sale"
					},
					linkType: "many"
				}
			},
		]
	}
}

hasSaleLineItem

{
	hasSaleLineItem: {
		canChangeToRelTypes: [
			{
				serviceTag:"SaleLineItemManager",
				relationshipTag: "oldSaleLineItem"
			},
		],
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "GraphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "sale",
						objectType: "sale"
					},
					linkType: "one",
				},
				to: {
					objType: {
						serviceTag: "SaleLineItemManager",
						objectType: "saleLineItem"
					},
					linkType: "many"
				}
			},
		]
	}
}

oldSaleLineItem

{
	oldSaleLineItem: {
		canChangeToRelTypes: [
			{
				serviceTag:"SaleLineItemManager",
				relationshipTag: "hasSaleLineItem"
			},
		],
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "GraphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "Sale",
						objectType: "sale"
					},
					linkType: "one",
				},
				to: {
					objType: {
						serviceTag: "SaleLineItemManager",
						objectType: "saleLineItem"
					},
					linkType: "many"
				}
			},
		]
	}
}

flowSchemas

commitNewSale

  • uses saleCommitted setting to complete sale, which sends saleLineItems and details to ComAcc plugin to create account entries

commitUpdateSale

  • after changes made uses saleCommitted setting to complete the sale update, sending saleLineItems and details to ComAcc plugin to update account entries

updateSale

  • if have ComAcc plugin enabled, send request to plugin to check if sale has been locked on Accounting

Addresses

  • use same structure as orders in Izara Market

Working documents

Sale