{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Manutenzione dei treni (maintenance.json)", "type": "object", "properties": { "$schema": { "type": "string" }, "version": { "type": "integer", "minimum": 1 }, "components": { "type": "object", "properties": { "locomotive": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$" }, "name_it": { "type": "string", "minLength": 1 }, "failureWeight": { "type": "number", "minimum": 0, "maximum": 1 }, "wearPer100Km": { "type": "number", "minimum": 0, "maximum": 10 } }, "required": [ "id", "name_it", "failureWeight", "wearPer100Km" ], "additionalProperties": false }, "minItems": 1 }, "car": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$" }, "name_it": { "type": "string", "minLength": 1 }, "failureWeight": { "type": "number", "minimum": 0, "maximum": 1 }, "wearPer100Km": { "type": "number", "minimum": 0, "maximum": 10 } }, "required": [ "id", "name_it", "failureWeight", "wearPer100Km" ], "additionalProperties": false }, "minItems": 1 } }, "required": [ "locomotive", "car" ], "additionalProperties": false }, "wear": { "type": "object", "additionalProperties": { "type": [ "number", "integer", "boolean", "array", "object", "string" ] } }, "failure": { "type": "object", "additionalProperties": { "type": [ "number", "integer", "boolean", "array", "object", "string" ] } }, "effects": { "type": "object", "additionalProperties": { "type": [ "number", "integer", "boolean", "array", "object", "string" ] } }, "interventions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$" }, "name_it": { "type": "string", "minLength": 1 }, "days": { "type": "integer", "minimum": 1 }, "costShare": { "type": "number", "minimum": 0, "maximum": 2 }, "spareParts": { "type": "integer", "minimum": 0 }, "effect": { "type": "string", "enum": [ "inspection", "service", "overhaul", "repair", "replace" ] }, "restoreTo": { "type": "number", "minimum": 0, "maximum": 100 } }, "required": [ "id", "name_it", "days", "costShare", "spareParts", "effect" ], "additionalProperties": false }, "minItems": 6 }, "inspection": { "type": "object", "additionalProperties": { "type": [ "number", "integer", "boolean", "array", "object", "string" ] } }, "service": { "type": "object", "additionalProperties": { "type": [ "number", "integer", "boolean", "array", "object", "string" ] } }, "overhaul": { "type": "object", "additionalProperties": { "type": [ "number", "integer", "boolean", "array", "object", "string" ] } }, "depots": { "type": "object", "additionalProperties": { "type": [ "number", "integer", "boolean", "array", "object", "string" ] } }, "policies": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "enum": [ "economy", "standard", "thorough" ] }, "name_it": { "type": "string", "minLength": 1 }, "intervalFactor": { "type": "number", "minimum": 0.1 }, "effectFactor": { "type": "number", "minimum": 0.1 }, "costFactor": { "type": "number", "minimum": 0.1 } }, "required": [ "id", "name_it", "intervalFactor", "effectFactor", "costFactor" ], "additionalProperties": false }, "minItems": 3, "maxItems": 3 }, "intervals": { "type": "object", "additionalProperties": { "type": [ "number", "integer", "boolean", "array", "object", "string" ] } }, "planner": { "type": "object", "additionalProperties": { "type": [ "number", "integer", "boolean", "array", "object", "string" ] } } }, "required": [ "version", "components", "wear", "failure", "effects", "interventions", "inspection", "service", "overhaul", "depots", "policies", "intervals", "planner" ], "additionalProperties": false }