fix(api): hide campaign operational internals
This commit is contained in:
@@ -20,6 +20,7 @@ from govoplan_campaign.backend.db.models import (
|
||||
SendAttempt,
|
||||
)
|
||||
from govoplan_campaign.backend.sending.execution import ExecutionSnapshot
|
||||
from govoplan_campaign.backend.response_security import public_campaign_payload, public_source_filename
|
||||
|
||||
|
||||
class CampaignReportError(RuntimeError):
|
||||
@@ -62,10 +63,10 @@ def _version_info(version: CampaignVersion | None) -> dict[str, Any] | None:
|
||||
"id": version.id,
|
||||
"version_number": version.version_number,
|
||||
"schema_version": version.schema_version,
|
||||
"source_filename": version.source_filename,
|
||||
"source_filename": public_source_filename(version.source_filename),
|
||||
"created_at": version.created_at.isoformat() if version.created_at else None,
|
||||
"validation_summary": version.validation_summary,
|
||||
"build_summary": version.build_summary,
|
||||
"validation_summary": public_campaign_payload(version.validation_summary),
|
||||
"build_summary": public_campaign_payload(version.build_summary),
|
||||
"execution_snapshot_hash": version.execution_snapshot_hash,
|
||||
"execution_snapshot_at": version.execution_snapshot_at.isoformat() if version.execution_snapshot_at else None,
|
||||
}
|
||||
@@ -323,8 +324,6 @@ def _job_evidence_row(
|
||||
"campaign_id": job.campaign_id,
|
||||
"campaign_version_id": job.campaign_version_id,
|
||||
"message_id_header": job.message_id_header,
|
||||
"eml_storage_key": job.eml_storage_key,
|
||||
"eml_local_path": job.eml_local_path,
|
||||
"from": _address_summary(recipients.get("from")),
|
||||
"to": _address_summary(recipients.get("to")),
|
||||
"cc": _address_summary(recipients.get("cc")),
|
||||
@@ -603,8 +602,6 @@ def generate_jobs_csv(
|
||||
"last_error",
|
||||
"eml_size_bytes",
|
||||
"eml_sha256",
|
||||
"eml_storage_key",
|
||||
"eml_local_path",
|
||||
"issues_count",
|
||||
"attachment_config_count",
|
||||
"matched_file_count",
|
||||
|
||||
Reference in New Issue
Block a user