# Validation predicate macros

{%- macro min_length(name, doc, min) %}
  {{ name }} | doc "{{ doc }} (minimum {{ min }} characters)" | std.string.length.min {{ min }} : String
{%- endmacro %}

{%- macro max_length(name, doc, max) %}
  {{ name }} | doc "{{ doc }} (maximum {{ max }} characters)" | std.string.length.max {{ max }} : String
{%- endmacro %}

{%- macro between_range(name, doc, min, max) %}
  {{ name }} | doc "{{ doc }} (between {{ min }} and {{ max }})" | std.number.between {{ min }} {{ max }} : Number
{%- endmacro %}

{%- macro greater_than(name, doc, min) %}
  {{ name }} | doc "{{ doc }} (greater than {{ min }})" | std.number.greater_than {{ min }} : Number
{%- endmacro %}

{%- macro less_than(name, doc, max) %}
  {{ name }} | doc "{{ doc }} (less than {{ max }})" | std.number.less_than {{ max }} : Number
{%- endmacro %}
