brand: remove all poona references and standardize on XYZ Hospital

This commit is contained in:
Antigravity
2026-11-18 18:27:07 +05:30
parent 5740e9281c
commit d7ee2827db
61 changed files with 273 additions and 272 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
# Assumptions Log — Poona Hospital AMS
# Assumptions Log — XYZ 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.
@@ -52,7 +52,7 @@ Items marked "to be confirmed" or left flexible in the proposal are recorded her
28. **Admin Reset Password Interface (Task 5)**: `frontend/src/api/users.ts` and `frontend/src/pages/MastersPage.tsx` expose an administrator password reset modal for users with role `system_admin`. The dialog features password masking toggles, client-side mismatch validation (`Passwords do not match`), universal password policy helper instructions, and displays backend 422 validation errors inline. Successful resets trigger a notification toast and close the modal without affecting the active administrator session.
29. **Department User Scoping & Empty Scope Resolution (Task 6)**: `backend/app/services/scoping.py` implements `resolve_department_scope(user, requested_dept_id)`. Non-department roles are unconstrained and may optionally filter by `requested_dept_id`. Assigned `department_user` accounts are strictly bound to `user.department_id`, ignoring any client-requested department parameter. Unassigned `department_user` accounts (`department_id=None`) resolve to `is_empty=True`, immediately returning 0 counters on Dashboard summary, empty results on global search, and empty row lists across all accessible report endpoints without running hospital-wide queries. Report key aliases are registered to support both canonical paths and audit identifiers (e.g., `equipment-inventory`, `condemned-equipment`, `pm-schedule`).
30. **Token Versioning & Session Invalidation (Task 7)**: A `token_version` integer column (default 0, not null) is added to `users` and reconciled automatically via `run_sqlite_migrations`. Access tokens encode the user's `token_version` in claim `"tv"`. `get_current_user` rejects tokens with mismatched `"tv"` with HTTP 401 (`Token has been invalidated. Please log in again.`). Password changes and administrator password resets increment `user.token_version`, invalidating previous tokens. `POST /api/auth/change-password` returns a renewed access token, and `ChangePasswordModal.tsx` stores the new token in the active auth store to keep the user's session active without re-login.
31. **Delivery Cleanliness, Line Endings & Packaging (Task 8)**: `.gitattributes` enforces standard LF line endings across the repository (`* text=auto eol=lf`). `.gitignore` excludes all SQLite databases (`*.db`), backups, volatile uploads, frontend dist artifacts, and build info files. The `make package` target generates `../poona-ams-delivery.zip` using `git archive` to ensure zero uncommitted, ignored, or temporary files leak into handoff archives.
31. **Delivery Cleanliness, Line Endings & Packaging (Task 8)**: `.gitattributes` enforces standard LF line endings across the repository (`* text=auto eol=lf`). `.gitignore` excludes all SQLite databases (`*.db`), backups, volatile uploads, frontend dist artifacts, and build info files. The `make package` target generates `../xyz-ams-delivery.zip` using `git archive` to ensure zero uncommitted, ignored, or temporary files leak into handoff archives.
32. **Cost Fields & Role-Based Stripping (AI Task 1)**: The fields `purchase_value`, `monthly_rent`, `contract_value`, `cost_per_visit`, `repair_cost`, and `spare_cost_estimate` are classified as cost fields. For `department_user`, these keys are completely stripped from JSON responses across `/api/assets`, `/api/contracts`, `/api/pm/schedules`, and `/api/complaints` via `maybe_strip_costs_response`. For contract bulk imports, both the canonical `contract_value` header and legacy `cost` alias are accepted for backward compatibility. `settings_service` supports a typed `float` setting type for `default_salvage_pct` (0–50) and `replacement_review_ratio` (0.05–2.0).
33. **AMC/CMC Auto-Tagging & Outsourced PM Auto-Fill (AI Task 2)**: Coverage precedence is strictly `active warranty > active CMC > active AMC > active OTHER contract > out_of_contract` where active means `start_date <= on_date <= end_date` and `is_superseded == False`. When registering a complaint, coverage is snapshotted as of `effective_today(db)` into `coverage_tag`, `coverage_contract_id`, and `coverage_provider_id` so historical registration coverage remains immutable even after contracts expire, while `coverage_now` always reflects live coverage. Creating an outsourced PM schedule without `provider_id`/`contract_id` auto-fills them from the asset's highest-priority active AMC/CMC contract (CMC over AMC); if none exists, the schedule is still created with empty provider/contract and `"no_active_contract": true` warning (replacing the legacy 422 rejection).
34. **Metrics Engine Formulas & Edge Cases (AI Task 3)**: