{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"Work Order","description":"Field-service or maintenance work order authorising a technician to perform a scheduled or corrective intervention at a customer site or internal asset. Structure aligned with EN 13306 maintenance terminology and common field-service management practice.","type":"object","additionalProperties":false,"required":["work_order_number","issued_on","issued_by","assigned_to","customer_or_site","priority","requested_completion","work_description","tasks","labour","status"],"$defs":{"task":{"type":"object","additionalProperties":false,"required":["task_description","completed"],"properties":{"task_description":{"type":"string"},"completed":{"type":"boolean"},"time_spent_hours":{"type":"number","minimum":0},"notes":{"type":"string"}}},"part":{"type":"object","additionalProperties":false,"required":["part_number","description","quantity"],"properties":{"part_number":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"number","minimum":0},"unit_cost":{"type":"number","minimum":0}}},"labour":{"type":"object","additionalProperties":false,"required":["hours"],"properties":{"hours":{"type":"number","minimum":0},"hourly_rate":{"type":"number","minimum":0},"total":{"type":"number","minimum":0}}},"totals":{"type":"object","additionalProperties":false,"properties":{"parts_total":{"type":"number","minimum":0},"labour_total":{"type":"number","minimum":0},"subtotal":{"type":"number","minimum":0},"vat":{"type":"number","minimum":0},"total":{"type":"number","minimum":0},"currency":{"type":"string","minLength":3,"maxLength":3}}},"signoff":{"type":"object","additionalProperties":false,"required":["name","date"],"properties":{"name":{"type":"string"},"date":{"type":"string","format":"date"},"signature_placeholder":{"type":"string"}}}},"properties":{"work_order_number":{"type":"string"},"issued_on":{"type":"string","format":"date"},"issued_by":{"type":"object","additionalProperties":false,"required":["name","role"],"properties":{"name":{"type":"string"},"role":{"type":"string"},"entity":{"type":"string"}}},"assigned_to":{"type":"object","additionalProperties":false,"required":["name","role"],"properties":{"name":{"type":"string"},"role":{"type":"string"},"contact":{"type":"string"}}},"customer_or_site":{"type":"object","additionalProperties":false,"required":["name","address"],"properties":{"name":{"type":"string"},"address":{"type":"string"},"contact":{"type":"string"}}},"equipment":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"description":{"type":"string"},"serial":{"type":"string"}}},"priority":{"type":"string","enum":["low","medium","high","urgent"]},"requested_completion":{"type":"string","format":"date"},"work_description":{"type":"string"},"tasks":{"type":"array","minItems":1,"items":{"$ref":"#/$defs/task"}},"parts_used":{"type":"array","items":{"$ref":"#/$defs/part"}},"labour":{"$ref":"#/$defs/labour"},"totals":{"$ref":"#/$defs/totals"},"status":{"type":"string","enum":["open","in_progress","completed","cancelled","on_hold"]},"completion_date":{"type":"string","format":"date"},"signoff":{"$ref":"#/$defs/signoff"}}}