# Assumptions Log — Poona Hospital AMS Items marked "to be confirmed" or left flexible in the proposal are recorded here along with the configurable defaults implemented in Phase 1. 1. **Contract Expiry Alert Thresholds**: Default alert lead time is `30` days (`contract_expiry_alert_days`), with critical (red) escalation at `7` days (`contract_critical_alert_days`). Both are admin-editable in Settings. 2. **Warranty & Insurance Expiry Lead Days**: Default alert window is `30` days prior to end date (`warranty_expiry_alert_days`, `insurance_expiry_alert_days`), configurable by System Admin. 3. **PM & Calibration Due Windows**: Planned PM and Calibration items transition from `upcoming` to `due` at `15` days before `due_date` / `planned_date` (`calibration_due_window_days`, `pm_due_window_days`), and become `overdue` once past the due date. Only `completed` (and `rescheduled` for PM) are persisted in the DB; `upcoming`/`due`/`overdue` are computed at read time against `effective_today()`. 4. **Complaint SLA & Escalation Thresholds**: Default target response/restoration SLA is `4` hours for `critical` priority (`critical_complaint_sla_hours`) and `24` hours for `non_critical` (`non_critical_complaint_sla_hours`), with unclosed critical complaints escalating after `24` hours (`escalation_open_complaint_hours`). 5. **Complaint Closure Remarks**: `require_closure_remarks` defaults to `true` so engineers must document closure notes before closing a breakdown call; configurable in Settings. 6. **Asset Code Format**: Asset codes follow `--<0001>` with default prefix `PHRC` (`asset_code_prefix`), e.g. `PHRC-ICU-0001`. 7. **Default PM Service Mode**: New PM schedules default to `in_house` (`default_pm_mode`, enum `in_house` | `outsourced`). 8. **Demo Equipment Return Alert**: Expected return alerts trigger `3` days before `expected_return_date` (`demo_return_alert_days`), configurable in Settings. 9. **Demo Clock (`demo_as_of_date`)**: System-wide `effective_today()` reads `demo_as_of_date` (`YYYY-MM-DD`) from Settings if non-empty; otherwise uses the real current date in `Asia/Kolkata`. 10. **Soft Deletion for Masters & Users**: Deleting departments, locations, categories, vendors, or users sets `is_active = False` rather than hard-deleting rows so historical asset/complaint/maintenance foreign keys remain intact. 11. **Password Hashing on Python 3.13**: `passlib==1.7.4` is incompatible with `bcrypt>=4.1` on Python 3.13 (`__about__` attribute removed / 72-byte wrap-check error), so `app/core/security.py` uses `bcrypt` (`bcrypt==5.0.0`) directly. ## Assumptions added post-Phase-8 12. **Permission Specifics**: `system_admin` and `biomedical` can create and edit full asset records (`coordinator` is restricted to updating `requires_calibration`, `insurance_applicable`, and `remarks`). Calibration frequency edits and plan approvals are restricted to `system_admin`, `management`, and `coordinator` (`biomedical` receives HTTP `403`). `department_user` is scoped to their assigned department (`ICU` in demo data) across assets, complaints, PM, calibration, contracts, notifications, dashboard, reports, and global search, whereas `system_admin`, `biomedical`, `management`, and `coordinator` view all departments hospital-wide. `management` and `coordinator` cannot raise complaints (enforced server-side with HTTP `403`). 13. **Critical Complaint Escalation & SLA Evaluation**: APScheduler runs `alerts.py` daily (default `06:00` in configured `TIMEZONE`) and raises `critical_complaint` notifications when open critical complaint age exceeds `escalation_open_complaint_hours` (default `24`h) or breaches `compute_sla_status` against `critical_complaint_sla_hours` (default `4`h) / `non_critical_complaint_sla_hours` (default `24`h). 14. **Insurance Drawer**: Insurance summary is surfaced via a read-only slide-over panel (`InsuranceDrawer`) from `AssetDetailPage`, `AssetPicker`, and `ComplaintDetailPage`; creating and editing policies is handled via modal dialogs on `/insurance` and the Asset Insurance tab. 15. **Demo-Only Features**: The TopBar **Demo Clock** (`demo_as_of_date`, admin-only date override for demonstrating expiry/overdue alerts and dynamic schedule transitions) and the deterministic seed loader (`python -m app.seed.seed`) exist specifically for demonstration and verification. 16. **Reopen Clears `restored_at`**: Reopening a closed breakdown complaint clears both `closed_at` and `restored_at` (`None`) on the complaint row so downtime resumes as ongoing until re-restored. 17. **Immediate Asset Return to Service**: When a breakdown complaint is restored or closed (and no other unrestored critical complaints exist on the asset), `Asset.status` transitions immediately to `in_service` rather than requiring an extra post-repair sign-off step. 18. **Code Prefixes (`complaint_no_prefix` & `asset_code_prefix`)**: Complaint numbers are auto-generated using `complaint_no_prefix` (default `CMP`, e.g. `CMP-2026-0001`; `BD-` or another prefix can be configured in Settings). Asset codes are entered manually to match physical hospital asset tags rather than auto-generated, so `asset_code_prefix` (default `PHRC`) acts as a configurable hospital label prefix shown in Settings and used for the bulk-import template sample code. 19. **Monthly Maintenance `Uptime %` Display**: The `monthly-maintenance` backend report aggregates uptime/downtime in minutes per department rather than returning per-asset `uptime_seconds`/`downtime_seconds`, so `Uptime %` (`uptime / (uptime + downtime) * 100`, 1 decimal place) is computed on the frontend in `ReportDetailPage.tsx` (falling back to `100 - downtime_pct`) and highlighted in the summary strip and table.