@kenniy/godeye-data-contracts
Version:
Enterprise-grade base repository architecture for GOD-EYE microservices with zero overhead and maximum code reuse
33 lines (32 loc) • 1.33 kB
TypeScript
/**
* Validation constants for unified validation patterns
* Replaces scattered validation rules with centralized patterns
*/
export declare const VALIDATION_PATTERNS: {
readonly UUID: RegExp;
readonly OBJECT_ID: RegExp;
readonly EMAIL: RegExp;
readonly PHONE: RegExp;
readonly NUMERIC: RegExp;
};
export declare const VALIDATION_MESSAGES: {
readonly INVALID_ID: "Invalid ID format provided";
readonly INVALID_UUID: "Invalid UUID format";
readonly INVALID_OBJECT_ID: "Invalid MongoDB ObjectId format";
readonly INVALID_EMAIL: "Invalid email format";
readonly INVALID_PHONE: "Invalid phone number format";
readonly REQUIRED_FIELD: "This field is required";
readonly INVALID_PAGINATION: "Invalid pagination parameters";
readonly INVALID_SEARCH: "Invalid search parameters";
readonly SEARCH_TOO_SHORT: "Search term is too short";
readonly SEARCH_TOO_LONG: "Search term is too long";
readonly INVALID_ENTITY_TYPE: "Invalid entity type provided";
readonly VALIDATION_FAILED: "Validation failed for one or more fields";
};
export declare const VALIDATION_DEFAULTS: {
readonly MIN_SEARCH_LENGTH: 2;
readonly MAX_SEARCH_LENGTH: 100;
readonly CASE_SENSITIVE_SEARCH: false;
readonly SEARCH_MODE: "contains";
readonly ALLOW_EMPTY_SEARCH: false;
};