All files / src/validation messages.ts

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400                                                                500x                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
/**
 * Centralized Validation Messages
 *
 * This module provides a single source of truth for all validation error messages
 * used throughout the application. Import these constants instead of hardcoding
 * validation messages to ensure consistency.
 *
 * @module validation/messages
 *
 * @example
 * ```typescript
 * // Using with field validators (automatic - already configured as defaults)
 * import { createEmailValidator, createCountryValidator } from "@validation/fields";
 *
 * const schema = Yup.object({
 *   email: createEmailValidator({ required: true }), // Uses VALIDATION_MESSAGES.INVALID_EMAIL by default
 *   country: createCountryValidator({ required: true }), // Uses VALIDATION_MESSAGES.COUNTRY_REQUIRED by default
 * });
 *
 * // Using directly in custom validators
 * import { VALIDATION_MESSAGES } from "@validation/messages";
 *
 * const customSchema = {
 *   customField: Yup.string().required(VALIDATION_MESSAGES.REQUIRED),
 *   address: Yup.string().required(VALIDATION_MESSAGES.ADDRESS_REQUIRED),
 * };
 * ```
 */
 
/**
 * Common validation error messages
 */
export const VALIDATION_MESSAGES = {
  // ============================================================================
  // GENERIC MESSAGES
  // ============================================================================
  /** Generic required field message */
  REQUIRED: "This field is required",
  /** Short version: Required */
  REQUIRED_SHORT: "Required",
  /** Short version: is required */
  REQUIRED_SHORT2: "is required",
 
  // ============================================================================
  // EMAIL MESSAGES
  // ============================================================================
  /** Email is required */
  EMAIL_REQUIRED: "Email is required",
  /** Enter account holder email */
  ACCOUNT_HOLDER_EMAIL_REQUIRED: "Enter account holder email",
  /** Email list is required */
  EMAIL_LIST_REQUIRED: "Email list is required",
  /** Invalid email format - polite version */
  INVALID_EMAIL: "Please enter a valid email",
  /** Invalid email format - short version */
  INVALID_EMAIL_SHORT: "Invalid email",
  /** Invalid email format - detailed version */
  INVALID_EMAIL_DETAILED: "Please provide a valid email",
  /** Disposable or unreachable email not allowed */
  INVALID_DISPOSABLE_EMAIL:
    "Please provide a valid, verified email address. Disposable or unreachable addresses are not accepted.",
 
  // ============================================================================
  // DATE MESSAGES
  // ============================================================================
  /** Date is required */
  DATE_REQUIRED: "Date is required",
  /** Invalid date format - short version */
  INVALID_DATE: "Enter a valid date",
  /** Invalid date format - polite version */
  INVALID_DATE_POLITE: "Please provide a valid date",
  /** Invalid date format - short version */
  INVALID_DATE_SHORT: "Invalid date",
  /** Future date not allowed */
  FUTURE_DATE_NOT_ALLOWED: "Future date not allowed",
  /** Date beyond acceptable range */
  DATE_TOO_OLD: "Date is beyond acceptable range",
 
  // ============================================================================
  // ADDRESS FIELD MESSAGES
  // ============================================================================
  /** Address/Street is required */
  ADDRESS_REQUIRED: "Address is required",
  /** Street is required */
  STREET_REQUIRED: "Street is required",
  /** Line 1 is required */
  LINE1_REQUIRED: "Line 1 is required",
  /** City is required */
  CITY_REQUIRED: "City is required",
  /** City has max Length */
  CITY_MAX_LENGTH: "City can not contain more than {{max}} characters",
  /** State is required */
  STATE_REQUIRED: "State is required",
  /** Province is required (for non-US addresses) */
  PROVINCE_REQUIRED: "Province is required",
  /** ZIP code is required */
  ZIP_REQUIRED: "ZIP code is required",
  /** ZIP code is required - alternative */
  ZIP_POSTAL_REQUIRED: "ZIP / Postal code is required",
  /** Country is required */
  COUNTRY_REQUIRED: "Country is required",
 
  /** Invalid country format - polite version */
  INVALID_COUNTRY: "Please select a valid country",
  /** Invalid country format - short version */
  INVALID_COUNTRY_SHORT: "Invalid country",
 
  /** Invalid state format - polite version */
  INVALID_STATE: "Please enter a valid state",
  /** Invalid state format - short version */
  INVALID_STATE_SHORT: "Invalid state",
 
  /** Invalid US ZIP code - polite version */
  INVALID_US_ZIP: "Please enter a valid US ZIP code",
  /** Invalid US ZIP code - short version */
  INVALID_ZIP_SHORT: "Invalid ZIP format",
 
  /** Invalid postal code - polite version */
  INVALID_POSTAL_CODE: "Please enter a valid postal code",
  /** Invalid postal code - short version */
  INVALID_POSTAL_CODE_SHORT: "Invalid postal code format",
 
  /** Invalid Zip Code - polite version */
  INVALID_ZIP_CODE: "Please input a valid zip code",
 
  /** PO Box not allowed */
  PO_BOX_NOT_ALLOWED: "PO Boxes or PMBs are not allowed",
 
  // ============================================================================
  // PHONE MESSAGES
  // ============================================================================
  /** Phone number is required */
  PHONE_REQUIRED: "Phone number is required",
  /** Invalid phone number - polite version */
  INVALID_PHONE: "Please enter a valid phone number",
  /** Invalid phone number - short version */
  INVALID_PHONE_SHORT: "Invalid phone number",
 
  // ============================================================================
  // BANK ACCOUNT MESSAGES
  // ============================================================================
  /** Routing number is required */
  ROUTING_NUMBER_REQUIRED: "Routing number is required",
  /** Invalid routing number - polite version */
  INVALID_ROUTING_NUMBER: "Please enter a valid routing number",
  /** Invalid routing number - short version */
  INVALID_ROUTING_NUMBER_SHORT: "Invalid routing number",
  /** Invalid routing number - detailed version */
  INVALID_ROUTING_NUMBER_DETAILED:
    "Please enter a valid 9-digit routing number",
 
  /** Account number is required */
  ACCOUNT_NUMBER_REQUIRED: "Account number is required",
  /** Invalid account number - polite version */
  INVALID_ACCOUNT_NUMBER: "Please enter a valid account number",
  /** Invalid account number - short version */
  INVALID_ACCOUNT_NUMBER_SHORT: "Invalid account number",
  /** Invalid account number - detailed version */
  INVALID_ACCOUNT_NUMBER_DETAILED:
    "Please enter a valid account number (6-17 digits)",
 
  // ============================================================================
  // NAME MESSAGES
  // ============================================================================
  /** First name is required */
  FIRST_NAME_REQUIRED: "First name is required",
  /** Last name is required */
  LAST_NAME_REQUIRED: "Last name is required",
  /** Name is required */
  NAME_REQUIRED: "Name is required",
  /** Merchant name is required */
  MERCHANT_NAME_REQUIRED: "Merchant name is required",
  /** Invalid name format - polite version */
  INVALID_NAME: "Please enter a valid name",
  /** Invalid name format - short version */
  INVALID_NAME_SHORT: "Invalid name",
 
  // ============================================================================
  // URL MESSAGES
  // ============================================================================
  /** Website URL is required */
  URL_REQUIRED: "Website URL is required",
  /** Invalid URL format - polite version */
  INVALID_URL: "Please enter a valid URL",
  /** Invalid URL format - short version */
  INVALID_URL_SHORT: "Invalid URL",
 
  // ============================================================================
  // PASSWORD MESSAGES
  // ============================================================================
  /** Password is required */
  PASSWORD_REQUIRED: "Password is required",
  /** Current password is required */
  CURRENT_PASSWORD_REQUIRED: "Current password is mandatory",
  /** Confirm password is required */
  CONFIRM_PASSWORD_REQUIRED: "Confirm password is required",
  /** Invalid password */
  INVALID_PASSWORD: "Invalid password",
 
  // ============================================================================
  // BUSINESS INFORMATION MESSAGES
  // ============================================================================
  /** Business type is required */
  BUSINESS_TYPE_REQUIRED: "Business type is required",
  /** Business legal name is required */
  BUSINESS_LEGAL_NAME_REQUIRED: "Business legal name is required",
  /** Business ownership type is required */
  BUSINESS_OWNERSHIP_TYPE_REQUIRED: "Business ownership type is required",
  /** Business name is required */
  BUSINESS_NAME_REQUIRED: "Business name is required",
  /** Date business opened is required */
  DATE_BUSINESS_OPENED_REQUIRED: "Date business opened is required",
  /** Billing descriptor is required */
  BILLING_DESCRIPTOR_REQUIRED: "Billing descriptor is required",
  /** High ticket amount is required */
  HIGH_TICKET_AMOUNT_REQUIRED: "High ticket amount is required",
 
  // ============================================================================
  // TAX/LEGAL MESSAGES
  // ============================================================================
  /** TIN type is required */
  TIN_TYPE_REQUIRED: "TIN type is required",
  /** Invalid EIN format */
  INVALID_EIN: "Please enter a valid EIN",
  /** Invalid EIN format - detailed */
  INVALID_EIN_FORMAT: "Invalid format. Format should be 12-3456789",
  /** Passport number is required */
  PASSPORT_NUMBER_REQUIRED: "Passport number is required",
  /** National ID is required */
  NATIONAL_ID_REQUIRED: "National ID is required",
  /** Document type is required */
  DOCUMENT_TYPE_REQUIRED: "Document type is required",
  /** Document number is required */
  DOCUMENT_NUMBER_REQUIRED: "Document number is required",
 
  // ============================================================================
  // AGREEMENT/TERMS MESSAGES
  // ============================================================================
  /** Agree to terms and conditions is required */
  TERMS_REQUIRED: "Agree to terms and conditions is required",
  /** Agreement is required */
  AGREEMENT_REQUIRED: "Agreement is required",
  /** Refund policy is required */
  REFUND_POLICY_REQUIRED: "Refund Policy is required",
  /** Terms must be accepted */
  TERMS_MUST_BE_ACCEPTED: "The terms and conditions must be accepted.",
 
  // ============================================================================
  // OWNERSHIP/CITIZENSHIP MESSAGES
  // ============================================================================
  /** Ownership is required */
  OWNERSHIP_REQUIRED: "Ownership is required",
  /** Ownership percentage is required */
  OWNERSHIP_PERCENTAGE_REQUIRED: "Ownership percentage is required",
  /** Ownership cannot be decimal */
  OWNERSHIP_NO_DECIMAL: "Ownership can't be a decimal number",
  /** Citizenship is required */
  CITIZENSHIP_REQUIRED: "Citizenship is required",
  /** Country of citizenship is required */
  COUNTRY_OF_CITIZENSHIP_REQUIRED: "Country of Citizenship is required",
  /** Country of residence is required */
  COUNTRY_OF_RESIDENCE_REQUIRED: "Country of Residence is required",
 
  // ============================================================================
  // DATE/TIME ADVANCED MESSAGES
  // ============================================================================
  /** Starting date is required */
  START_DATE_REQUIRED: "Start date is required",
  /** Starting date is required - alternative */
  STARTING_DATE_REQUIRED: "A starting date is required",
  /** End date is required */
  END_DATE_REQUIRED: "End date is required",
  /** Provide valid date */
  PROVIDE_VALID_DATE: "Provide a valid date",
  /** Date cannot be in past */
  DATE_CANNOT_BE_PAST: "The date cannot be in the past",
  /** Provide valid time */
  PROVIDE_VALID_TIME: "Provide a valid time",
  /** Invalid date format - alternative */
  INVALID_DATE_FORMAT: "Invalid date format",
  /** End date must be after start date */
  END_DATE_AFTER_START: "End date must be after or equal to the start date",
 
  // ============================================================================
  // CONTACT PHONE MESSAGES (ADDITIONAL)
  // ============================================================================
  /** Contact phone is required */
  CONTACT_PHONE_REQUIRED: "Contact Phone is required",
  /** A phone is required */
  A_PHONE_REQUIRED: "A phone is required",
 
  // ============================================================================
  // LOCATION/SERVICE AREA MESSAGES
  // ============================================================================
  /** At least one serviced country is required */
  SERVICED_COUNTRY_REQUIRED: "At least one serviced country is required",
  /** Add at least one country */
  ADD_COUNTRY_REQUIRED: "Add at least one country",
  /** Street address is required */
  STREET_ADDRESS_REQUIRED: "Street Address is required",
  /** Postal code is required - alternative */
  POSTAL_CODE_REQUIRED: "Postal code is required",
 
  // ============================================================================
  // FORM FIELD MESSAGES
  // ============================================================================
  /** Text is required */
  TEXT_REQUIRED: "Text is required",
  /** Link is required */
  LINK_REQUIRED: "Link is required",
  /** Link must start with https */
  LINK_HTTPS_REQUIRED: "Link must start with https://",
  /** Count is required */
  COUNT_REQUIRED: "Count is required",
  /** Location URL is required */
  LOCATION_URL_REQUIRED: "Location URL is required",
  /** Item is required */
  ITEM_REQUIRED: "Item is required",
  /** File name is required */
  FILE_NAME_REQUIRED: "File name is required",
  /** Time zone is required */
  TIMEZONE_REQUIRED: "Time zone is required",
  /** Version is required */
  VERSION_REQUIRED: "Version is required",
  /** Reason is required */
  REASON_REQUIRED: "Reason is required",
  /** Select a reason */
  SELECT_REASON: "Select a reason",
  /** Comment is required */
  COMMENT_REQUIRED: "Comment is required",
  /** Message is required */
  MESSAGE_REQUIRED: "A message is required",
  /** A name is required */
  A_NAME_REQUIRED: "A name is required",
  /** Choose an account */
  CHOOSE_ACCOUNT: "Choose an account",
  /** Please specify the provider */
  SPECIFY_PROVIDER: "Please specify the provider",
  /** Please select a processor */
  SELECT_PROCESSOR: "Please select a processor",
 
  // ============================================================================
  // VALIDATION ERROR MESSAGES
  // ============================================================================
  /** Invalid format - generic */
  INVALID_FORMAT: "Invalid format",
  /** Please enter a valid name */
  INVALID_NAME_ENTER: "Please enter a valid name",
  /** Please provide a valid name with minimum length */
  INVALID_NAME_MIN_LENGTH:
    "Please provide a valid name with at least 3 letters",
  /** Please provide a valid email - polite */
  PROVIDE_VALID_EMAIL: "Please provide a valid email",
  /** Provide email address - polite */
  PROVIDE_EMAIL: "Provide email address",
  /** Invalid email address */
  INVALID_EMAIL_ADDRESS: "Invalid email address",
  /** Invalid email in list */
  INVALID_EMAIL_LIST: "Invalid email address in the list",
  /** Please enter a valid version */
  INVALID_VERSION: "Please enter a valid version",
  /** Provide a valid value */
  PROVIDE_VALID_VALUE: "Provide a valid value",
  /** Range is invalid */
  INVALID_RANGE: "The range is invalid",
  /** Provide unique merchant name */
  UNIQUE_MERCHANT_NAME: "Provide unique merchant name",
  /** Minimum 4 characters required */
  MIN_LENGTH_4: "Minimum 4 characters required",
  /** Provide merchant name - polite */
  PROVIDE_MERCHANT_NAME: "Provide merchant name",
 
  // ============================================================================
  // TERMINATION MESSAGES
  // ============================================================================
  /** Previous processor name is required */
  PREVIOUS_PROCESSOR_REQUIRED:
    "Previous termination processor name is required",
  /** Termination reason is required */
  TERMINATION_REASON_REQUIRED: "Reason for Termination is required",
 
  // ============================================================================
  // PAYMENT/FINANCIAL MESSAGES
  // ============================================================================
  /** Annual revenue is required */
  ANNUAL_REVENUE_REQUIRED: "Annual revenue is required",
  /** Card number is required */
  CARD_NUMBER_REQUIRED: "Card number is required",
  /** Expiration date is required */
  EXPIRATION_DATE_REQUIRED: "Expiration date is required",
  /** CVV is required */
  CVV_REQUIRED: "CVV is required",
 
  // ============================================================================
  // MINIMUM RESERVE BPS AND ROLLING BPS MESSAGES
  // ============================================================================
  /** Value must be between 1 and 10,000 */
  MIN_MAX_RESERVE_BPS: "Value must be between 1 and 10,000",
} as const;