# Contract definition macros for common validation patterns

{%- macro non_empty_string(name, doc) %}
  {{ name }} | doc "{{ doc }}" | std.string.NonEmpty : String
{%- endmacro %}

{%- macro email(name, doc) %}
  {{ name }} | doc "{{ doc }}" : String
{%- endmacro %}

{%- macro url(name, doc) %}
  {{ name }} | doc "{{ doc }}" : String
{%- endmacro %}

{%- macro port_number(name, doc) %}
  {{ name }} | doc "{{ doc }}" | std.number.between 1 65535 : Number
{%- endmacro %}

{%- macro percentage(name, doc) %}
  {{ name }} | doc "{{ doc }}" | std.number.between 0 100 : Number
{%- endmacro %}
