test: add tests for InvoiceService #27

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

Fixes #5

Summary

  • Adds 43 tests covering InvoiceService and Invoice model
  • Tests invoice generation from orders (pending and paid)
  • Tests renewal invoice creation with tax calculations
  • Tests line item copying from orders to invoices
  • Tests PDF generation, retrieval, and storage path configuration
  • Tests email sending with config toggle and recipient resolution
  • Tests status transitions (markAsPaid, void)
  • Tests workspace query methods (getForWorkspace, getUnpaidForWorkspace, getOverdueForWorkspace)
  • Tests Invoice model status helpers, actions, scopes, relationships, and invoice number generation

Test plan

  • Run vendor/bin/pest --filter=InvoiceServiceTest in integrated environment
  • Verify all 43 tests pass

🤖 Generated with Claude Code

Fixes #5 ## Summary - Adds 43 tests covering InvoiceService and Invoice model - Tests invoice generation from orders (pending and paid) - Tests renewal invoice creation with tax calculations - Tests line item copying from orders to invoices - Tests PDF generation, retrieval, and storage path configuration - Tests email sending with config toggle and recipient resolution - Tests status transitions (markAsPaid, void) - Tests workspace query methods (getForWorkspace, getUnpaidForWorkspace, getOverdueForWorkspace) - Tests Invoice model status helpers, actions, scopes, relationships, and invoice number generation ## Test plan - [ ] Run `vendor/bin/pest --filter=InvoiceServiceTest` in integrated environment - [ ] Verify all 43 tests pass 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Charon added 2 commits 2026-03-24 16:25:49 +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>
Covers invoice generation from orders and renewals, line item copying,
tax calculations, PDF generation/retrieval, email sending, status
transitions, workspace queries, model scopes, and relationships.

Fixes #5

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