"""Custom validators for application data."""

import re


def validate_nigerian_phone(phone: str) -> bool:
    """Validate Nigerian phone number format."""
    # Nigerian phone numbers: 080, 081, 070, 090, 091, etc.
    pattern = r"^(0|234)?[789][01]\d{8}$"
    return bool(re.match(pattern, phone.replace(" ", "").replace("-", "")))


def validate_nin(nin: str) -> bool:
    """Validate NIN format (11 digits)."""
    return len(nin) == 11 and nin.isdigit()


def validate_waec_number(waec_number: str) -> bool:
    """Validate WAEC examination number format."""
    # WAEC numbers are typically 8-10 alphanumeric characters
    return len(waec_number) >= 8 and len(waec_number) <= 10
