{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://json.schemastore.org/abc-inventory-module-data-2.0.0.json", "title": "ABCInventoryModuleData JSON Schema", "description": "Schema defining the structure of ABCInventoryModuleData including Principal Data, inventory, and transaction data in ABC-Plan's Inventory Management Module.", "type": "object", "definitions": { "ABCStatus": { "type": "string", "enum": [ "RELEASED", "CONDITIONAL_RELEASED", "QUARANTINE", "ON_HOLD", "EXPIRED", "DAMAGED" ] }, "ABCInventoryReceiveTransaction": { "type": "object", "properties": { "uid": { "type": "string" }, "timestamp": { "type": "number" }, "transactionType": { "type": "string", "enum": ["receive"] }, "transactionData": { "type": "object", "properties": { "lotNumber": { "type": "string" }, "materialNumberID": { "type": "string" }, "quantity": { "type": "number" }, "dateOfExpiry": { "type": "string", "format": "date" }, "dateOfManufacture": { "type": "string", "format": "date" }, "poNumber": { "type": "string" }, "statusID": { "$ref": "#/definitions/ABCStatus" }, "locationID": { "type": "string" }, "productID": { "type": ["string", "null"] }, "notes": { "type": "string" } }, "required": [ "lotNumber", "materialNumberID", "quantity", "dateOfExpiry", "dateOfManufacture", "poNumber", "statusID", "locationID", "productID", "notes" ], "additionalProperties": false }, "targetLotID": { "type": "string" } }, "required": [ "uid", "timestamp", "transactionType", "transactionData", "targetLotID" ], "additionalProperties": false }, "ABCInventoryBuildTransaction": { "type": "object", "properties": { "uid": { "type": "string" }, "timestamp": { "type": "number" }, "transactionType": { "type": "string", "enum": ["build"] }, "transactionData": { "type": "object", "properties": { "lotNumber": { "type": "string" }, "materialNumberID": { "type": "string" }, "quantity": { "type": "number" }, "dateOfExpiry": { "type": "string", "format": "date" }, "dateOfManufacture": { "type": "string", "format": "date" }, "poNumber": { "type": "string" }, "statusID": { "$ref": "#/definitions/ABCStatus" }, "locationID": { "type": "string" }, "upstreams": { "type": "array", "items": { "type": "object", "properties": { "lotID": { "type": "string" }, "quantity": { "type": "number" } }, "required": ["lotID", "quantity"], "additionalProperties": false } }, "upstreamIDs": { "type": "array", "items": { "type": "string" } }, "upstreamLotNumbers": { "type": "array", "items": { "type": "string" } }, "upstreamQuantities": { "type": "array", "items": { "type": "number" } }, "upstreamMaterialNumberIDs": { "type": "array", "items": { "type": "string" } }, "upstreamLocationIDs": { "type": "array", "items": { "type": "string" } }, "productID": { "type": ["string", "null"] }, "upstreamProductIDs": { "type": "array", "items": { "type": ["string", "null"] } }, "notes": { "type": "string" } }, "required": [ "lotNumber", "materialNumberID", "quantity", "dateOfExpiry", "dateOfManufacture", "poNumber", "statusID", "locationID", "upstreams", "upstreamIDs", "upstreamLotNumbers", "upstreamQuantities", "upstreamMaterialNumberIDs", "upstreamLocationIDs", "productID", "upstreamProductIDs", "notes" ], "additionalProperties": false }, "targetLotID": { "type": "string" } }, "required": [ "uid", "timestamp", "transactionType", "transactionData", "targetLotID" ], "additionalProperties": false }, "ABCInventoryTransferTransaction": { "type": "object", "properties": { "uid": { "type": "string" }, "timestamp": { "type": "number" }, "transactionType": { "type": "string", "enum": ["transfer"] }, "transactionData": { "type": "object", "properties": { "lotID": { "type": "string" }, "newLocationID": { "type": "string" }, "quantity": { "type": "number" }, "lotNumber": { "type": "string" }, "materialNumberID": { "type": "string" }, "locationID": { "type": "string" }, "productID": { "type": ["string", "null"] }, "notes": { "type": "string" } }, "required": [ "lotID", "newLocationID", "quantity", "lotNumber", "materialNumberID", "locationID", "productID", "notes" ], "additionalProperties": false }, "targetLotID": { "type": "string" } }, "required": [ "uid", "timestamp", "transactionType", "transactionData", "targetLotID" ], "additionalProperties": false }, "ABCInventoryStatusChangeTransaction": { "type": "object", "properties": { "uid": { "type": "string" }, "timestamp": { "type": "number" }, "transactionType": { "type": "string", "enum": ["statusChange"] }, "transactionData": { "type": "object", "properties": { "lotID": { "type": "string" }, "newStatusID": { "$ref": "#/definitions/ABCStatus" }, "quantity": { "type": "number" }, "lotNumber": { "type": "string" }, "materialNumberID": { "type": "string" }, "locationID": { "type": "string" }, "productID": { "type": ["string", "null"] }, "notes": { "type": "string" } }, "required": [ "lotID", "newStatusID", "quantity", "lotNumber", "materialNumberID", "locationID", "productID", "notes" ], "additionalProperties": false }, "targetLotID": { "type": "string" } }, "required": [ "uid", "timestamp", "transactionType", "transactionData", "targetLotID" ], "additionalProperties": false }, "ABCInventoryDistributeTransaction": { "type": "object", "properties": { "uid": { "type": "string" }, "timestamp": { "type": "number" }, "transactionType": { "type": "string", "enum": ["distribute"] }, "transactionData": { "type": "object", "properties": { "lotID": { "type": "string" }, "quantity": { "type": "number" }, "lotNumber": { "type": "string" }, "materialNumberID": { "type": "string" }, "locationID": { "type": "string" }, "productID": { "type": ["string", "null"] }, "notes": { "type": "string" } }, "required": [ "lotID", "quantity", "lotNumber", "materialNumberID", "locationID", "productID", "notes" ], "additionalProperties": false } }, "required": ["uid", "timestamp", "transactionType", "transactionData"], "additionalProperties": false }, "ABCInventoryDestroyTransaction": { "type": "object", "properties": { "uid": { "type": "string" }, "timestamp": { "type": "number" }, "transactionType": { "type": "string", "enum": ["destroy"] }, "transactionData": { "type": "object", "properties": { "lotID": { "type": "string" }, "lotNumber": { "type": "string" }, "materialNumberID": { "type": "string" }, "locationID": { "type": "string" }, "productID": { "type": ["string", "null"] }, "notes": { "type": "string" } }, "required": [ "lotID", "lotNumber", "materialNumberID", "locationID", "productID", "notes" ], "additionalProperties": false } }, "required": ["uid", "timestamp", "transactionType", "transactionData"], "additionalProperties": false }, "ABCInventorySellTransaction": { "type": "object", "properties": { "uid": { "type": "string" }, "timestamp": { "type": "number" }, "transactionType": { "type": "string", "enum": ["sell"] }, "transactionData": { "type": "object", "properties": { "lotID": { "type": "string" }, "quantity": { "type": "number" }, "lotNumber": { "type": "string" }, "materialNumberID": { "type": "string" }, "locationID": { "type": "string" }, "productID": { "type": ["string", "null"] }, "notes": { "type": "string" } }, "required": [ "lotID", "quantity", "lotNumber", "materialNumberID", "locationID", "productID", "notes" ], "additionalProperties": false } }, "required": ["uid", "timestamp", "transactionType", "transactionData"], "additionalProperties": false }, "ABCInventoryAdjustTransaction": { "type": "object", "properties": { "uid": { "type": "string" }, "timestamp": { "type": "number" }, "transactionType": { "type": "string", "enum": ["adjust"] }, "transactionData": { "type": "object", "properties": { "lotID": { "type": "string" }, "newQuantity": { "type": "number" }, "reasonCodeID": { "type": "string" }, "lotNumber": { "type": "string" }, "materialNumberID": { "type": "string" }, "locationID": { "type": "string" }, "productID": { "type": ["string", "null"] }, "notes": { "type": "string" } }, "required": [ "lotID", "newQuantity", "reasonCodeID", "lotNumber", "materialNumberID", "locationID", "productID", "notes" ], "additionalProperties": false } }, "required": ["uid", "timestamp", "transactionType", "transactionData"], "additionalProperties": false }, "ABCInventoryChangeExpiryTransaction": { "type": "object", "properties": { "uid": { "type": "string" }, "timestamp": { "type": "number" }, "transactionType": { "type": "string", "enum": ["changeExpiry"] }, "transactionData": { "type": "object", "properties": { "lotID": { "type": "string" }, "newDateOfExpiry": { "type": "string" }, "lotNumber": { "type": "string" }, "materialNumberID": { "type": "string" }, "locationID": { "type": "string" }, "productID": { "type": ["string", "null"] }, "notes": { "type": "string" } }, "required": [ "lotID", "newDateOfExpiry", "lotNumber", "materialNumberID", "locationID", "productID", "notes" ], "additionalProperties": false } }, "required": ["uid", "timestamp", "transactionType", "transactionData"], "additionalProperties": false }, "ABCInventoryTransaction": { "oneOf": [ { "$ref": "#/definitions/ABCInventoryReceiveTransaction" }, { "$ref": "#/definitions/ABCInventoryBuildTransaction" }, { "$ref": "#/definitions/ABCInventoryTransferTransaction" }, { "$ref": "#/definitions/ABCInventoryStatusChangeTransaction" }, { "$ref": "#/definitions/ABCInventoryDistributeTransaction" }, { "$ref": "#/definitions/ABCInventoryDestroyTransaction" }, { "$ref": "#/definitions/ABCInventorySellTransaction" }, { "$ref": "#/definitions/ABCInventoryAdjustTransaction" }, { "$ref": "#/definitions/ABCInventoryChangeExpiryTransaction" } ] }, "ABCInventoryEntryWithoutUpstreams": { "type": "object", "properties": { "lotNumber": { "type": "string" }, "materialNumberID": { "type": "string" }, "productID": { "type": ["string", "null"] }, "quantity": { "type": "number" }, "dateOfExpiry": { "type": "string", "format": "date" }, "dateOfManufacture": { "type": "string", "format": "date" }, "poNumber": { "type": "string" }, "statusID": { "$ref": "#/definitions/ABCStatus" }, "locationID": { "type": "string" }, "hasUpstreams": { "type": "boolean", "enum": [false] }, "transactionNotes": { "type": "array", "items": { "type": "string" } }, "lotNumberLowercase": { "type": "string" } }, "required": [ "lotNumber", "materialNumberID", "productID", "quantity", "dateOfExpiry", "dateOfManufacture", "poNumber", "statusID", "locationID", "hasUpstreams", "transactionNotes", "lotNumberLowercase" ], "additionalProperties": false }, "ABCInventoryEntryWithUpstreams": { "type": "object", "properties": { "lotNumber": { "type": "string" }, "materialNumberID": { "type": "string" }, "productID": { "type": ["string", "null"] }, "quantity": { "type": "number" }, "dateOfExpiry": { "type": "string", "format": "date" }, "dateOfManufacture": { "type": "string", "format": "date" }, "poNumber": { "type": "string" }, "statusID": { "$ref": "#/definitions/ABCStatus" }, "locationID": { "type": "string" }, "hasUpstreams": { "type": "boolean", "enum": [true] }, "upstreamIDs": { "type": "array", "items": { "type": "string" } }, "upstreamQuantities": { "type": "array", "items": { "type": "number" } }, "upstreamLotNumbers": { "type": "array", "items": { "type": "string" } }, "transactionNotes": { "type": "array", "items": { "type": "string" } }, "lotNumberLowercase": { "type": "string" } }, "required": [ "lotNumber", "materialNumberID", "productID", "quantity", "dateOfExpiry", "dateOfManufacture", "poNumber", "statusID", "locationID", "hasUpstreams", "upstreamIDs", "upstreamQuantities", "upstreamLotNumbers", "transactionNotes", "lotNumberLowercase" ], "additionalProperties": false }, "ABCInventoryEntry": { "oneOf": [ { "$ref": "#/definitions/ABCInventoryEntryWithoutUpstreams" }, { "$ref": "#/definitions/ABCInventoryEntryWithUpstreams" } ] } }, "properties": { "$schema": { "description": "Link to https://json.schemastore.org/abc-inventory-module-data-2.0.0.json", "type": "string", "enum": [ "https://json.schemastore.org/abc-inventory-module-data-2.0.0.json" ] }, "ABCProducts": { "type": "object", "patternProperties": { "^[a-zA-Z0-9_-]+$": { "type": "object", "properties": { "name": { "type": "string" }, "isActive": { "type": "boolean" } }, "required": ["name", "isActive"], "additionalProperties": false } }, "additionalProperties": false }, "ABCVendors": { "type": "object", "patternProperties": { "^[a-zA-Z0-9_-]+$": { "type": "object", "properties": { "name": { "type": "string" }, "isActive": { "type": "boolean" } }, "required": ["name", "isActive"], "additionalProperties": false } }, "additionalProperties": false }, "ABCMaterialCategories": { "type": "object", "patternProperties": { "^[a-zA-Z0-9_-]+$": { "type": "object", "properties": { "name": { "type": "string" }, "prefix": { "type": "string" }, "isActive": { "type": "boolean" } }, "required": ["name", "isActive", "prefix"], "additionalProperties": false } }, "additionalProperties": false }, "ABCMaterialNumbers": { "type": "object", "patternProperties": { "^[a-zA-Z0-9_-]+$": { "type": "object", "properties": { "productID": { "type": ["string", "null"] }, "vendorID": { "type": ["string", "null"] }, "materialCategoryID": { "type": "string" }, "number": { "type": "number" }, "name": { "type": "string" }, "description": { "type": "string" }, "unitOfMeasure": { "type": "string" }, "isActive": { "type": "boolean" } }, "required": [ "productID", "vendorID", "materialCategoryID", "number", "name", "description", "unitOfMeasure", "isActive" ], "additionalProperties": false } }, "additionalProperties": false }, "ABCLocations": { "type": "object", "patternProperties": { "^[a-zA-Z0-9_-]+$": { "type": "object", "properties": { "name": { "type": "string" }, "isActive": { "type": "boolean" } }, "required": ["name", "isActive"], "additionalProperties": false } }, "additionalProperties": false }, "ABCReasonCodes": { "type": "object", "patternProperties": { "^[a-zA-Z0-9_-]+$": { "type": "object", "properties": { "code": { "type": "string" }, "description": { "type": "string" }, "isActive": { "type": "boolean" } }, "required": ["code", "description", "isActive"], "additionalProperties": false } }, "additionalProperties": false }, "ABCTransactions": { "type": "array", "items": { "$ref": "#/definitions/ABCInventoryTransaction" } }, "ABCInventoryEntries": { "type": "object", "patternProperties": { "^[a-zA-Z0-9_-]+$": { "$ref": "#/definitions/ABCInventoryEntry" } }, "additionalProperties": false } }, "required": [ "$schema", "ABCProducts", "ABCVendors", "ABCMaterialCategories", "ABCMaterialNumbers", "ABCLocations", "ABCReasonCodes", "ABCTransactions", "ABCInventoryEntries" ], "additionalProperties": false }