outcome.schema.json (4961B)
1 { 2 "$comment": "Typed business outcome; eligibility is separate from execution status; no contradictory combinations", 3 "type": "object", 4 "properties": { 5 "eligibility": { 6 "type": "string", 7 "enum": [ 8 "eligible", 9 "conditional", 10 "ineligible" 11 ] 12 }, 13 "review": { 14 "type": "object", 15 "properties": { 16 "required": { 17 "type": "boolean" 18 }, 19 "clarifications": { 20 "type": "array", 21 "items": { 22 "type": "object", 23 "properties": { 24 "field": { 25 "type": "string" 26 }, 27 "reason": { 28 "type": "string", 29 "enum": [ 30 "quantity_insufficient", 31 "product_mismatch", 32 "substitution_not_permitted", 33 "fulfillment_mismatch", 34 "area_unknown", 35 "window_mismatch", 36 "price_above_ceiling", 37 "attribute_unverified", 38 "quantity_unknown", 39 "information_needed", 40 "review_required", 41 "evidence_insufficient", 42 "stock_unknown", 43 "provider_unavailable", 44 "provider_degraded", 45 "budget_exhausted" 46 ] 47 } 48 }, 49 "required": [ 50 "field", 51 "reason" 52 ], 53 "additionalProperties": false 54 } 55 } 56 }, 57 "required": [ 58 "required", 59 "clarifications" 60 ], 61 "additionalProperties": false 62 }, 63 "checks": { 64 "type": "array", 65 "items": { 66 "type": "object", 67 "properties": { 68 "kind": { 69 "type": "string" 70 }, 71 "applicable": { 72 "type": "boolean" 73 }, 74 "result": { 75 "type": "string", 76 "enum": [ 77 "pass", 78 "fail", 79 "unknown" 80 ] 81 }, 82 "reason": { 83 "type": "string", 84 "enum": [ 85 "quantity_insufficient", 86 "product_mismatch", 87 "substitution_not_permitted", 88 "fulfillment_mismatch", 89 "area_unknown", 90 "window_mismatch", 91 "price_above_ceiling", 92 "attribute_unverified", 93 "quantity_unknown", 94 "information_needed", 95 "review_required", 96 "evidence_insufficient", 97 "stock_unknown", 98 "provider_unavailable", 99 "provider_degraded", 100 "budget_exhausted" 101 ] 102 }, 103 "mandatory": { 104 "type": "boolean" 105 } 106 }, 107 "required": [ 108 "kind", 109 "result", 110 "reason", 111 "mandatory" 112 ], 113 "additionalProperties": false 114 } 115 }, 116 "execution": { 117 "type": "object", 118 "properties": { 119 "status": { 120 "type": "string", 121 "enum": [ 122 "complete", 123 "degraded", 124 "failed" 125 ] 126 }, 127 "reason": { 128 "type": "string", 129 "enum": [ 130 "quantity_insufficient", 131 "product_mismatch", 132 "substitution_not_permitted", 133 "fulfillment_mismatch", 134 "area_unknown", 135 "window_mismatch", 136 "price_above_ceiling", 137 "attribute_unverified", 138 "quantity_unknown", 139 "information_needed", 140 "review_required", 141 "evidence_insufficient", 142 "stock_unknown", 143 "provider_unavailable", 144 "provider_degraded", 145 "budget_exhausted" 146 ] 147 }, 148 "provider_calls": { 149 "type": "integer", 150 "minimum": 0 151 } 152 }, 153 "required": [ 154 "status", 155 "provider_calls" 156 ], 157 "additionalProperties": false 158 }, 159 "error": { 160 "type": [ 161 "object", 162 "null" 163 ], 164 "properties": { 165 "family": { 166 "type": "string", 167 "enum": [ 168 "invalid_request", 169 "unsupported_capability", 170 "capability_disabled", 171 "capability_unavailable", 172 "invalid_context", 173 "budget_exhausted", 174 "provider_auth", 175 "provider_validation", 176 "provider_capacity", 177 "provider_transport", 178 "provider_response_contract", 179 "internal_error" 180 ] 181 }, 182 "message": { 183 "type": "string" 184 } 185 }, 186 "required": [ 187 "family", 188 "message" 189 ], 190 "additionalProperties": false 191 } 192 }, 193 "required": [ 194 "eligibility", 195 "review", 196 "checks", 197 "execution" 198 ], 199 "additionalProperties": false 200 }