test: add tests for WarehouseService #30

Open
Charon wants to merge 2 commits from feat/test-warehouse-service into dev
Member

Fixes #8

Summary

  • Comprehensive Pest tests for Services/WarehouseService.php
  • Covers warehouse management: create, list, get/set primary
  • Covers inventory operations: add/remove stock, reserve/release/fulfil
  • Covers stock transfers between warehouses
  • Covers stock count adjustments
  • Covers query methods: total stock, available stock, low/out of stock, movement history, best warehouse selection
  • Covers full order lifecycle integration (reserve-fulfil, reserve-release)
  • Includes schema migration bootstrapping for columns the models expect beyond the base migration

Test plan

  • vendor/bin/pest --filter=WarehouseServiceTest passes in CI
  • All 35+ test cases cover the public API of WarehouseService
Fixes #8 ## Summary - Comprehensive Pest tests for `Services/WarehouseService.php` - Covers warehouse management: create, list, get/set primary - Covers inventory operations: add/remove stock, reserve/release/fulfil - Covers stock transfers between warehouses - Covers stock count adjustments - Covers query methods: total stock, available stock, low/out of stock, movement history, best warehouse selection - Covers full order lifecycle integration (reserve-fulfil, reserve-release) - Includes schema migration bootstrapping for columns the models expect beyond the base migration ## Test plan - [ ] `vendor/bin/pest --filter=WarehouseServiceTest` passes in CI - [ ] All 35+ test cases cover the public API of WarehouseService
Charon added 2 commits 2026-03-24 16:30:19 +00:00
- Add `verified` middleware to billing route group so only
  email-verified users can access billing endpoints
- Separate read-only GET routes from state-changing POST routes
- Add `throttle:6,1` rate limiting to state-changing endpoints
  (cancel, resume, upgrade/preview, upgrade) — 6 requests per minute
- Reorganise route group with clear section comments

Fixes #13

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cover warehouse management (create, list, primary), inventory operations
(add/remove stock, reserve/release/fulfil), stock transfers between
warehouses, stock count adjustments, query methods (total stock, available
stock, low/out of stock, movement history, best warehouse), and full
order lifecycle integration tests.

Fixes #8

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/test-warehouse-service:feat/test-warehouse-service
git checkout feat/test-warehouse-service

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git checkout dev
git merge --no-ff feat/test-warehouse-service
git checkout feat/test-warehouse-service
git rebase dev
git checkout dev
git merge --ff-only feat/test-warehouse-service
git checkout feat/test-warehouse-service
git rebase dev
git checkout dev
git merge --no-ff feat/test-warehouse-service
git checkout dev
git merge --squash feat/test-warehouse-service
git checkout dev
git merge --ff-only feat/test-warehouse-service
git checkout dev
git merge feat/test-warehouse-service
git push origin dev
Sign in to join this conversation.
No description provided.