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: home page controller code cleanup #14

Open
wants to merge 4 commits into
base: development
Choose a base branch
from

Conversation

Nadeera3784
Copy link

refactor: home-page-controller code clean up

Moved all the business logic to service layer for better separation of concerns and to enhance code reusability and testability. The following changes were made:

  • Tasks-related business logic has been moved to task.service.ts:

    • This includes methods for retrieving tasks, filtering tasks by group, and any other task-related operations.
    • The TaskService class encapsulates all task-related operations, making it easier to maintain and test.
  • Projects-related business logic has been moved to project.service.ts:

    • This includes methods for handling projects, such as creating, updating, and deleting projects.
    • The ProjectService class handles all project-related operations, ensuring a clear separation from controller logic.
  • Constants have been moved to constants.ts:

    • All hardcoded values and magic strings are now stored in a single constants file.
    • This improves code readability and makes it easier to manage and update these values.

Benefits of this refactor:

  • Reusability: Business logic in the service layer can be reused across different parts of the application.
  • Testability: With logic separated into services, we can write unit tests for these services without the need to spin up an entire server.
  • Maintainability: A clear separation of concerns makes the codebase easier to navigate and maintain. Changes to business logic can be made in the service layer without affecting the controller logic.
  • Scalability: As the application grows, new services can be added without complicating the controller layer.

@CLAassistant
Copy link

CLAassistant commented May 22, 2024

CLA assistant check
All committers have signed the CLA.

@kalinga777
Copy link
Contributor

Thank you @Nadeera3784 for your contribution, we will review and merge your contribution

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.

None yet

3 participants