-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Opetushallitus/OK-756-swagger
Ok 756 swagger
- Loading branch information
Showing
83 changed files
with
4,271 additions
and
626 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,46 @@ | ||
# ovara-virkailija | ||
## Ovara-virkailija - Opiskelijavalinnan raportoinnin virkailijakäyttöliittymä | ||
|
||
Ovara koostuu kahdesta sovelluksesta: Spring bootilla ja Scalalla toteutetusta backendistä, | ||
jonka tarjoamien HTTP-rajapintojen kautta Next.js:llä toteutettu käyttöliittymä noutaa virkailijoiden tarvitsemia raportteja. | ||
Käyttöliittymässä käyttäjä täyttää lomakkeen avulla kyselyn, jonka perusteella backend noutaa tiedot Ovaran omasta tietokannasta ja | ||
muodostaa excel-tiedoston, joka ladataan käyttäjän selaimeen. | ||
|
||
# Ovara-backendin | ||
|
||
Backend käyttää Java Corretton versiota 21. | ||
|
||
Backendiä ajetaan IDEA:ssa. Kehitysympäristön konfiguraatio määritellään `application-dev.properties`-nimisessä tiedostossa | ||
```` | ||
spring.datasource.url=jdbc:postgresql://localhost:5432/ovara | ||
spring.datasource.username=app | ||
spring.datasource.password=app | ||
opintopolku.virkailija.domain=https://virkailija.hahtuvaopintopolku.fi | ||
cas.url=${opintopolku.virkailija.domain}/cas | ||
ovara.ui.url=https://localhost:3405 | ||
ovara.backend.url=http://localhost:8080/ovara-backend | ||
ovara-backend.cas.password=<CAS-SALASANA> | ||
#logging.level.org.springframework.cache=TRACE | ||
```` | ||
|
||
Backendiä voi ajaa sekä lokaalia dockeriin käynnistettävää postgresia että testiympäristön tietokantaa vasten. | ||
(Kirjoitushetkellä ovaran tietokanta on olemassa pelkästään QA:lla.) `justfile`:stä | ||
löytyvät komennot tietokannan pystyttämiseen tai tietokantayhteyden avaamiseen. [just](https://github.com/casey/just) on | ||
komentorivityökalu komentojen dokumentoimiseen ja ajamiseen. Esimerkiksi `just ssh-to-remote-db-in-pallero` avaa tietokantayhteyden | ||
QA:n ovara-tietokantaan. Lokaalin tietokannan käyttäminen vaatii tietokantadumpin lataamisen omalle koneelle, | ||
ja sen voi tehdä komennolla `just dump-remote-db`. `just`:in asentaminen ei ole välttämätöntä backendin ajamiseksi, | ||
vaan voit katsoa tarvittavat komennot `justfile`:stä ja ajaa ne sellaisinaan komentoriviltä. | ||
|
||
Ovara-backendin rajapinta on dokumentoitu Swaggeriä käyttäen ja se löytyy osoitteesta: `http://localhost:8080/ovara-backend/swagger-ui/index.html`. | ||
Rajapintojen kutsuminen edellyttää kirjautumista. Kehitysympäristössä tämä tapahtuu helpoiten siten, että myös ovara-ui on | ||
lokaalisti käynnissä ja kirjaudut sen kautta sisään ennen swaggerin rajapintojen käyttämistä. | ||
|
||
|
||
|
||
|
||
# Ovara-ui | ||
|
||
Ovara-ui on toteutettu Next.js:llä. | ||
|
||
Käyttöliittymän saa käynnistettyä komennolla `npm run dev`. Käyttöliittymä avautuu osoitteeseen: `https://localhost:3405`. |
Empty file.
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,5 @@ | ||
version = 2.7.5 | ||
maxColumn = 120 | ||
assumeStandardLibraryStripMargin = true | ||
align.preset = more | ||
includeCurlyBraceInSelectChains = false |
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
16 changes: 16 additions & 0 deletions
16
ovara-backend/src/main/scala/fi/oph/ovara/backend/domain/Enum.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,16 @@ | ||
package fi.oph.ovara.backend.domain | ||
|
||
trait EnumType { | ||
def name: String | ||
|
||
override def toString: String = name | ||
} | ||
|
||
trait Enum[T <: EnumType] { | ||
def name: String | ||
|
||
def values: List[T] | ||
|
||
def withName(n: String): T = values.find(_.name.equals(n)) | ||
.getOrElse(throw new IllegalArgumentException(s"Unknown ${name} '${n}'")) | ||
} |
4 changes: 4 additions & 0 deletions
4
ovara-backend/src/main/scala/fi/oph/ovara/backend/domain/Haku.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,4 @@ | ||
package fi.oph.ovara.backend.domain | ||
|
||
case class Haku(haku_oid: String, | ||
haku_nimi: Kielistetty) |
13 changes: 13 additions & 0 deletions
13
ovara-backend/src/main/scala/fi/oph/ovara/backend/domain/Kieli.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,13 @@ | ||
package fi.oph.ovara.backend.domain | ||
|
||
sealed trait Kieli extends EnumType with Product with Serializable | ||
|
||
object Kieli extends Enum[Kieli] { | ||
override def name: String = "kieli" | ||
def values = List(Fi, Sv, En) | ||
} | ||
|
||
case object Fi extends Kieli { val name = "fi" } | ||
case object Sv extends Kieli { val name = "sv" } | ||
case object En extends Kieli { val name = "en" } | ||
|
13 changes: 13 additions & 0 deletions
13
.../src/main/scala/fi/oph/ovara/backend/domain/KoulutuksetToteutuksetHakukohteetResult.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,13 @@ | ||
package fi.oph.ovara.backend.domain | ||
|
||
case class KoulutuksetToteutuksetHakukohteetResult( | ||
hakukohdeNimi: Kielistetty, | ||
hakukohdeOid: String, | ||
koulutuksenTila: Option[String] = None, | ||
toteutuksenTila: Option[String] = None, | ||
hakukohteenTila: Option[String] = None, | ||
aloituspaikat: Option[Int] = None, | ||
onValintakoe: Option[Boolean] = None, | ||
voiSuorittaaKaksoistutkinnon: Option[Boolean] = None, | ||
jarjestaaUrheilijanAmmKoulutusta: Option[Boolean] = None | ||
) |
4 changes: 0 additions & 4 deletions
4
ovara-backend/src/main/scala/fi/oph/ovara/backend/domain/Toteutus.scala
This file was deleted.
Oops, something went wrong.
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
16 changes: 16 additions & 0 deletions
16
ovara-backend/src/main/scala/fi/oph/ovara/backend/domain/package.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,16 @@ | ||
package fi.oph.ovara.backend | ||
|
||
package object domain { | ||
type Kielistetty = Map[Kieli, String] | ||
|
||
val ammatillisetHakukohdekoodit = List( | ||
"10", // Aikuiskoulutus | ||
"19", // Aikuisten perusopetus | ||
"15", // Ammatillinen peruskoulutus erityisopetuksena | ||
"11", // Perusopetuksen jälkeisen koulutuksen yhteishaku | ||
"20", // Erityisopetuksena järjestettävä ammatillinen koulutus | ||
"23", // Ammatillinen koulutus | ||
"24", // Lukiokoulutus | ||
"21", // Yhteishaun ulkopuolinen lukiokoulutus | ||
) | ||
} |
Oops, something went wrong.