Service - Unit Standard: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
(Created page with "= Overview = Handler service for the standard unit that tracks a single item. = Repository = https://bitbucket.org/izara-supply-units/izara-supply-units-unit-standard = DynamoDB tables = == Standard Config Table Per Service == === Configuration tags === <syntaxhighlight lang="JavaScript"> { configTag: "SupplyGraphServiceName" configKey: "SupplyGraphServiceName" configValue: xxx // eg: "SupplyGraph" } </syntaxhighlight> <syntaxhighlight lang="JavaScript"> {...")
 
 
(8 intermediate revisions by the same user not shown)
Line 7: Line 7:
https://bitbucket.org/izara-supply-units/izara-supply-units-unit-standard
https://bitbucket.org/izara-supply-units/izara-supply-units-unit-standard


= DynamoDB tables =
= Units that contain quantity properties =


== [[Standard Config Table Per Service]] ==
* Izara Supply is not used for stock management, but used to follow units we want to track, which in some cases might themselves have a quantity inside them (example bag of 1000 buttons or 200 yard roll of fabric)
* instead of tracking each button or each yard (or inch) we track the bag or roll only
* user can use a unitTrackedProperty to record the quantity inside the tracked Unit
* the unitTrackedProperty can then be used in [[Service - Transform Units]] to break down any number of individual Units into any number of other Units. This allows for changing a roll with unitTrackedProperty of yards into multiple yard Units, or different raw material Units into a group of clothing Units
* eg if have 1 tracked bag of 1000 buttons can transform into 10 shirts (100 buttons each shirt), the bag is one tracked Unit, and gets transformed into 10 tracked Unit shirts along with any other raw material


=== Configuration tags ===
== Making Inactive ==


<syntaxhighlight lang="JavaScript">
* Although Izara Supply does not manage stock levels, Units can be set to active/inactive so old or sold out Units can be marked as inactive, making queries easier to return only in stock Units
{
* For example a roll of fabric is out of stock/inactive when it's unitTrackedProperty of yards reaches 0
configTag: "SupplyGraphServiceName"
* Achieve this by setting inactiveIfZero in yards unitTrackedProperty
configKey: "SupplyGraphServiceName"
configValue: xxx // eg: "SupplyGraph"
}
</syntaxhighlight>


<syntaxhighlight lang="JavaScript">
= Units that track costing properties =
{
configTag: "UnitManagerServiceName"
configKey: "UnitManagerServiceName"
configValue: xxx // eg: "UnitManager"
}
</syntaxhighlight>


== LogicalResults ==
* The cost of Units passing through the supply chain can also be handled using unitTrackedProperty
* each raw material has a unitTrackedProperty that is it's cost (eg costPerBag) or cost per unitTrackedProperty value (eg costPerYard)
* example 1 tracked Unit of a bag of 1000 buttons would have a remainingCost unitTrackedProperty for it's full cost
* calculatedProperties in transformUnits can spread that cost (and all other materials used) across the new tracked Units created, saving the total into a new property in the outputUnits


[[Standard LogicalResults Per Service]]
= objectSchemas =  
 
= Graph database =
 
== [[Service - Supply Graph]]==
 
=== Nodes ===


<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "{UnitSharedLib.UNIT_GRAPH_NODE_LABEL}", // stored in shared npm, shared by all unit Handlers
objectType: "unitStandard",
schema: {
extendObjType: {
identifier: true,
serviceTag: "unitManager",
restrictProperties: true,
objectType: "unit",
restrictRelationships: true,
},
properties: {
storageResources:{
unitId: {
"xxx":{
identifier: true, //(random uuid)
storageType: "graph",
},
graphServerTag: "xx",
unitHandlerServiceNameTag: {
}
immutable: true,
},
},
fieldNames: {
},
// from stage objectType
}
}
</syntaxhighlight>
 
=== Versioned data ===
 
==== unitSettings ====
 
<syntaxhighlight lang="JavaScript">
{
properties: {
// some are controlled by unitType, others can be added as needed case by case, not controlled
},
},
}
identifiers: [
</syntaxhighlight>
// from stage objectType
 
]
=== Relationships ===
},
 
<syntaxhighlight lang="JavaScript">
{
relationshipType: "{unitStandardLib.IS_UNITTYPE_GRAPH_REL_TYPE}", // "is_unitType"
schema: {
elementCanBeRemoved: false,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
</syntaxhighlight>
</syntaxhighlight>
* links a standard unit to a unit type


= Working documents =
= Working documents =

Latest revision as of 23:18, 2 September 2025

Overview

Handler service for the standard unit that tracks a single item.

Repository

https://bitbucket.org/izara-supply-units/izara-supply-units-unit-standard

Units that contain quantity properties

  • Izara Supply is not used for stock management, but used to follow units we want to track, which in some cases might themselves have a quantity inside them (example bag of 1000 buttons or 200 yard roll of fabric)
  • instead of tracking each button or each yard (or inch) we track the bag or roll only
  • user can use a unitTrackedProperty to record the quantity inside the tracked Unit
  • the unitTrackedProperty can then be used in Service - Transform Units to break down any number of individual Units into any number of other Units. This allows for changing a roll with unitTrackedProperty of yards into multiple yard Units, or different raw material Units into a group of clothing Units
  • eg if have 1 tracked bag of 1000 buttons can transform into 10 shirts (100 buttons each shirt), the bag is one tracked Unit, and gets transformed into 10 tracked Unit shirts along with any other raw material

Making Inactive

  • Although Izara Supply does not manage stock levels, Units can be set to active/inactive so old or sold out Units can be marked as inactive, making queries easier to return only in stock Units
  • For example a roll of fabric is out of stock/inactive when it's unitTrackedProperty of yards reaches 0
  • Achieve this by setting inactiveIfZero in yards unitTrackedProperty

Units that track costing properties

  • The cost of Units passing through the supply chain can also be handled using unitTrackedProperty
  • each raw material has a unitTrackedProperty that is it's cost (eg costPerBag) or cost per unitTrackedProperty value (eg costPerYard)
  • example 1 tracked Unit of a bag of 1000 buttons would have a remainingCost unitTrackedProperty for it's full cost
  • calculatedProperties in transformUnits can spread that cost (and all other materials used) across the new tracked Units created, saving the total into a new property in the outputUnits

objectSchemas

{
	objectType: "unitStandard",
	extendObjType: {
		serviceTag: "unitManager",
		objectType: "unit",
	},
	storageResources:{
		"xxx":{
			storageType: "graph",
			graphServerTag: "xx",
		}
	},
	fieldNames: {
		// from stage objectType
	},
	identifiers: [
		// from stage objectType
	]
},

Working documents

Unit Standard