Skip to content

[POS-1] Shop + Product basic utilities#7

Open
aallali wants to merge 37 commits into
mainfrom
feat/pos
Open

[POS-1] Shop + Product basic utilities#7
aallali wants to merge 37 commits into
mainfrom
feat/pos

Conversation

@aallali
Copy link
Copy Markdown
Member

@aallali aallali commented Feb 3, 2026

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 3, 2026

🚨 Test Coverage Below 85% 🚨

The current test coverage does not meet the required 85% threshold. Please improve the following coverage metrics:

Coverage Type Current Coverage
Lines 🟢 88.22%
Statements 🟢 89.23%
Functions 🔴 74.32%
Branches 🔴 79%
Average 🔴 83%

Signup was failing with Prisma transaction timeout errors under seed and concurrent requests.

Root cause:
- Email sending was executed inside the Prisma transaction
- This kept DB connections open longer than needed
- Concurrent signups + bcrypt hashing exhausted the Prisma connection pool
- Resulted in: “Transaction API error: Unable to start a transaction in the given time”

Changes:
- Moved verification email sending outside the Prisma transaction
- Limited transaction scope to DB writes only (user + token)
- Added Prisma transaction timeout/maxWait options
- Added safe mail error handling with try/catch and logging
- Signup no longer fails if email sending fails

Result:
- Shorter transactions
- Lower connection pool pressure
- Seed and concurrent signup now stable
- Email failures handled without breaking account creation
- CreateShopDto
- ShopResponseDto
- toShopResponseDto()
- CreateProductDto
- UpdateProductDto
- ProductResponseDto
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.

1 participant