Skip to content

feat: add backend CRUD for providers, assets, and transactions#1

Open
grazo99 wants to merge 8 commits into
mainfrom
feat/001-create-transaction-backend
Open

feat: add backend CRUD for providers, assets, and transactions#1
grazo99 wants to merge 8 commits into
mainfrom
feat/001-create-transaction-backend

Conversation

@grazo99

@grazo99 grazo99 commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add Provider model to Prisma schema with currency and providerId fields on Transaction
  • Implement providers module (POST/GET) with duplicate name conflict handling (409)
  • Implement assets module (POST/GET) with enum validation
  • Implement transactions module (full CRUD) with asset existence checks, nested relations, and proper error codes (400/404)
  • Add infrastructure: class-validator, ValidationPipe, Jest + e2e test configs

Spec: docs/specs/001-create-transaction/spec.md
25 tests passing (17 unit + 8 e2e)

Test plan

  • cd apps/api && pnpm jest --verbose — 17 unit tests pass
  • cd apps/api && pnpm jest --config test/jest-e2e.json --verbose — 8 e2e tests pass
  • Manual: POST /api/providers, POST /api/assets, full CRUD on /api/transactions

🤖 Generated with Claude Code

brintati and others added 8 commits June 21, 2026 23:12
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use @IsDateString() for date field, @ispositive() for quantity/price
- Validate providerId exists in create() and update()
- Validate assetId exists in update()
- Add @isnotempty() on optional providerId to reject empty strings
- Add @unique constraint on Asset.ticker with 409 conflict handling
- Add 6 new unit tests covering all validation cases (23 total)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants