Product EngineeringFeaturesCritical CalloutBackend

Overview

Backend implementation overview for Bill-wise Critical Callout in crelio-app.

šŸ‘¤ Sachin SharmašŸ“… Updated: Apr 29, 2026šŸ·ļø featurešŸ·ļø backendšŸ·ļø operations

Bill-wise Critical Callout — Backend

All server-side logic lives in crelio-app. The feature adds an order-level dimension to the existing report-level callout — a new FK on CriticalCallout, a new enum value, a bulk orchestrator, and three API endpoints.


What this section covers

PageCovers
Data ModelMigration 0055, CriticalValuesEnum, CriticalCallout model and save_critical_callout factory
CriticalReport ProxyCriticalReport proxy — parameter evaluation, email, single-report notify, ES sync
Bulk ManagerBulkCriticalCalloutManager — order-wise callout orchestration, draft/done state transitions, batch data fetch
API ReferenceThree endpoints — fetch by bill, fetch logs, post callout — and the serializer
ES Sync & Activity LogElasticsearch sync strategy and activity log structure

Architecture


Key files

FileRole
report/migrations/0055_criticalcallout_bill_and_more.pySchema changes — bill FK, nullable lab_report, new enum value
report/models/lab_report_relation.pyCriticalValuesEnum, LabReportRelation.criticalValues field
report/models/critical_callout.pyCriticalCallout model and save_critical_callout factory
report/proxies/critical_reports.pyCriticalReport proxy — parameter eval, email, notify, after_save
operation/views/bulk_critical_callout_manager.pyBulkCriticalCalloutManager — order-wise orchestration
report/views/critical_callout.pyFetchCriticalRecordsByBillView, FetchCriticalNotificationLogsBulkView
operation/views/critical_callout.pyCriticalCalloutView — audit record fetch
report/serializers/custom/lrr_custom_serializer.pyLabReportRelationAllTestSerializer
finance/views/bill_split_manager.pyBillSplitManager.sync_lab_reports() — ES sync
templates/communication/critical_notification.jinjaEmail template

On this page