Implement governed hybrid campaign delivery
This commit is contained in:
@@ -27,6 +27,7 @@ from govoplan_campaign.backend.db.models import (
|
||||
CampaignMessageActionAttempt,
|
||||
ImapAppendAttempt,
|
||||
PostboxDeliveryAttempt,
|
||||
PrintOutputAttempt,
|
||||
SendAttempt,
|
||||
)
|
||||
from govoplan_campaign.backend.integrations import postbox_integration
|
||||
@@ -397,6 +398,12 @@ def get_job_detail(
|
||||
),
|
||||
label="Postbox attempts for this campaign job",
|
||||
)
|
||||
print_attempts = _job_attempt_rows(
|
||||
session.query(PrintOutputAttempt)
|
||||
.filter(PrintOutputAttempt.job_id == job.id)
|
||||
.order_by(PrintOutputAttempt.attempt_number.asc()),
|
||||
label="Printable output attempts for this campaign job",
|
||||
)
|
||||
message_actions = _job_attempt_rows(
|
||||
session.query(CampaignMessageAction)
|
||||
.filter(CampaignMessageAction.job_id == job.id)
|
||||
@@ -419,9 +426,10 @@ def get_job_detail(
|
||||
attempts=_job_attempts_payload(
|
||||
send_attempts,
|
||||
imap_attempts,
|
||||
postbox_attempts,
|
||||
message_actions,
|
||||
message_action_attempts,
|
||||
postbox_attempts=postbox_attempts,
|
||||
print_attempts=print_attempts,
|
||||
message_actions=message_actions,
|
||||
message_action_attempts=message_action_attempts,
|
||||
postbox_receipts=_postbox_receipts_for_attempts(
|
||||
session,
|
||||
tenant_id=principal.tenant_id,
|
||||
@@ -476,6 +484,12 @@ def get_job_diagnostics(
|
||||
),
|
||||
label="Postbox diagnostics for this campaign job",
|
||||
)
|
||||
print_attempts = _job_attempt_rows(
|
||||
session.query(PrintOutputAttempt)
|
||||
.filter(PrintOutputAttempt.job_id == job.id)
|
||||
.order_by(PrintOutputAttempt.attempt_number.asc()),
|
||||
label="Printable output diagnostics for this campaign job",
|
||||
)
|
||||
message_actions = _job_attempt_rows(
|
||||
session.query(CampaignMessageAction)
|
||||
.filter(CampaignMessageAction.job_id == job.id)
|
||||
@@ -497,9 +511,10 @@ def get_job_diagnostics(
|
||||
job,
|
||||
send_attempts,
|
||||
imap_attempts,
|
||||
postbox_attempts,
|
||||
message_actions,
|
||||
message_action_attempts,
|
||||
postbox_attempts=postbox_attempts,
|
||||
print_attempts=print_attempts,
|
||||
message_actions=message_actions,
|
||||
message_action_attempts=message_action_attempts,
|
||||
postbox_receipts=_postbox_receipts_for_attempts(
|
||||
session,
|
||||
tenant_id=principal.tenant_id,
|
||||
|
||||
Reference in New Issue
Block a user