Feature: Batch interpretation endpoint
Goal
Support interpreting many input strings in one request for high-throughput scanner scenarios.
Draft API
Ednpoint Design tbd, consider BATCH like in odata
Single RuleSet, multiple inputs. Reuse existing auth/cache/factory flow and execute interpreter per item.
Request example
{
"items": [
{ "id": "scan-001", "source": "01076123456789001724063010ABC123" },
{ "id": "scan-002", "source": "01076123456789001724070110XYZ999" }
],
"options": {
"stopOnFirstError": false,
"includeTrace": false
}
}
Response example
{
"rulesetId": "RS_PACK_LABEL",
"summary": {
"total": 2,
"ok": 2,
"failed": 0,
"durationMs": 14
},
"results": [
{
"id": "scan-001",
"status": "ok",
"result": {
"material": "7612345678900",
"expiryDate": "2024-06-30",
"batch": "ABC123"
}
},
{
"id": "scan-002",
"status": "ok",
"result": {
"material": "7612345678900",
"expiryDate": "2024-07-01",
"batch": "XYZ999"
}
}
]
}
Behavior draft
- Max
items: 500 (configurable).
id required and unique within request.
- Per-item isolation by default (
stopOnFirstError=false).
- Per-item error shape:
{ id, status: "error", error: { code, message } }.
- HTTP status semantics:
200 when request envelope valid (even mixed item errors)
400 malformed payload / duplicate ids / too many items
401/403 auth
404 ruleset not found
- Optional
includeTrace=true returns applied rule IDs + intermediate values per item.
Implementation notes
- Add route in
zasis_cl_http_handler for :batch.
- Load RuleSet once via
zasis_cl_ruleset_factory.
- Iterate items and execute
zasis_cl_interpreter per item.
- Return ordered
results matching input order + summary counters.
Acceptance criteria
- Batch endpoint supports at least 500 items (configurable).
- One failing item does not fail whole batch by default.
- Output preserves item order and includes per-item status.
- Validation and error semantics implemented as drafted.
- Add/adjust tests (
npm test, and npm run icf-test for HTTP stack changes).
Feature: Batch interpretation endpoint
Goal
Support interpreting many input strings in one request for high-throughput scanner scenarios.
Draft API
Ednpoint Design tbd, consider BATCH like in odata
Single RuleSet, multiple inputs. Reuse existing auth/cache/factory flow and execute interpreter per item.
Request example
{ "items": [ { "id": "scan-001", "source": "01076123456789001724063010ABC123" }, { "id": "scan-002", "source": "01076123456789001724070110XYZ999" } ], "options": { "stopOnFirstError": false, "includeTrace": false } }Response example
{ "rulesetId": "RS_PACK_LABEL", "summary": { "total": 2, "ok": 2, "failed": 0, "durationMs": 14 }, "results": [ { "id": "scan-001", "status": "ok", "result": { "material": "7612345678900", "expiryDate": "2024-06-30", "batch": "ABC123" } }, { "id": "scan-002", "status": "ok", "result": { "material": "7612345678900", "expiryDate": "2024-07-01", "batch": "XYZ999" } } ] }Behavior draft
items: 500 (configurable).idrequired and unique within request.stopOnFirstError=false).{ id, status: "error", error: { code, message } }.200when request envelope valid (even mixed item errors)400malformed payload / duplicate ids / too many items401/403auth404ruleset not foundincludeTrace=truereturns applied rule IDs + intermediate values per item.Implementation notes
zasis_cl_http_handlerfor:batch.zasis_cl_ruleset_factory.zasis_cl_interpreterper item.resultsmatching input order + summary counters.Acceptance criteria
npm test, andnpm run icf-testfor HTTP stack changes).