phase-8: polish, global search, audit log, packaging, and demo docs
This commit is contained in:
@@ -37,18 +37,37 @@ make dev
|
||||
|
||||
### Run tests
|
||||
```bash
|
||||
make test
|
||||
# Or directly:
|
||||
# Backend
|
||||
cd backend
|
||||
.venv/Scripts/python -m pytest tests/ -v
|
||||
# Or via Make: make test
|
||||
|
||||
# Frontend (build + Vitest)
|
||||
cd frontend
|
||||
npm run build
|
||||
npm test
|
||||
```
|
||||
|
||||
### Seed demo data
|
||||
```bash
|
||||
cd backend
|
||||
.venv/Scripts/python -m app.seed.seed
|
||||
# Or via Make: make seed
|
||||
```
|
||||
|
||||
### Docker Compose (Production-style local container run)
|
||||
```bash
|
||||
cp .env.example .env
|
||||
docker compose up --build
|
||||
```
|
||||
- Frontend (Nginx + `/api` reverse proxy): http://localhost:5173
|
||||
- Backend API & Swagger docs: http://localhost:8000/docs
|
||||
- SQLite DB and uploads persist under `./backend/data` (mounted to `/app/data`).
|
||||
|
||||
## Documentation & Walkthroughs
|
||||
- [10-Minute Demo Script](docs/DEMO_SCRIPT.md)
|
||||
- [Acceptance Checklist (Proposal §10)](docs/ACCEPTANCE_CHECKLIST.md)
|
||||
|
||||
## Demo Accounts
|
||||
| Email | Password | Role |
|
||||
|---|---|---|
|
||||
@@ -58,11 +77,12 @@ cd backend
|
||||
| mgmt@poona.demo | Demo@123 | Management |
|
||||
| coord@poona.demo | Demo@123 | Coordinator |
|
||||
|
||||
## What exists now (Phase 7)
|
||||
- Complete SQLAlchemy 19-table data model across masters, assets, maintenance, complaints, operations, and system modules
|
||||
- JWT authentication (`/api/auth/login`, `/api/auth/me`), RBAC permission matrix for 5 roles, and Quick Demo Login
|
||||
- Admin Master Lists CRUD (`/masters`: Departments, Locations, Categories, Vendors, Users)
|
||||
## Implemented Application (Phases 0–8 Complete)
|
||||
- Complete SQLAlchemy 19-table data model across masters, assets, maintenance, complaints, operations, and system modules with performance indexes on foreign keys, status, and date columns
|
||||
- JWT authentication (`/api/auth/login`, `/api/auth/me`), sliding-window login rate limiter (`429 RATE_LIMITED`), RBAC permission matrix for 5 roles, and Quick Demo Login
|
||||
- Admin Master Lists CRUD (`/masters`: Departments, Locations, Categories, Vendors, Users) and Audit Log Viewer (`/audit-logs`, `system_admin` only with entity/user/action/date filters and JSON diff modal)
|
||||
- Typed System Settings (`/settings`) and TopBar "As of Date" Demo Clock (`POST /api/settings/demo-date`) + Admin `"Run alert check now"` (`POST /api/alerts/run`)
|
||||
- Live Global Quick Search in TopBar (`GET /api/search?q=`) returning grouped Assets & Complaints with `department_user` scoping
|
||||
- Asset Register (`/assets` & `/assets/:id`): full CRUD with duplicate asset code check (`409`), department scoping, coordinator field-level edit restrictions, 8-tab Asset Detail Overview, and audit logging
|
||||
- Breakdown & Complaint Register (`/complaints` & `/complaints/:id`): sequential complaint numbering, `AssetPicker` raise modal with multi-file attachments, response time & ongoing/milestone downtime calculations, assign/attend/restore/close/reopen workflow with asset status sync, event timeline, admin timestamp correction, and role-enforced technical/CE/spares section (`FORBIDDEN_TECHNICAL_FIELDS` 403 + read-only lock banner)
|
||||
- Preventive Maintenance (`/pm`): in-house & outsourced PM schedules (`/api/pm/schedules`), dynamic read-time `upcoming`/`due`/`overdue`/`completed`/`rescheduled` status & severity evaluation against `effective_today()`, KPI summary strip, Table View & 7-column Mon–Sun Month Calendar View, Complete (auto-advancing next cycle via `add_months`) and Reschedule workflows, plus Asset Detail PM tab actions
|
||||
@@ -77,10 +97,10 @@ cd backend
|
||||
- Reusable `AssetPicker` (`/api/assets/lookup`) with warranty/condemned status badges
|
||||
- Secure Document Attachments (`/api/attachments`: JPG/PNG/PDF validation with magic-byte check, 10 MB limit, authenticated preview/download, role-based upload/delete)
|
||||
- Idempotent deterministic seed script (`python -m app.seed.seed`) populating realistic hospital demo data
|
||||
- React + TypeScript frontend app shell with role-filtered sidebar, route guards, DataTable, and Tailwind CSS + shadcn/ui
|
||||
- Makefile for common tasks
|
||||
- Responsive React + TypeScript frontend app shell (mobile slide-over navigation, accessible `<ConfirmDialog />`, role-filtered sidebar, route guards, DataTable, Tailwind CSS + shadcn/ui)
|
||||
- Docker packaging (`docker-compose.yml`, `backend/Dockerfile`, `frontend/Dockerfile`, `frontend/nginx.conf`, `.env.example`) & `Makefile`
|
||||
|
||||
## Modules (all phases)
|
||||
## Modules (Phases 0–8 Complete)
|
||||
Phase 0: Scaffold | Phase 1: Auth & Masters | Phase 2: Assets | Phase 3: Complaints
|
||||
Phase 4: PM & Calibration | Phase 5: Contracts, Warranty, Insurance, Demo, Visits
|
||||
Phase 6: Notifications & Dashboard | Phase 7: Reports | Phase 8: Polish
|
||||
Phase 6: Notifications & Dashboard | Phase 7: Reports | Phase 8: Polish, Search, Audit Log, Packaging & Docs
|
||||
|
||||
Reference in New Issue
Block a user