Skip to content

Commit

Permalink
OY-4717 huomioidaan haku-appin hakemuksia parsiessa että haku-oid noi…
Browse files Browse the repository at this point in the history
… olla null
  • Loading branch information
marjakari committed Dec 31, 2024
1 parent f8f6f7f commit f5f82b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ trait HakemusEditoriComponent extends AtaruServiceComponent
def fetchByPersonOid(request: HttpServletRequest,
personOid: String,
valintatulosFetchStrategy: ValintatulosFetchStrategy): HakemusResult = {
logger.debug(s"Fetching hakemus by person oid $personOid")
logger.info(s"Fetching hakemus list by person oid $personOid")
val ataruHakemukset = Try(ataruService.findApplications(request, personOid, valintatulosFetchStrategy, language))
val hakuAppHakemukset = oppijanumerorekisteriService.fetchAllDuplicateOids(personOid).toList
.map(oid => Try(hakemusRepository.fetchHakemukset(request, oid, valintatulosFetchStrategy)))
Expand All @@ -83,6 +83,8 @@ trait HakemusEditoriComponent extends AtaruServiceComponent
personOid: String,
hakemusOid: String,
valintatulosFetchStrategy: ValintatulosFetchStrategy): Option[HakemusInfo] = {
logger.info(s"fetchByHakemusOid hakemus-oidilla $hakemusOid")
// TODO käännä toisinpäin, haetaan ensin atarusta ja sitten vasta haku-appista
val optFromHakemusRepository = hakemusRepository.getHakemus(request, hakemusOid, valintatulosFetchStrategy)
if (optFromHakemusRepository.isEmpty) {
logger.info("fetchByHakemusOid(): Hakemus repository returned no application for given hakemusOid {}. Searching from ataru.", hakemusOid)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ trait HakemusRepositoryComponent {
}
}.flatMap(application => {
val hakuOption = application.hakuOid match {
case null => None
case "" => None
case hakuOid => timed("LomakeRepository get lomake", 1000) {
tarjontaService.haku(hakuOid, lang).filter(_.published).filter(_.hakukierrosvoimassa)
Expand Down

0 comments on commit f5f82b1

Please sign in to comment.