Skip to content

feat(db): implement optimistic locking on Invoice and Investment - #245

Open
Tekh134 wants to merge 3 commits into
StellarState:devfrom
Tekh134:dev
Open

feat(db): implement optimistic locking on Invoice and Investment#245
Tekh134 wants to merge 3 commits into
StellarState:devfrom
Tekh134:dev

Conversation

@Tekh134

@Tekh134 Tekh134 commented Aug 25, 2026

Copy link
Copy Markdown

Implements TypeORM optimistic locking on Invoice and Investment entities to prevent race conditions during concurrent investment allocation.

  • Adds @VersionColumn() to Invoice.model.ts and Investment.model.ts
  • Creates migration 1711000000001-AddOptimisticLockingVersion.ts
  • Updates investment.service.ts to catch OptimisticLockVersionMismatchError and retry
  • Adds concurrency unit tests simulating 10 simultaneous investment requests

Closes #143

@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@Tekh134 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Tekh134 Tekh134 changed the title feat(db): add marketplace indexes migration feat(db): implement optimistic locking on Invoice and Investment Aug 25, 2026
@Tekh134 Tekh134 changed the title feat(db): implement optimistic locking on Invoice and Investment feat(invoices): add invoice analytics endpoint and integration test for seller authorization Aug 25, 2026
@Tekh134 Tekh134 changed the title feat(invoices): add invoice analytics endpoint and integration test for seller authorization feat(db): implement optimistic locking on Invoice and Investment Aug 25, 2026
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.

[DATABASE] Implement TypeORM optimistic locking on Invoice & Investment entity updates

2 participants