Skip to content

Commit

Permalink
search-api: Add reuseOf field to competencegoals
Browse files Browse the repository at this point in the history
  • Loading branch information
jnatten committed Jan 13, 2025
1 parent 4d7b30d commit 8459834
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ object GrepResultDTO {
code = core.referanse.kode,
title = core.referanse.tittel
)
},
reuseOf = goal.`gjenbruk-av`.map { goal =>
GrepReferencedKompetansemaalDTO(
code = goal.kode,
title = goal.tittel
)
}
)
)
Expand Down Expand Up @@ -167,7 +173,8 @@ case class GrepKompetansemaalDTO(
laereplan: GrepReferencedLaereplanDTO,
kompetansemaalSett: GrepReferencedKompetansemaalSettDTO,
tverrfagligeTemaer: List[GrepTverrfagligTemaDTO],
kjerneelementer: List[GrepReferencedKjerneelementDTO]
kjerneelementer: List[GrepReferencedKjerneelementDTO],
reuseOf: Option[GrepReferencedKompetansemaalDTO]
) extends GrepResultDTO
case class GrepReferencedKompetansemaalSettDTO(
code: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ case class GrepKompetansemaal(
`tilhoerer-laereplan`: BelongsToObj,
`tilhoerer-kompetansemaalsett`: BelongsToObj,
`tilknyttede-tverrfaglige-temaer`: List[ReferenceWrapperObj],
`tilknyttede-kjerneelementer`: List[ReferenceWrapperObj]
`tilknyttede-kjerneelementer`: List[ReferenceWrapperObj],
`gjenbruk-av`: Option[ReferenceObj]
) extends GrepElement
with BelongsToLaerePlan {
override def getTitle: Seq[GrepTitle] = tittel.tekst
Expand Down
3 changes: 2 additions & 1 deletion search-api/src/test/scala/no/ndla/searchapi/TestData.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,8 @@ object TestData {
`tilhoerer-laereplan` = BelongsToObj("LP1", "Dette er LP1"),
`tilhoerer-kompetansemaalsett` = BelongsToObj("KMS1", "Dette er KMS1"),
`tilknyttede-tverrfaglige-temaer` = List(),
`tilknyttede-kjerneelementer` = List()
`tilknyttede-kjerneelementer` = List(),
`gjenbruk-av` = None
)
),
tverrfagligeTemaer = List(GrepTverrfagligTema("TT2", Seq(GrepTitle("default", "Demokrati og medborgerskap")))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ class GrepSearchServiceTest extends IntegrationSuite(EnableElasticsearchContaine
`tilhoerer-laereplan` = BelongsToObj("LP2", "Dette er LP2"),
`tilhoerer-kompetansemaalsett` = BelongsToObj("KE200", "Kompetansemaalsett"),
`tilknyttede-tverrfaglige-temaer` = List(),
`tilknyttede-kjerneelementer` = List()
`tilknyttede-kjerneelementer` = List(),
`gjenbruk-av` = None
)
),
kompetansemaalsett = List.empty,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,8 @@ class SearchConverterServiceTest extends UnitSuite with TestEnvironment {
BelongsToObj("LP123", "Dette er LP123"),
BelongsToObj("KMS123", "Dette er KMS123"),
List(),
List()
List(),
None
)
),
tverrfagligeTemaer = List(GrepTverrfagligTema("TT2", Seq(GrepTitle("default", "tittel2"))))
Expand Down Expand Up @@ -556,7 +557,8 @@ class SearchConverterServiceTest extends UnitSuite with TestEnvironment {
BelongsToObj("LP123", "Dette er LP123"),
BelongsToObj("KMS123", "Dette er KMS123"),
List(),
List()
List(),
None
)
),
tverrfagligeTemaer = List(GrepTverrfagligTema("TT2", Seq(GrepTitle("default", "tittel2"))))
Expand Down

0 comments on commit 8459834

Please # to comment.