Service - Sale: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 28: | Line 28: | ||
saleCurrencyId: { | saleCurrencyId: { | ||
type: "string", | type: "string", | ||
storageResourceTags: ['myGraph'] | storageResourceTags: ['myGraph'] | ||
}, | }, | ||
| Line 136: | Line 135: | ||
from: { | from: { | ||
objType: { | objType: { | ||
serviceTag: " | serviceTag: "Customer", | ||
objectType: "customer" | objectType: "customer" | ||
}, | }, | ||
| Line 143: | Line 142: | ||
to: { | to: { | ||
objType: { | objType: { | ||
serviceTag: " | serviceTag: "Sale", | ||
objectType: "sale" | objectType: "sale" | ||
}, | }, | ||
| Line 183: | Line 182: | ||
to: { | to: { | ||
objType: { | objType: { | ||
serviceTag: " | serviceTag: "SaleLineItemManager", | ||
objectType: "saleLineItem" | objectType: "saleLineItem" | ||
}, | }, | ||
| Line 216: | Line 215: | ||
from: { | from: { | ||
objType: { | objType: { | ||
serviceTag: " | serviceTag: "Sale", | ||
objectType: "sale" | objectType: "sale" | ||
}, | }, | ||
| Line 223: | Line 222: | ||
to: { | to: { | ||
objType: { | objType: { | ||
serviceTag: " | serviceTag: "SaleLineItemManager", | ||
objectType: "saleLineItem" | objectType: "saleLineItem" | ||
}, | }, | ||
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