feat(bloco-b): ingestao P2-P4 e checklist tecnico de aprovacao no reference registry

This commit is contained in:
gti
2026-09-28 16:20:54 -03:00
parent cd44ae637b
commit cf5bb64d9b
7 changed files with 513 additions and 86 deletions
+33 -1
View File
@@ -24,10 +24,42 @@
</dd>
{% endif %}
</dl>
{% if r.checklist %}
<div class="technical-checklist" style="background:#f8f9fa; border:1px solid #e2e8f0; border-radius:6px; padding:12px; margin:12px 0;">
<h4 style="margin-top:0; margin-bottom:8px; font-size:14px; text-transform:uppercase; color:#475569;">Checklist Técnico de Aprovação (Sem Julgamento Fiscal Exigido)</h4>
<ul style="list-style:none; padding-left:0; margin-bottom:10px; font-size:13px; line-height:1.6;">
<li>
<span style="font-weight:bold; color:{{ 'green' if r.checklist.official_source.passed else 'red' }}">[{{ '✓' if r.checklist.official_source.passed else '✗' }}]</span>
<strong>1. Fonte Oficial:</strong> {{ r.checklist.official_source.provider }} · <a href="{{ r.checklist.official_source.url }}" target="_blank" rel="noopener">{{ r.checklist.official_source.url }}</a> · <em>{{ r.checklist.official_source.act }}</em>
</li>
<li>
<span style="font-weight:bold; color:{{ 'green' if r.checklist.integrity.passed else 'red' }}">[{{ '✓' if r.checklist.integrity.passed else '✗' }}]</span>
<strong>2. Hash SHA-256 e Tamanho:</strong> <code style="font-size:11px;">{{ r.checklist.integrity.sha256 }}</code> {% if r.checklist.integrity.file_size_bytes %}({{ r.checklist.integrity.file_size_bytes }} bytes){% endif %}
</li>
<li>
<span style="font-weight:bold; color:{{ 'green' if r.checklist.volume.passed else 'red' }}">[{{ '✓' if r.checklist.volume.passed else '✗' }}]</span>
<strong>3. Contagem de Linhas:</strong> {{ r.checklist.volume.record_count }} linhas registradas (esperado &ge; {{ r.checklist.volume.expected_minimum }})
</li>
<li>
<span style="font-weight:bold; color:{{ 'green' if r.checklist.no_parse_errors else 'red' }}">[{{ '✓' if r.checklist.no_parse_errors else '✗' }}]</span>
<strong>4. Erros de Parse:</strong> {{ 'Nenhum erro de parse (deterministico)' if r.checklist.no_parse_errors else 'Existem erros de parse no processamento!' }}
</li>
<li>
<span style="font-weight:bold; color:green">[✓]</span>
<strong>5. Amostra de 5 Consultas com Resultado Conhecido:</strong>
<ol style="margin-top:4px; margin-bottom:4px; padding-left:20px;">
{% for code, label in r.checklist.samples %}
<li><code>{{ code }}</code>: {{ label }}</li>
{% endfor %}
</ol>
</li>
</ul>
</div>
{% endif %}
{% if r.status == "DRAFT" and is_admin %}
<form method="post" action="/admin/reference-datasets/{{ r.id }}/decide" class="filters compact-filters">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
<button class="secondary" type="submit" name="action" value="approve" {% if r.parse_errors %}disabled title="corrija os erros de parse antes de aprovar"{% endif %}>Aprovar (vira vigente)</button>
<button class="secondary" type="submit" name="action" value="approve" {% if not r.checklist.ready_to_approve %}disabled title="Checklist técnico não satisfeito ou erros presentes"{% endif %}>Aprovar (vira vigente)</button>
<button class="secondary" type="submit" name="action" value="reject" onclick="return confirm('Rejeitar esta versão?')">Rejeitar</button>
</form>
{% endif %}