Sergei
54336986ad
Improve serial number validation with comprehensive testing
Added robust serial validation with support for multiple formats:
- Production format: WELLNUO-XXXX-XXXX (strict validation)
- Demo serials: DEMO-00000 and DEMO-1234-5678
- Legacy format: 8+ alphanumeric characters with hyphens
Frontend improvements (activate.tsx):
- Real-time validation feedback with error messages
- Visual error indicators (red border, error icon)
- Proper normalization (uppercase, trimmed)
- Better user experience with clear error messages
Backend improvements (beneficiaries.js):
- Enhanced serial validation on activation endpoint
- Stores normalized serial in device_id field
- Better logging for debugging
- Consistent error responses with validation details
Testing:
- 52 frontend tests covering all validation scenarios
- 40 backend tests ensuring consistency
- Edge case handling (long serials, special chars, etc.)
Code quality:
- ESLint configuration for test files
- All tests passing
- Zero linting errors
2026-01-29 11:33:54 -08:00
..
2026-01-29 11:18:16 -08:00
2026-01-26 18:39:04 -08:00
2026-01-12 20:28:18 -08:00
2026-01-12 21:44:57 -08:00
2026-01-29 11:33:54 -08:00
2026-01-29 10:49:37 -08:00
2025-12-19 09:49:24 -08:00
2026-01-26 16:48:44 -08:00
2026-01-26 19:10:45 -08:00
2026-01-29 11:06:35 -08:00
2025-12-19 09:49:24 -08:00