ADR-015: Lot Management Support (REQ-LOT-001)
Status: Accepted
Date: 2026-06-04
Context
The Hanel t-Server exposes SOAP API versions V02, V03, and V04 that add support for
batch/lot numbers (batchNumber) on articles, movement orders, and inventory records.
The existing module only supports V01 operations.
Decision
- Add a
lot_management_enabled: bool = Falseflag toGatewayConfig(env var:HANEL_LOT_MANAGEMENT_ENABLED). - When
lot_management_enabled=False(default), all behaviour is identical to the pre-existing V01 implementation — full backward compatibility is preserved. - When
lot_management_enabled=True, the gateway uses: sendAPDReqV03instead ofsendAPDReqV01forregister_articlesendJobsV02instead ofsendJobsReqV01forsend_movement_orderreadAllJobsV02instead ofreadAllJobsReqV01forget_completed_movements/get_all_ordersreadAllAMDV04instead ofreadAllAMDReqV01forget_inventorydeleteJobReqV01is unchanged (no lot-aware version exists)batch_number: str | None = Noneis added as the last field onMovementLine,MovementLineResult, andStockRecord.register_articlegains an optionalbatch_numberparameter in bothSoapOperationsandHanelWarehouseGateway.- The XML parsers (
parse_movement_results,parse_stock_records) are not forked: they usefindtext(..., None, ns)which returnsNonewhen the tag is absent (V01) and the value when present (V02/V04) — single parser, two versions. - When
lot_management_enabled=Trueand an application error occurs, the message includes a hint pointing to configuration (REQ-LOT-21).
Consequences
- Zero risk of regression for existing V01 users.
- The
batch_numberfield on dataclasses is additive (defaultNone); callers that do not use lot management are unaffected. - PA-01 (exact XML tag names) is still provisional — see ADR-016.