{% macro metadata_validation_report(validation_results) -%}
{% set results = validation_results.get('metadata_check', {}) %}
{% set spreadsheet_errors = results.get('spreadsheet_errors', []) %}
{% set json_errors = results.get('json_errors', []) %}
{% set has_errors = spreadsheet_errors or json_errors %}
{% if has_errors %}
{% set expand_icon = "▶" %}
{% set icon = "❌" %}
{% set row_class = "report-section fail collapsible" %}
{% else %}
{% set icon = "✔" %}
{% set row_class = "report-section pass" %}
{% endif %}
{{ expand_icon }} {{ icon }} Metadata validation check
{% if spreadsheet_errors %}
Full report: {{ results.get('spreadsheet_report_path', '') }}
Sheet | Row | Column | Description |
{% for error in spreadsheet_errors %}
{{ error.get('sheet') }} |
{{ error.get('row') }} |
{{ error.get('column') }} |
{{ error.get('description') }} |
{% endfor %}
{% endif %}
{% if json_errors %}
Full report: {{ results.get('json_report_path', '') }}
JSON Property | Error Description |
{% for error in json_errors %}
{{ error.get('property') }} |
{{ error.get('description') }} |
{% endfor %}
{% endif %}
{%- endmacro %}