Structura repo conform plan.md sect. 4, booteaza cu /healthz verde:
- app/main.py: FastAPI (lifespan init_db), /healthz (worker viu + last login + queue), /metrics
- app/api/v1: POST /v1/prezentari (enqueue + dedup idempotency UNIQUE), GET prezentari/{id}, nomenclator, mapari
- app/rar_client.py: client RAR real (login/JWT, nomenclator, postPrezentare, getFinalizate) cu User-Agent obligatoriu (fix WAF 403)
- app/worker: proces separat, claim atomic BEGIN IMMEDIATE, heartbeat, login+send (send dezactivat by default)
- app/web: dashboard Jinja2+HTMX (coada, banner alerta blocate, worker viu/mort, stari empty)
- app/db.py + schema.sql: SQLite WAL, tabele accounts/api_keys/operations_mapping/nomenclator_rar/submissions/worker_heartbeat
- app/idempotency.py + payload.py: hash continut canonic + builder payload (status FINALIZATA, fara tipPrestatie)
- Dockerfile + docker-compose.yml (api+worker, volum SQLite persistent, restart:always)
- tools/import_dbf.py: stub T5
Verificat live: login prin rar_client OK (token 259), nomenclator 18 coduri, worker heartbeat -> /healthz worker_alive=True.
Ramas: T3 validare Pydantic, T4 snapshot payload, T2 reconciliere/retry worker, T5 import DBF, auth API-key, middleware redactare creds, criptare PII.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
29 lines
1.2 KiB
HTML
29 lines
1.2 KiB
HTML
{% extends "base.html" %}
|
|
{% block content %}
|
|
|
|
<div class="card banner {% if not blocked %}hidden{% endif %}"
|
|
hx-get="/_fragments/banner" hx-trigger="every 15s" hx-swap="outerHTML">
|
|
<strong>Atentie:</strong> {{ blocked }} submission-uri blocate (error / needs_data / needs_mapping).
|
|
Plasa de siguranta pe pene RAR > 30h. Verifica coada mai jos.
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div style="display:flex; gap:24px; flex-wrap:wrap;">
|
|
<div><div class="muted">Worker</div><div class="{{ 's-sent' if worker_alive else 's-error' }}">
|
|
{{ 'viu' if worker_alive else 'mort' }}</div></div>
|
|
<div><div class="muted">Ultimul login RAR</div><div>{{ last_login or '—' }}</div></div>
|
|
<div><div class="muted">In coada</div><div>{{ counts.get('queued', 0) }}</div></div>
|
|
<div><div class="muted">Trimise</div><div class="s-sent">{{ counts.get('sent', 0) }}</div></div>
|
|
<div><div class="muted">Blocate</div><div class="{{ 's-error' if blocked else '' }}">{{ blocked }}</div></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<h2 style="font-size:14px; margin:0 0 12px;">Coada submissions</h2>
|
|
<div hx-get="/_fragments/submissions" hx-trigger="load, every 10s" hx-swap="innerHTML">
|
|
<div class="empty">se incarca…</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %}
|