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: Move creation Group from responder to services (DEV-3292) #3185

Merged
merged 7 commits into from Apr 15, 2024

Conversation

mpro7
Copy link
Collaborator

@mpro7 mpro7 commented Apr 11, 2024

Pull Request Checklist

Task Description/Number

Issue Number: DEV-

PR Type

  • build/chore: maintenance tasks (no production code change)
  • docs: documentation changes (no production code change)
  • feat: represents new features
  • fix: represents bug fixes
  • perf: performance improvements
  • refactor: represents production code refactoring
  • test: adding or refactoring tests (no production code change)
  • deprecated: Deprecation warning (ideally referencing a migration guide)

Basic requirements for bug fixes and features

  • Tests for the changes have been added
  • Docs have been added / updated

Does this PR introduce a breaking change?

  • Yes

Does this PR change client-test-data?

  • Yes

Copy link

linear bot commented Apr 11, 2024

@mpro7 mpro7 changed the title move group creation to slice services refactor: Move creation Group from responder to services Apr 11, 2024
@mpro7 mpro7 marked this pull request as ready for review April 12, 2024 08:05
hasSelfJoinEnabled = request.selfjoin,
)
_ <- knoraGroupRepo.save(group)
} yield group
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this belong in KnoraGroupRepo? What's the difference between KnoraGroupRepo and this file? In master this file is a really thin wrapper over it, does it really serve a purpose? I see @seakayone made it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sole responsibility for repositories is to store entities and retrieve them. Maintaining constraints on certain properties of the entity which cannot be modelled by a type system, e.g. the uniqueness of a property other than the id of the entity is not the responsibility of a repository.

The admin module does not expose the repositories but only services operating on these. The methods of these services represent certain use cases and contain the business logic based on them, e.g. the creation of a group with a custom IRI.

@mpro7 mpro7 self-assigned this Apr 15, 2024
@mpro7 mpro7 requested a review from seakayone April 15, 2024 12:24
@mpro7 mpro7 requested a review from siers April 15, 2024 12:55
@seakayone seakayone self-requested a review April 15, 2024 13:21
@mpro7 mpro7 merged commit a21a34f into main Apr 15, 2024
11 checks passed
@mpro7 mpro7 deleted the dev-3292-4 branch April 15, 2024 13:25
@mpro7 mpro7 changed the title refactor: Move creation Group from responder to services refactor: Move creation Group from responder to services (DEV-3292) Apr 16, 2024
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