Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Recent Activity Service for Improved Structure and Asynchronicity #295

Open
Tracked by #281
seansica opened this issue Sep 20, 2023 · 0 comments
Open
Tracked by #281
Assignees
Labels
enhancement New feature or request

Comments

@seansica
Copy link
Contributor

seansica commented Sep 20, 2023

Refactor recentActivityService for Improved Structure and Asynchronicity

Description:

In line with our project-orion objectives, the following requirements should be addressed for the recent-activity-service.js module. Please use the Matrices service and repository (services/matrices-service.js and repository/matrices-repository.js) as a frame of reference when making these changes.

Requirements:

  1. Decoupling Database Logic:

    • Remove all direct database operations from the service module.
    • Migrate these operations to a new repository/DAO module.
  2. Exceptions Handling:

    • Implement the new exceptions module to handle errors.
    • Replace traditional error handling with our standardized custom error classes.
  3. Callbacks to Promises:

    • Transition all existing callback handlers to Promises.
    • Use try-catch blocks and async/await notation for cleaner, more readable asynchronous code.
  4. Service Structure:

    • Refactor the service module to be a class-based structure.
    • This class should extend the BaseService for consistent behavior and structure across all services.
  5. Repository Structure:

    • The newly created repository/DAO should also be class-based.
    • This class should extend the BaseRepository to ensure consistency in database operations across services.
  6. Common Function Migration:

    • Migrate shared or common functions to BaseRepository and BaseService as necessary.
    • Avoid duplication and ensure that common functionalities are accessible to all services and repositories.
  7. Service-Specific Functions:

    • Functions that are specific to a particular service and are not shared should be implemented directly on the corresponding service class. Do not add them to BaseRepository.
  8. Testing:

    • Refactor the Mocha test suite spec file corresponding to this service.
    • Transition from callbacks to async/await notation.
    • Ensure all tests are passing before opening a pull request.

Notes:

Please reference any relevant documentation, discussions, or PRs as needed. Ensure that the refactoring remains consistent with the established practices from the Matrices service and repository as a reference.

@seansica seansica changed the title Refactor recent-activity-service Refactor Recent Activity Service for Improved Structure and Asynchronicity Sep 20, 2023
@seansica seansica added the enhancement New feature or request label Sep 20, 2023
@vsun757 vsun757 self-assigned this Oct 19, 2023
@vsun757 vsun757 assigned vsun757 and ElJocko and unassigned vsun757 Jan 10, 2024
@vsun757 vsun757 assigned vsun757 and ElJocko and unassigned ElJocko and vsun757 Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants