{# One snapshot-import report card (Bootstrap styled). Context: `imp` (SnapshotImport row), `imported_id` (highlight the just-completed import). #}
Imported Import report #{{ imp.id }} {% if imp.source_machine_id %} from machine {{ imp.source_machine_id[:8] }} {% endif %}
{{ imp.created_at.strftime('%Y-%m-%d %H:%M') if imp.created_at else '' }}
{% if imp.counts %}
Summary
{% for entity, c in imp.counts.items() %} {% endfor %}
Entity Inserted Updated Unchanged
{{ entity.replace('_', ' ') }} {{ c.inserted }} {{ c.updated }} {{ c.unchanged }}
{% endif %} {% set ns = namespace(total=0) %} {% for entity, rows in (imp.overwrites or {}).items() %}{% set ns.total = ns.total + rows|length %}{% endfor %} {% if ns.total %}
Overwritten local records ({{ ns.total }})
{% for entity, rows in imp.overwrites.items() %} {% if rows %}
{{ entity.replace('_', ' ') }}
{% for row in rows %} {% for field, change in row.fields.items() %} {% endfor %} {% endfor %}
Record Field Local (overwritten) Incoming
{{ row.id or row.uuid or row.key }} {{ field }} {{ change.local if change.local is not none else '—' }} {{ change.incoming if change.incoming is not none else '—' }}
{% endif %} {% endfor %}
{% else %}

No local records were overwritten.

{% endif %}

Per-transaction category/tag changes are also recorded in the rules History (action: import).