Files
api/services/nginx/app/modules
openhands 461d6e7fa8 feat(economic): add pre-flight validation to addLines() (TRU-194)
Defense in depth: before sending draft lines to e-conomic, run a 5-rule
preflight check that catches anything that slips past the sanitizers.

Rules (per line):
  1. description must be non-empty after trim()
  2. description must be <= 250 chars
  3. productNumber (if present) must match /^[A-Za-z0-9._-]{1,50}$/
  4. quantity (if present) must be a positive number
  5. unitNetPrice (if present) must be a number >= 0

Violations throw a RuntimeException and are logged via error_log with the
offending value truncated to 200 chars. Order id is included in the log
context when provided.

19 new unit tests in EconomicInvoiceDraftPreflightTest cover each rule
plus the disabled-flag bypass path.

Refs: TRU-194
2026-08-17 10:19:56 +00:00
..
2026-07-09 11:04:13 +02:00
2026-07-09 11:04:13 +02:00
2026-07-09 11:04:13 +02:00
2026-07-09 11:04:13 +02:00
2026-07-09 11:04:13 +02:00