API / Inbound Tests¶
Routes under test¶
text
POST /api/v1/inbound/work-orders
POST /api/v1/inbound/work-orders/test
Automated files¶
| File | Focus |
|---|---|
handler_http_test.go |
Live and test POST JSON/XML, Accept, 415/406/413, tenant rules, summary |
format_validation_http_test.go |
Test endpoint: no Mongo, no archive, no idempotency; live still protected |
contract_error_http_test.go |
Nested type errors, JSON syntax line/col, detail cap |
idempotency_archive_http_test.go |
Key required/invalid, replay, conflict, lease, archive 503 |
actor_test.go |
Not found / inactive / tenant mismatch / unexpected store → INTERNAL_ERROR 500 |
persistence_test.go |
Create/skip/machine missing/unavailable → 503 |
mongo_integration_test.go |
CONDITIONAL — skips without MONGODB_INTEGRATION_TEST_URI |
Actor codes (code, not guesswork)¶
| Condition | HTTP | Code |
|---|---|---|
| User missing | 409 | INTEGRATION_ACTOR_USER_NOT_FOUND |
User not active |
409 | INTEGRATION_ACTOR_USER_INACTIVE |
| Tenant mismatch | 409 | INTEGRATION_ACTOR_TENANT_MISMATCH |
Unexpected FindByID error |
500 | INTERNAL_ERROR |
| Mongo unavailable / deadline | 503 | DATABASE_UNAVAILABLE |
Unexpected store/DB errors stay generic INTERNAL_ERROR. Responses must not include the actor ObjectID.
Live functional POST on a lab host is not these unit tests. See Live E2E.