Skip to content

feat(receipt): register ReceiptModule in AppModule and add AWS SDK deps#579

Merged
Xaxxoo merged 2 commits intosongifi:mainfrom
Haroldwonder:feat/525-transaction-receipts
Mar 29, 2026
Merged

feat(receipt): register ReceiptModule in AppModule and add AWS SDK deps#579
Xaxxoo merged 2 commits intosongifi:mainfrom
Haroldwonder:feat/525-transaction-receipts

Conversation

@Haroldwonder
Copy link
Copy Markdown
Contributor

What

The ReceiptModule (service, controller, and tests) was implemented in #509 but never
registered in AppModule, meaning the receipt endpoints were unreachable. This PR completes
the wiring.

Changes

backend/package.json

  • Add @aws-sdk/client-s3 and @aws-sdk/s3-request-presigner — direct dependencies of
    ReceiptService (which manages its own S3Client for Cloudflare R2). These were missing from
    package.json and the lock file entirely.

backend/src/app.module.ts

  • Import and register ReceiptModule so the following routes are live:
    • GET /v1/transactions/:id/receipt — presigned PDF URL (authenticated owner)
    • POST /v1/transactions/:id/receipt/email — email receipt to user
    • GET /v1/paylinks/:tokenId/receipt — presigned PDF URL for paid PayLink
    • GET /v1/admin/transactions/:id/receipt — already wired via AdminModule ✓

What was already in place (from #509)

File Description
receipt.service.ts generateTransactionReceipt, generatePayLinkReceipt,
emailTransactionReceipt, generateTransactionReceiptAdmin with R2 HeadObject cache check
receipt.controller.ts All three user-facing endpoints with JWT guard and ?refresh=true
support
receipt.module.ts Module wiring (TypeORM repos, r2Config, EmailModule)
receipt.service.spec.ts Unit tests: own tx receipt, 403 for other user, cached receipt
not regenerated, force refresh, PayLink creator/payer, email queuing
admin.controller.ts GET /admin/transactions/:id/receipt endpoint

Testing

bash

Unit tests (all passing)

cd backend && pnpm test src/receipt/receipt.service.spec.ts

closes #525

Haroldwonder and others added 2 commits March 29, 2026 22:39
- Add @aws-sdk/client-s3 and @aws-sdk/s3-request-presigner to package.json
  (required by ReceiptService which manages its own S3Client for R2)
- Register ReceiptModule in AppModule so receipt endpoints are reachable
  at GET /v1/transactions/:id/receipt, POST /v1/transactions/:id/receipt/email,
  and GET /v1/paylinks/:tokenId/receipt

Closes songifi#525
@Xaxxoo Xaxxoo merged commit 07ec59b into songifi:main Mar 29, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transaction receipts — PDF receipt generation

2 participants