deckhearth/.convoys/scanner-user-cards-quantity-guard.md
Randall Stillwell 1e248bdf2b test(scanner): cover redesign API and component surfaces
Add vitest specs for user-cards quantity validation, scan upload-image
auth/rate-limit/MIME gates, ScannerDestinationPicker, and ScannedCardItem.
Suite grows 21 → 37 tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-27 14:26:13 -05:00

673 B

name classification success_metric depends_on status created
scanner-user-cards-quantity-guard fix POST /api/user-cards rejects non-numeric and sub-1 quantity with 400, matching the decks/[id]/cards handler contract.
redesign-scanner-flow
closed 2026-05-27

Convoy: scanner-user-cards-quantity-guard

P2 follow-up from audit-redesign-scanner-flow-44 reviewer report.

Scope

  • pages/api/user-cards.jsparseInt(quantity, 10) + NaN / < 1 guard on POST

Acceptance criteria

  1. quantity: "abc" → 400 Quantity must be at least 1
  2. quantity: 0 → 400
  3. Valid integer ≥ 1 uses parsed value for INSERT and UPDATE increment