test: add tests for ProductCatalogService #29

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

3 commits

Author SHA1 Message Date
Claude
bf455cec31
test: add tests for ProductCatalogService
Covers product CRUD, SKU management, pricing, categories, and search.
Fixes #9

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:29:18 +00:00
Claude
59ed456ccd
test: add tests for UsageBillingService
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>
2026-03-24 16:29:15 +00:00
Claude
5bce748a0f
security: add CSRF protection to API billing endpoints
- 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>
2026-03-24 16:19:30 +00:00