Skip to content

Validation Tests

Primary file: internal/inbound/workorder/validator_test.go (13 func Test).

Assertion Evidence
Required fields Missing name/code/dates/arrays fail
Empty required arrays JSON + XML fixtures
Invalid stage_type Rejected after Turkish normalization
Machine output_products Required when a machine is present
Missing employee username Rejected
Date order End before start rejected; equal allowed
Negative quantity / zero stage_number Out of range
Missing product category Required

HTTP contract classification: format_validation_http_test.go, contract_error_http_test.go.

Related rules (also covered in decoder/handler tests): UTC Z only, StrictInt64 (no JSON floats/strings), unknown fields, XML DOCTYPE reject, INBOUND_MAX_BODY_BYTES → 413.