-
Notifications
You must be signed in to change notification settings - Fork 11
Get Collections For Linking Use Case #367
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
Merged
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
76fa636
feat: use case
g-saracca 5695023
test: add unit and integration test
g-saracca 8387b4e
docs: add use case docs
g-saracca 5190e6a
Merge branch 'develop' into feat/345-get-collection-for-linking
g-saracca e4c0880
feat: update linkDataset and unlinkDataset methods to accept string o…
g-saracca e30ad18
feat: add alreadyLinked parameter to getCollectionsForLinking to get …
g-saracca 4e1c1a0
fix: unit tests
g-saracca 3c6da0a
fix: add wait after linking for test
g-saracca 9d20668
fix: make test assertions better
g-saracca d37c5f8
remove comment
g-saracca ff42b7f
fix: map linked dataset correctly according to model
g-saracca b1ada17
docs: remove dataverse wording
g-saracca File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/collections/domain/useCases/GetCollectionsForLinking.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import { UseCase } from '../../../core/domain/useCases/UseCase' | ||
| import { ICollectionsRepository } from '../repositories/ICollectionsRepository' | ||
| import { CollectionSummary } from '../models/CollectionSummary' | ||
|
|
||
| export type LinkingObjectType = 'collection' | 'dataset' | ||
|
|
||
| export class GetCollectionsForLinking implements UseCase<CollectionSummary[]> { | ||
| private collectionsRepository: ICollectionsRepository | ||
|
|
||
| constructor(collectionsRepository: ICollectionsRepository) { | ||
| this.collectionsRepository = collectionsRepository | ||
| } | ||
|
|
||
| /** | ||
| * Returns an array of CollectionSummary (id, alias, displayName) to which the given Dataverse collection or Dataset may be linked. | ||
| * @param objectType - 'dataverse' when providing a collection identifier/alias; 'dataset' when providing a dataset persistentId. | ||
|
g-saracca marked this conversation as resolved.
Outdated
|
||
| * @param id - For objectType 'dataverse', a numeric id or alias string. For 'dataset', the persistentId string (e.g., doi:...) | ||
|
g-saracca marked this conversation as resolved.
Outdated
|
||
| * @param searchTerm - Optional search term to filter by collection name. Defaults to empty string (no filtering). | ||
| * @param alreadyLinked - Optional flag. When true, returns collections currently linked (candidates to unlink). Defaults to false. | ||
| */ | ||
| async execute( | ||
| objectType: LinkingObjectType, | ||
| id: number | string, | ||
| searchTerm = '', | ||
| alreadyLinked = false | ||
| ): Promise<CollectionSummary[]> { | ||
| return await this.collectionsRepository.getCollectionsForLinking( | ||
| objectType, | ||
| id, | ||
| searchTerm, | ||
| alreadyLinked | ||
| ) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| POSTGRES_VERSION=17 | ||
| DATAVERSE_DB_USER=dataverse | ||
| SOLR_VERSION=9.8.0 | ||
| DATAVERSE_IMAGE_REGISTRY=docker.io | ||
| DATAVERSE_IMAGE_TAG=unstable | ||
| DATAVERSE_IMAGE_REGISTRY=ghcr.io | ||
| DATAVERSE_IMAGE_TAG=11710-find-dataverses-for-linking | ||
| DATAVERSE_BOOTSTRAP_TIMEOUT=5m |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.