134 lines
3.3 KiB
JSON
134 lines
3.3 KiB
JSON
{
|
|
"name": "WorkforceEvent",
|
|
"type": "object",
|
|
"properties": {
|
|
"event_id": {
|
|
"type": "string",
|
|
"description": "Unique event identifier (EVT-timestamp-random)"
|
|
},
|
|
"event_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"shift.completed",
|
|
"shift.created",
|
|
"shift.cancelled",
|
|
"shift.no_show",
|
|
"order.created",
|
|
"order.updated",
|
|
"order.cancelled",
|
|
"order.filled",
|
|
"assignment.created",
|
|
"assignment.confirmed",
|
|
"assignment.completed",
|
|
"assignment.cancelled",
|
|
"invoice.created",
|
|
"invoice.approved",
|
|
"invoice.paid",
|
|
"invoice.overdue",
|
|
"vendor.rate_changed",
|
|
"vendor.onboarded",
|
|
"vendor.compliance_updated",
|
|
"worker.hired",
|
|
"worker.availability_changed",
|
|
"worker.certification_expired",
|
|
"worker.clock_in",
|
|
"worker.clock_out",
|
|
"budget.threshold_exceeded",
|
|
"compliance.flagged",
|
|
"system.prediction",
|
|
"system.anomaly_detected"
|
|
],
|
|
"description": "Type of workforce event"
|
|
},
|
|
"severity": {
|
|
"type": "string",
|
|
"enum": [
|
|
"info",
|
|
"warning",
|
|
"critical"
|
|
],
|
|
"default": "info"
|
|
},
|
|
"actor_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"worker",
|
|
"vendor",
|
|
"manager",
|
|
"system",
|
|
"agent",
|
|
"client"
|
|
],
|
|
"description": "Who or what triggered the event"
|
|
},
|
|
"actor_id": {
|
|
"type": "string",
|
|
"description": "ID of the actor"
|
|
},
|
|
"actor_name": {
|
|
"type": "string",
|
|
"description": "Name of the actor"
|
|
},
|
|
"subject_entity_type": {
|
|
"type": "string",
|
|
"description": "Type of entity the event is about (Order, Assignment, Invoice, etc.)"
|
|
},
|
|
"subject_entity_id": {
|
|
"type": "string",
|
|
"description": "ID of the subject entity"
|
|
},
|
|
"subject_krow_id": {
|
|
"type": "string",
|
|
"description": "KROW universal ID of the subject"
|
|
},
|
|
"context_summary": {
|
|
"type": "string",
|
|
"description": "Human-readable summary of the event"
|
|
},
|
|
"related_entities": {
|
|
"type": "array",
|
|
"description": "Related entity references for graph traversal",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"entity_type": {
|
|
"type": "string"
|
|
},
|
|
"entity_id": {
|
|
"type": "string"
|
|
},
|
|
"relationship": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"metadata": {
|
|
"type": "object",
|
|
"description": "Event-specific payload data",
|
|
"additionalProperties": true
|
|
},
|
|
"reasoning_triggered": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"description": "Whether the reasoning engine has processed this event"
|
|
},
|
|
"memory_id": {
|
|
"type": "string",
|
|
"description": "ID of the OperationalMemory record created from reasoning about this event"
|
|
},
|
|
"tags": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"description": "Searchable tags (e.g., 'overtime', 'shortage', 'compliance')"
|
|
}
|
|
},
|
|
"required": [
|
|
"event_id",
|
|
"event_type",
|
|
"subject_entity_type",
|
|
"subject_entity_id"
|
|
]
|
|
} |