Skip to content

feat: implement user activity timeline and integrate supporting fixes#748

Merged
RUKAYAT-CODER merged 3 commits into
rinafcode:mainfrom
Shadow-MMN:feat/user-activity-timeline-audit-log-integration
Jun 1, 2026
Merged

feat: implement user activity timeline and integrate supporting fixes#748
RUKAYAT-CODER merged 3 commits into
rinafcode:mainfrom
Shadow-MMN:feat/user-activity-timeline-audit-log-integration

Conversation

@Shadow-MMN
Copy link
Copy Markdown

Description

This PR introduces a secure, user-facing activity history feature built on top of the existing AuditLog system. It exposes user-scoped activity data through new API endpoints and enables CSV export of historical activity records.

Summary of Changes

New Features

  • Added GET /users/me/activities for paginated user activity timeline
  • Added GET /users/me/activities/export for CSV export of activity history
  • Introduced UserActivityController to expose audit logs to authenticated users
  • Created UsersModule to encapsulate user-related API logic

Security Improvements

  • Strict enforcement of req.user.id for all activity queries
  • Prevented cross-user access to audit logs
  • Ensured export endpoint respects same access constraints as timeline

Integration

  • Reused existing AuditLog infrastructure
  • Leveraged AuditLogService for querying and filtering
  • Leveraged AuditExportService for CSV generation

Testing

  • Added E2E tests covering:

    • Pagination
    • Filtering by activity type
    • CSV export functionality
    • Access control validation

Fixes Included

During implementation, several existing issues in the codebase were resolved:

  • Fixed dependency injection issues in index optimization services
  • Fixed type mismatches in invoice and courses modules
  • Corrected audit log field mapping in data retention service

Notes

  • No new audit storage layer was introduced; existing infrastructure was fully reused
  • No changes were made to frontend; this PR is backend-only and provides API support for future UI integration
  • System remains fully backward compatible

Closes #553

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@Shadow-MMN Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER
Copy link
Copy Markdown
Contributor

Kindly resolve conflict.

@Shadow-MMN
Copy link
Copy Markdown
Author

Kindly resolve conflict.

On it

@Shadow-MMN
Copy link
Copy Markdown
Author

@RUKAYAT-CODER , check it out now.

@RUKAYAT-CODER
Copy link
Copy Markdown
Contributor

Thank you for contributing to the project.

@RUKAYAT-CODER RUKAYAT-CODER merged commit fd89fef into rinafcode:main Jun 1, 2026
1 check failed
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.

Implement user activity timeline/history

2 participants