How Phone Number and Email Validation Works
Source: workshop-public-booking-api-gateway/config/validation.js
- Phone: digits only — spaces, dashes, parentheses, plus signs ALL rejected
- International format (+64 21 123 4567) is rejected
- Email: case-insensitive matching (ILIKE)
- Empty strings normalize to NULL — treated as "no value provided"
- Vehicle dates: warranty (YYYY-MM-DD), build date (YYYY-MM), but error messages show wrong field names
Support scenarios
- "Customer can't submit booking" → phone number has spaces or international prefix
- "Email matched wrong customer" → ILIKE matches substrings