# Validation Rules Template
# Post-validation business rule checks
#
# Usage:
#   Validation rules check data AFTER Pydantic validation.
#   Useful for business rules that go beyond type checking.
#
# Available validations:
#   - min_length:              {threshold: N}
#   - max_length:              {threshold: N}
#   - greater_than_or_equal_to:{threshold: N}
#   - less_than_or_equal_to:   {threshold: N}
#   - only_allow:              {allowed_values: [a, b, c]}
#   - only_allow_if:           {condition_field: x, condition_value: y, allowed_values: [...]}
#   - non_empty_string:        null  (no params needed)
#   - is_positive:             null
#   - is_email:                null
#   - is_url:                  null
#   - is_alphanumeric:         null
#   - is_numeric_string:       null
#   - no_capital_characters:   null
#   - no_special_characters:   null
#   - matches_regex:           {pattern: "^[A-Z]{2}[0-9]{4}$"}

title: my_validation_rules
description: Business validation rules
version: "1.0.0"

rules:
  # String length validation
  id:
    min_length:
      threshold: 1
    max_length:
      threshold: 50

  name:
    non_empty_string: null
    max_length:
      threshold: 100

  # Enum-like validation
  status:
    only_allow:
      allowed_values:
        - active
        - inactive
        - pending

  # Numeric range validation
  count:
    greater_than_or_equal_to:
      threshold: 0

  amount:
    greater_than_or_equal_to:
      threshold: 0
    less_than_or_equal_to:
      threshold: 1000000

  # Email validation
  email:
    is_email: null

  # Regex pattern validation
  # code:
  #   matches_regex:
  #     pattern: "^[A-Z]{2}[0-9]{4}$"

  # Conditional validation
  # discount_rate:
  #   only_allow_if:
  #     condition_field: customer_type
  #     condition_value: premium
  #     allowed_values: [0.1, 0.15, 0.2]
