"""
Properties for {{ name }} tool.

Central property definitions that can be shared across input, output,
and other exposure categories. Each property is defined once and can
belong to multiple categories.
"""

from iq_sdk.properties import (
    DataType,
    ExposureCategory,
    PrivacyClass,
    Property,
    PropertyRegistry,
    # StandardProperties,  # Pre-defined reusable properties
)

# Create the property registry for this tool
# Set default privacy class for all properties (can be overridden per property)
properties = PropertyRegistry(default_privacy=PrivacyClass.PUBLIC)

# ============================================================================
# STANDARD PROPERTIES (uncomment to use)
# ============================================================================
# Pre-defined properties from the SDK. All support custom categories:
#
# properties.add(StandardProperties.delay_queue(
#     categories=[ExposureCategory.INPUT, ExposureCategory.GENERAL],
# ))
#
# Available standard properties:
# - delay_queue(categories)           # short|default|long queue selection
# - environment(categories, enum_values)  # development|staging|production
# - privacy_level(categories)         # public|protected|secret
# - request_id(categories)            # Request tracking ID
# - correlation_id(categories)        # Distributed tracing
# - user_id(categories, privacy)      # User identifier (default: protected)
# - timestamp(name, categories)       # Event timestamp (custom name possible)
# - metadata(categories, custom_properties)  # Key-value metadata dict
# - tags(categories)                  # List of tags

# ============================================================================
# TOOL PROPERTIES
# ============================================================================
# Each property can belong to multiple categories. The Input/Output models
# are automatically generated from properties with those categories.
{% for prop in general_properties %}
properties.add(Property(
    name="{{ prop.name }}",
    data_type=DataType.{{ prop.data_type | datatype_enum }},
    label="{{ prop.label }}",
    {% if prop.description %}description="{{ prop.description }}",{% endif %}
    categories=[ExposureCategory.GENERAL{% if prop.name in shared_properties %}{% for cat in shared_properties[prop.name] %}, ExposureCategory.{{ cat }}{% endfor %}{% endif %}],
    required={{ prop.required }},
    {% if prop.default is not none %}default={{ prop.default | repr }},{% endif %}
))
{% endfor %}
{% for prop in input_properties %}
{% if prop.name not in shared_properties %}
properties.add(Property(
    name="{{ prop.name }}",
    data_type=DataType.{{ prop.data_type | datatype_enum }},
    label="{{ prop.label }}",
    {% if prop.description %}description="{{ prop.description }}",{% endif %}
    categories=[ExposureCategory.INPUT],
    required={{ prop.required }},
    {% if prop.default is not none %}default={{ prop.default | repr }},{% endif %}
))
{% endif %}
{% endfor %}
{% for prop in output_properties %}
{% if prop.name not in shared_properties %}
properties.add(Property(
    name="{{ prop.name }}",
    data_type=DataType.{{ prop.data_type | datatype_enum }},
    label="{{ prop.label }}",
    {% if prop.description %}description="{{ prop.description }}",{% endif %}
    categories=[ExposureCategory.OUTPUT],
    required={{ prop.required }},
    {% if prop.default is not none %}default={{ prop.default | repr }},{% endif %}
))
{% endif %}
{% endfor %}
{% if not general_properties and not input_properties and not output_properties %}
# Example property with multiple categories:
#
# properties.add(Property(
#     name="request_id",
#     data_type=DataType.STRING,
#     label="Request ID",
#     description="Unique request identifier",
#     categories=[ExposureCategory.INPUT, ExposureCategory.OUTPUT],
#     required=False,
# ))
#
# properties.add(Property(
#     name="data",
#     data_type=DataType.STRING,
#     label="Input Data",
#     description="The data to process",
#     categories=[ExposureCategory.INPUT],
#     required=True,
# ))
#
# properties.add(Property(
#     name="result",
#     data_type=DataType.STRING,
#     label="Result",
#     description="Processing result",
#     categories=[ExposureCategory.OUTPUT],
#     required=True,
# ))
{% endif %}
