45 lines
1.8 KiB
JSON
45 lines
1.8 KiB
JSON
|
|
{
|
||
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||
|
|
"$id": "https://canon.coulomb.social/schemas/work-records/intake.schema.json",
|
||
|
|
"title": "Intake Item",
|
||
|
|
"description": "Authored YAML block for kind=intake. Id: {PREFIX}-IN-NNNN; legacy AWQ-NNN grandfathered. Lifecycle: open -> vetted -> routed -> closed(promoted|declined|absorbed).",
|
||
|
|
"type": "object",
|
||
|
|
"required": ["id", "title"],
|
||
|
|
"properties": {
|
||
|
|
"id": { "type": "string", "pattern": "^([A-Z]+-IN-[0-9]{4}|AWQ-[0-9]{3})$" },
|
||
|
|
"kind": { "const": "intake" },
|
||
|
|
"title": { "type": "string", "minLength": 5 },
|
||
|
|
"status": { "enum": ["open", "vetted", "routed", "closed"] },
|
||
|
|
"outcome": { "enum": ["promoted", "declined", "absorbed"] },
|
||
|
|
"lane": { "$ref": "spine.schema.json#/$defs/lane" },
|
||
|
|
"owner": { "$ref": "spine.schema.json#/$defs/owner" },
|
||
|
|
"tags": { "$ref": "spine.schema.json#/$defs/tags" },
|
||
|
|
"priority": { "enum": ["high", "medium", "low"] },
|
||
|
|
"pulls_from": { "type": "array" },
|
||
|
|
"promoted_to": { "type": "string", "description": "Canonical id of the record this intake was promoted to." },
|
||
|
|
"origin": { "type": "string" },
|
||
|
|
"notes": { "type": "string" },
|
||
|
|
"state_hub_intake_id": { "$ref": "spine.schema.json#/$defs/uuid" }
|
||
|
|
},
|
||
|
|
"allOf": [
|
||
|
|
{
|
||
|
|
"if": { "properties": { "status": { "const": "closed" } }, "required": ["status"] },
|
||
|
|
"then": { "required": ["outcome"] }
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"if": { "properties": { "outcome": { "const": "promoted" } }, "required": ["outcome"] },
|
||
|
|
"then": { "required": ["promoted_to"] }
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"if": {
|
||
|
|
"not": {
|
||
|
|
"properties": { "status": { "const": "closed" } },
|
||
|
|
"required": ["status"]
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"then": { "required": ["lane"] }
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"additionalProperties": true
|
||
|
|
}
|