Service - Unit Packing

From Izara Wiki
Revision as of 12:28, 16 February 2025 by Sven the Barbarian (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview

Handler service for the packing unit that groups multiple standard units packed into a single trackable unit, eg carton or container.

Repository

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

Notes

  • unitPacking can themselves be added to other unitPackings
  • When a Unit has a inPackingUnit relationship, it cannot have another inPackingUnit added, ie one unit can only be packed inside one unitPacking
  • multiple unitStandards used in a Service - Transform Units operation that are also inPackingUnit must all be inside the same unitPacking, and any resulting unitStandards will add inPackingUnit to the same unitPacking
  • When a unit is added to a unitPacking it can change currentSupplyLocation to oldSupplyLocation, then use the unitPackings currentSupplyLocation for location changes until it is removed from the unitPacking, at which time the unit adds a currentSupplyLocation matching the unitPacking at time of removal

objectSchemas

{
	objectType: "unitPacking",
	extendObjType: {
		serviceTag: "unitManager",
		objectType: "unit",
	},
	storageResources:{
		"xxx":{
			storageType: "graph",
			graphServerTag: "xx",
		}
	},
	fieldNames: {
		// from stage objectType
	},
	identifiers: [
		// from stage objectType
	]
},
[
  {
    "inPackingUnit": {
      storageResources:{
		"xxx":{
			storageType: "graph",
			graphServerTag: "xx",
		}
      },
      links: [
        {
          storageResourceTags: ["xxx"],
          canDelete: true,
          from: {
            objType: {
              serviceTag: "unitManager",
              objectType: "unit"
            },
            linkType: "many",
          },
          to: {
            objType: {
              serviceTag: "unitPacking",
              objectType: "unitPacking"
            },
            linkType: "one",
          }
        }
      ]
    }
  }
]
  • Units current unitPacking
[
  {
    "oldInPackingUnit": {
      storageResources:{
		"xxx":{
			storageType: "graph",
			graphServerTag: "xx",
		}
      },
      fieldNames: {
			"fromTimestamp": {
			  type: "timestamp",
			  requiredOnCreate: true,
			},
			"toTimestamp": {
			  type: "timestamp",
			  requiredOnCreate: true,
			}
		},   
      links: [
        {
          storageResourceTags: ["xxx"],
          canDelete: true,
          from: {
            objType: {
              serviceTag: "unitManager",
              objectType: "unit"
            },
            linkType: "one",
          },
          to: {
            objType: {
              serviceTag: "unitPacking",
              objectType: "unitPacking"
            },
            linkType: "many",
          }
        }
      ]
    }
  }
]
  • old inPackingUnit for a unit, maintains packing history for a unit
  • when a unit is removed from a unitPacking the inPackingUnit link is removed and an oldInPackingUnit is created (the unit can then be added to a new unitPacking if needed)

Working documents

Unit Standard