Skip to content

Add audit logging infrastructure (#6)#15

Open
Sakeeb91 wants to merge 21 commits intobos-com:mainfrom
Sakeeb91:issue-7-document-management
Open

Add audit logging infrastructure (#6)#15
Sakeeb91 wants to merge 21 commits intobos-com:mainfrom
Sakeeb91:issue-7-document-management

Conversation

@Sakeeb91
Copy link
Contributor

@Sakeeb91 Sakeeb91 commented Oct 12, 2025

🔍 Feature: Audit Log & Activity Tracking

📌 Issue Reference

🧭 What’s Included

  • Introduced AuditLog ORM model, Pydantic schemas, repository, and Alembic migration.
  • Added AuditLogService, AuditTrailRecorder, and FastAPI router at /api/v1/audit-logs with list/read/create endpoints.
  • Wired audit hooks into project, resource, maintenance-ticket, and document services using authenticated actor context.
  • Enriched document service with download access logging and ensured API routers pass current_user metadata.
  • Extended test infrastructure to support GeoAlchemy on SQLite and added targeted service/API regression tests.
  • Authenticated helpers and documentation (backend/AUDIT_LOGGING.md) outlining usage, design, and testing strategy.

✅ Testing

  • python3 -m pytest tests/services/test_audit_log_service.py -q
  • python3 -m pytest tests/api/test_audit_logs.py -q
  • python3 -m pytest tests/services/test_project_service_audit.py -q

📝 Notes for Reviewers

  • GeoAlchemy2 callbacks are disabled in tests (see tests/conftest.py) so SQLite in-memory databases work without SpatiaLite.
  • API routers now require current_user in request handlers to capture actor information—existing overrides were updated accordingly.

- Add notification models and database schema
- Implement email service with SMTP integration
- Implement SMS service with Twilio integration
- Create message template system (HTML/text)
- Add notification API endpoints
- Integrate with existing alert system
- Add configuration settings for email/SMS providers
- Implement logging and retry logic
- Add comprehensive tests

Addresses GitHub Issue bos-com#8: Email & SMS Notification Service
@Sakeeb91 Sakeeb91 changed the title Implement document management system (Issue #7) Add audit logging infrastructure (#6) Oct 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant