feat(5.19): auto-send toggle per cont + tinere manuala randuri (held)
Comutator accounts.auto_send_enabled per cont: Auto OFF (default) tine randurile
la ingestie (submissions.held=1), worker-ul (claim_one AND held=0) le sare pana la
eliberare umana (per rand/bulk/auto-release OFF->ON). Snapshot held prin chokepoint
unic held_for_account pe toate caile de ingestie (API, import, reresolve, reactivare).
- schema/migrare: coloana held + index partial idx_submissions_held; auto_send_enabled
- API: echo onest held+motiv (US-010), ruta /prezentari/{id}/trimite-acum
- web: toggle header, modal confirmare tipata, buton Trimite per rand + Trimite toate,
banner coada tinuta imbatranita (L.142), contor "In asteptare (manual)"
- worker: expire_held (US-008, inchide gaura retentie PII), metrics held gauges
- ops: tools/carantina_held + runbook rollback (R4)
Nota review (/code-review high): re-snapshot held lipseste pe caile repune/corectie
(requeue_submission, post_corectie, bulk-fix) — de aliniat separat cu create_prezentari.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,7 @@ from typing import Any
|
||||
from rapidfuzz import fuzz, process
|
||||
|
||||
from . import errors as err_mod
|
||||
from .accounts import held_for_account
|
||||
from .nomenclator_seed import FALLBACK_NOMENCLATOR
|
||||
from .validation import validate_prezentare
|
||||
|
||||
@@ -891,10 +892,14 @@ def reresolve_account(conn, account_id: int | None, batch_id: int | None = None)
|
||||
)
|
||||
stats["needs_data"] += 1
|
||||
else:
|
||||
# PRD 5.19 US-002: re-snapshot `held` din comutatorul contului la trecerea
|
||||
# needs_mapping -> queued (chokepoint held_for_account, `acct` deja normalizat
|
||||
# prin account_or_default la intrarea in reresolve_account). Altfel un rand
|
||||
# deblocat din needs_mapping ar pleca automat desi contul e Auto OFF (R2).
|
||||
conn.execute(
|
||||
"UPDATE submissions SET status='queued', payload_json=?, rar_error=NULL, "
|
||||
"retry_count=0, next_attempt_at=NULL, updated_at=datetime('now') WHERE id=?",
|
||||
(payload_json, r["id"]),
|
||||
"retry_count=0, next_attempt_at=NULL, held=?, updated_at=datetime('now') WHERE id=?",
|
||||
(payload_json, held_for_account(conn, acct), r["id"]),
|
||||
)
|
||||
stats["requeued"] += 1
|
||||
return stats
|
||||
|
||||
Reference in New Issue
Block a user