You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: wrap card delete in transaction with count guard and default promotion (#372)
Closes#328
- Enforce minimum-one-card invariant: reject DELETE with 400 when the
user has only one card remaining
- Promote the next oldest card to default atomically if the deleted
card was the default
- Wrap count check, optional default promotion, and delete in a single
Prisma transaction so concurrent requests cannot race past the guard
0 commit comments