Skip to content

Commit

Permalink
Mock koodisto
Browse files Browse the repository at this point in the history
  • Loading branch information
SalamaGofore committed Apr 3, 2024
1 parent 3582583 commit a5fe852
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mocks/collections.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[
{
"id": "base",
"routes": ["add-headers:enabled", "get-users:success", "get-user:success", "get-haut:success", "get-haku:real", "get-hakukohteet:success"]
"routes": ["add-headers:enabled", "get-users:success", "get-user:success", "get-haut:success", "get-haku:real", "get-hakukohteet:success",
"get-hakutapa-codes:success"]
},
{
"id": "no-headers",
Expand Down
18 changes: 18 additions & 0 deletions mocks/routes/koodisto.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const HAKUTAPA_CODES = [{"koodiUri":"hakutapa_01","metadata":[{"nimi":"Yhteishaku","lyhytNimi":"YH","kieli":"FI"},{"nimi":"Gemensam ansökan","lyhytNimi":"GA","kieli":"SV"},{"nimi":"Joint application","lyhytNimi":"","kieli":"EN"}],"versio":1,"koodiArvo":"01"},{"koodiUri":"hakutapa_04","metadata":[{"nimi":"Joustava haku","lyhytNimi":"","kieli":"FI"},{"nimi":"Rolling admission (higher education)","lyhytNimi":"","kieli":"EN"},{"nimi":"Flexibel ansökan","lyhytNimi":"","kieli":"SV"}],"versio":1,"koodiArvo":"04"},{"koodiUri":"hakutapa_05","metadata":[{"nimi":"Siirtohaku","lyhytNimi":"","kieli":"FI"},{"nimi":"Ansökan om överflyttning","lyhytNimi":"","kieli":"SV"},{"nimi":"Transfer application","lyhytNimi":"","kieli":"EN"}],"versio":1,"koodiArvo":"05"},{"koodiUri":"hakutapa_02","metadata":[{"nimi":"Separata antagningar","lyhytNimi":"SA","kieli":"SV"},{"nimi":"Separate application","lyhytNimi":"","kieli":"EN"},{"nimi":"Erillishaku","lyhytNimi":"EH","kieli":"FI"}],"versio":1,"koodiArvo":"02"},{"koodiUri":"hakutapa_03","metadata":[{"nimi":"Rolling admission (upper secondary level)","lyhytNimi":"","kieli":"EN"},{"nimi":"Jatkuva haku","lyhytNimi":"JH","kieli":"FI"},{"nimi":"Kontinuerlig ansökan","lyhytNimi":"FA","kieli":"SV"}],"versio":1,"koodiArvo":"03"},{"koodiUri":"hakutapa_06","metadata":[{"nimi":"Lisähaku","lyhytNimi":"","kieli":"FI"},{"nimi":"Tilläggsansökan","lyhytNimi":"","kieli":"SV"},{"nimi":"Supplementary application","lyhytNimi":"","kieli":"EN"}],"versio":1,"koodiArvo":"06"}];

module.exports = [
{
id: "get-hakutapa-codes",
url: "/koodisto-service/rest/codeelement/codes/hakutapa",
method: "GET",
variants: [
{
id: "success",
type: "json",
options: {
status: 200,
body: HAKUTAPA_CODES,
},
},
],
}];
2 changes: 1 addition & 1 deletion src/app/lib/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export const configuration: Configuration = {
hautUrl: `${DOMAIN}/kouta-internal/haku/search`,
hakuUrl: `${DOMAIN}/kouta-internal/haku`,
hakukohteetUrl: `${DOMAIN}/kouta-internal/hakukohde/search?all=false`,
kooditUrl: 'https://virkailija.untuvaopintopolku.fi/koodisto-service/rest/codeelement/codes/'
kooditUrl: `${DOMAIN}/koodisto-service/rest/codeelement/codes/`
};

0 comments on commit a5fe852

Please sign in to comment.