-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add helper constructors for MergeCandidate
- Loading branch information
1 parent
da1898b
commit 43a792f
Showing
9 changed files
with
97 additions
and
301 deletions.
There are no files selected for viewing
This file contains 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
30 changes: 30 additions & 0 deletions
30
...ne/matcher/src/test/scala/weco/pipeline/matcher/generators/MergeCandidateGenerators.scala
This file contains 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,30 @@ | ||
package weco.pipeline.matcher.generators | ||
|
||
import weco.catalogue.internal_model.identifiers.{IdState, IdentifierType} | ||
import weco.catalogue.internal_model.work.{MergeCandidate, Work, WorkState} | ||
|
||
trait MergeCandidateGenerators { | ||
def createSierraPairMergeCandidateFor(w: Work[WorkState.Identified]): MergeCandidate[IdState.Identified] = { | ||
require(w.state.sourceIdentifier.identifierType == IdentifierType.SierraSystemNumber) | ||
|
||
MergeCandidate( | ||
id = IdState.Identified( | ||
canonicalId = w.state.canonicalId, | ||
sourceIdentifier = w.state.sourceIdentifier | ||
), | ||
reason = "Physical/digitised Sierra work" | ||
) | ||
} | ||
|
||
def createMetsMergeCandidateFor(w: Work[WorkState.Identified]): MergeCandidate[IdState.Identified] = { | ||
require(w.state.sourceIdentifier.identifierType == IdentifierType.SierraSystemNumber) | ||
|
||
MergeCandidate( | ||
id = IdState.Identified( | ||
canonicalId = w.state.canonicalId, | ||
sourceIdentifier = w.state.sourceIdentifier | ||
), | ||
reason = "METS work" | ||
) | ||
} | ||
} |
This file contains 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 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 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 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
Oops, something went wrong.