sourcefuse / loopback4-microservice-catalog

A Catalog of Microservices Created by SourceFuse for the Community
https://sourcefuse.github.io/arc-docs/arc-api-docs/
MIT License
296 stars 72 forks source link

Follow SOLID #2037

Closed yeshamavani closed 5 months ago

yeshamavani commented 8 months ago

Describe the bug Remove the logic from the repositories and move it to a separate service. Also add the test cases wherever necessary.

eg :- https://github.com/sourcefuse/loopback4-microservice-catalog/blob/master/services/authentication-service/src/repositories/user.repository.ts

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior We should follow SOLID and repositories should not have business logic within them.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

namandeep-s1ngh commented 7 months ago

repositories to be updated:

  1. authentication service > user.repository.ts
  2. in-mail-service > message.repository.ts, thread.repository.ts
  3. oidc service > user.repository.ts
  4. search-service > recent-search.repository.ts, search-query.repository.ts
  5. survey-service > section.repository.ts, survey-question.repository.ts, survey-responder.repository.ts
  6. user-tenant-service > user.repository.ts

Along with these, the respective sanbox examples will also be updated.

namandeep-s1ngh commented 7 months ago

sandbox examples to be updated:

  1. auth-ms-basic-example > user.repository.ts
  2. auth-multitenant-example > user-ext.repository.ts
  3. oauth-example > user.repository.ts
  4. telemed-app > backend > authentication-service > user.repository.ts