feat(awooop): surface telegram source ref gaps
This commit is contained in:
@@ -109,6 +109,8 @@ class CallbackReplyAuditSummary(BaseModel):
|
||||
outbound_source_envelope_total: int
|
||||
outbound_source_refs_total: int
|
||||
outbound_incident_ref_total: int
|
||||
outbound_reply_markup_total: int = 0
|
||||
outbound_reply_markup_missing_incident_ref_total: int = 0
|
||||
outbound_failed_total: int
|
||||
callback_total: int
|
||||
callback_sent_total: int
|
||||
|
||||
@@ -487,6 +487,16 @@ async def _fetch_callback_reply_audit_summary(
|
||||
'[]'::jsonb
|
||||
) <> '[]'::jsonb
|
||||
) AS outbound_incident_ref_total,
|
||||
COUNT(*) FILTER (
|
||||
WHERE source_envelope #>> '{reply_markup,present}' = 'true'
|
||||
) AS outbound_reply_markup_total,
|
||||
COUNT(*) FILTER (
|
||||
WHERE source_envelope #>> '{reply_markup,present}' = 'true'
|
||||
AND COALESCE(
|
||||
source_envelope #> '{source_refs,incident_ids}',
|
||||
'[]'::jsonb
|
||||
) = '[]'::jsonb
|
||||
) AS outbound_reply_markup_missing_incident_ref_total,
|
||||
COUNT(*) FILTER (
|
||||
WHERE send_status = 'failed'
|
||||
) AS outbound_failed_total,
|
||||
@@ -607,6 +617,12 @@ def _callback_reply_audit_summary_from_row(
|
||||
row.get("outbound_source_refs_total")
|
||||
),
|
||||
"outbound_incident_ref_total": outbound_incident_refs,
|
||||
"outbound_reply_markup_total": _safe_int(
|
||||
row.get("outbound_reply_markup_total")
|
||||
),
|
||||
"outbound_reply_markup_missing_incident_ref_total": _safe_int(
|
||||
row.get("outbound_reply_markup_missing_incident_ref_total")
|
||||
),
|
||||
"outbound_failed_total": _safe_int(row.get("outbound_failed_total")),
|
||||
"callback_total": callback_total,
|
||||
"callback_sent_total": _safe_int(row.get("callback_sent_total")),
|
||||
|
||||
Reference in New Issue
Block a user