Quote API: add X-LastMile-Version response header

Summary

Adds an X-LastMile-Version header (value config('lastmile.version'), from APP_VERSION, default 0.1.0-dev) to every POST /api/quote response: 200, 422 validation, 422 unserviceable, and 500 invariant violation (which keeps X-LastMile-Invariants: fail).

Implemented as a new route middleware AddVersionHeader attached to the /quote route only, so validation errors and aborts that bypass the controller's return statements are also covered. Other endpoints are untouched. Risk: low (read-only additive header; no change to quote math, ETA, pricing, auth or billing; QuoteInvariants and lastmile.policy.yml unchanged).

Tests

Added to tests/Feature/QuoteApiTest.php: success, validation error, unserviceable lane, invariant-violation 500 (with X-LastMile-Invariants: fail), and default-config value. The injected random 500 is not tested, since injectFaults uses random_int.

php artisan test -> {"tool":"phpunit","result":"passed","tests":30,"passed":30,"assertions":1550} vendor/bin/pint -> passed

Closes #2

Merge request reports

Loading
Loading