Validation Rules & Form Reference
Complete reference for all validation rules, field constraints, file upload limits, and form validation patterns used across the OpenVTS platform.
Last updated April 17, 2026
Validation Rules Reference
This page documents every validation rule applied across forms in the OpenVTS platform. All validations use the Zod schema library and are enforced on both the client and server side.
Name Validation
| Rule | Constraint | Description |
|---|---|---|
| Minimum Length | 2 characters | Name must be at least 2 characters long |
| Maximum Length | Configurable | Maximum length is configurable per deployment |
| Must Contain Letter | At least 1 letter | Name must contain at least one alphabetic character |
| Allowed Characters | Letters, spaces, hyphens, apostrophes, periods | Only these character types are permitted |
| No Multiple Spaces | No consecutive spaces | Multiple consecutive spaces are rejected |
Email Validation
| Rule | Constraint | Description |
|---|---|---|
| Required | Non-empty | Email field cannot be left blank |
| Maximum Length | Configurable | Maximum character count for email addresses |
| Valid Format | RFC 5322 pattern | Must match standard email format (user@domain.tld) |
Username Validation
| Rule | Constraint | Description |
|---|---|---|
| Minimum Length | 3 characters | Username must be at least 3 characters |
| Maximum Length | Configurable | Maximum length is configurable |
| Must Contain Letter | At least 1 letter | Username must include at least one letter |
| Allowed Characters | Letters, numbers, dots, underscores, hyphens | Special characters limited to . _ - |
Password Validation
| Rule | Constraint | Description |
|---|---|---|
| Minimum Length | Configurable | Minimum password length (typically 8 characters) |
| Maximum Length | Configurable | Maximum password length |
| Must Match | Confirm field | Password and confirm password fields must be identical |
| Current Required | For changes | Current password required when changing existing password |
Mobile / Phone Validation
| Rule | Constraint | Description |
|---|---|---|
| Minimum Digits | Configurable | Minimum digit count for phone numbers |
| Maximum Digits | Configurable | Maximum digit count for phone numbers |
| Country Code | Required (with number) | Country dialing code must be selected when number is entered |
Company Validation
| Rule | Constraint | Description |
|---|---|---|
| Minimum Length | 2 characters | Company name must be at least 2 characters |
| Maximum Length | Configurable | Maximum company name length |
| Must Contain Letter | At least 1 letter | Company name must include a letter |
| Invalid Characters | Check applied | Certain special characters are not allowed |
Address & Location Validation
| Rule | Constraint | Description |
|---|---|---|
| Address Min | 5 characters | Address must be at least 5 characters |
| Address Max | Configurable | Maximum address length |
| Pincode | Numeric only | Only digits allowed; exact length or max digits enforced |
| Latitude | Must be number, -90 to 90 | Valid decimal degree latitude with max length check |
| Longitude | Must be number, -180 to 180 | Valid decimal degree longitude with max length check |
Financial Validation
| Rule | Constraint | Description |
|---|---|---|
| Credits | Required, must be number, max digits | Credit values must be numeric with digit limit |
| URL | Valid URL format | Must be a properly formatted URL |
| Amount | Required, max length, valid format, positive | e.g., 100.00 — must be a positive decimal number |
| Reference | Max length | Payment reference with maximum character limit |
Support Ticket Validation
| Rule | Constraint | Description |
|---|---|---|
| Title Min | Minimum characters | Ticket title minimum length |
| Title Max | Maximum characters | Ticket title maximum length |
| Message Min | Minimum characters | Ticket message minimum length |
| Message Max | Maximum characters | Ticket message maximum length |
| Meaningful Text | Content check | Message must contain meaningful text (not just spaces or symbols) |
Landmark Validation
| Rule | Constraint | Description |
|---|---|---|
| Name Min | 2 characters | Landmark name minimum length |
| Name Max | Configurable | Landmark name maximum length |
| Description Max | Configurable | Description maximum length |
| Radius | Must be number, positive, max meters | Circle geofence radius constraint |
| Tolerance | Must be number, positive, max meters, 1-max range | Line/polygon geofence tolerance buffer |
Device & SIM Validation
| Field | Constraint | Description |
|---|---|---|
| IMEI | Required, 5-20 digits | International Mobile Equipment Identity number |
| SIM Number | Minimum 5 digits | SIM card number identifier |
| IMSI | 5-20 digits | International Mobile Subscriber Identity |
| ICCID | 10-25 digits | Integrated Circuit Card Identifier |
File Upload Validation
| Context | Max Size | Allowed Types |
|---|---|---|
| Settings Images (Favicon, Logo) | 2 MB | PNG, JPEG, WebP only |
| User Documents | 5 MB | PDF, Images (PNG, JPEG), DOC/DOCX |
| Admin Documents | 20 MB | PDF, Images (PNG, JPEG), DOC/DOCX |
| Support Attachments | 5 MB per file (max 5 files) | Common document and image formats |
Warning
All validation rules are enforced on both the frontend (for immediate user feedback) and the backend (for security). Never rely solely on client-side validation.
Tip
Configurable limits (marked as 'Configurable' in the constraint column) can be adjusted via platform settings or environment variables depending on deployment requirements.