test: add tests for ProductCatalogService #29

Open
Charon wants to merge 3 commits from feat/test-product-catalog-service into dev
Member

Adds comprehensive Pest tests for ProductCatalogService covering:

  • Product CRUD — create (M1-only guard, SKU uppercasing, auto-generation), update (immutable SKU/owner), soft-delete
  • SKU management — entity lineage building, suffix overrides, resolveSku() parsing
  • Pricing — base price, inherited price, price_override on assignments, null for unassigned
  • Assignments — assign to M2/M3, M1 rejection, duplicate-guard upsert, overrides, remove
  • Bulk opsbulkAssign, copyAssignments with/without overrides
  • CategoriesgetByCategory for M1 and M2, empty results
  • Search — by name, by SKU, limit, owner scoping
  • Featured — M1/M2 featured queries, limit
  • StatsgetProductStats for M1 and M2
  • Effective product — full data resolution for M1 and M2, fallback to master values

Fixes #9

Adds comprehensive Pest tests for `ProductCatalogService` covering: - **Product CRUD** — create (M1-only guard, SKU uppercasing, auto-generation), update (immutable SKU/owner), soft-delete - **SKU management** — entity lineage building, suffix overrides, `resolveSku()` parsing - **Pricing** — base price, inherited price, price_override on assignments, null for unassigned - **Assignments** — assign to M2/M3, M1 rejection, duplicate-guard upsert, overrides, remove - **Bulk ops** — `bulkAssign`, `copyAssignments` with/without overrides - **Categories** — `getByCategory` for M1 and M2, empty results - **Search** — by name, by SKU, limit, owner scoping - **Featured** — M1/M2 featured queries, limit - **Stats** — `getProductStats` for M1 and M2 - **Effective product** — full data resolution for M1 and M2, fallback to master values Fixes #9
Charon added 3 commits 2026-03-24 16:29:38 +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 usage recording (with idempotency, inactive meters, feature flag),
workspace-level recording, usage retrieval and summaries, pending charge
calculations, invoice line item creation, tiered/flat-rate overage pricing,
billing cycle resets, usage aggregation, meter CRUD, and Stripe gate checks.

Fixes #7

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Covers product CRUD, SKU management, pricing, categories, and search.
Fixes #9

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-product-catalog-service:feat/test-product-catalog-service
git checkout feat/test-product-catalog-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-product-catalog-service
git checkout feat/test-product-catalog-service
git rebase dev
git checkout dev
git merge --ff-only feat/test-product-catalog-service
git checkout feat/test-product-catalog-service
git rebase dev
git checkout dev
git merge --no-ff feat/test-product-catalog-service
git checkout dev
git merge --squash feat/test-product-catalog-service
git checkout dev
git merge --ff-only feat/test-product-catalog-service
git checkout dev
git merge feat/test-product-catalog-service
git push origin dev
Sign in to join this conversation.
No description provided.