Separate validation logic from error messages
masterLIVR enforces a clean separation of concerns between the validation layer and the presentation layer. Instead of embedding human-readable strings directly in your validator configuration, you should use Error Codes (e.g., WRONG_EMAIL, TOO_SHORT).
This allows:
- Backend independence: The API returns codes, letting web, mobile, or third-party clients decide how to display them.
- Easy localization: Update translation files (e.g.,
es.json) without changing application code. - Client-specific formatting: Different clients can show different message styles for the same error code.