Skip to content

Commit

Permalink
VKT(Backend&Frontend): Fix exam event summary data show on enrollment…
Browse files Browse the repository at this point in the history
… appointment stepper [deploy]
  • Loading branch information
pkoivisto committed Jan 10, 2025
1 parent 89aea16 commit f3fdc7c
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
@Builder
public record PublicAppointmentExamDateDTO(
@NonNull @NotNull LocalDate date,
@NonNull @NotNull String examTime,
@NonNull @NotNull MunicipalityDTO municipality,
@NonNull @NotNull String location,
@NonNull @NotNull ExamLanguage language,
@NonNull PublicExaminerNameDTO examiner
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,7 @@
package fi.oph.vkt.service;

import fi.oph.vkt.api.dto.FreeEnrollmentAttachmentDTO;
import fi.oph.vkt.api.dto.FreeEnrollmentDetails;
import fi.oph.vkt.api.dto.FreeEnrollmentDetailsDTO;
import fi.oph.vkt.api.dto.PublicAppointmentExamDateDTO;
import fi.oph.vkt.api.dto.PublicEducationDTO;
import fi.oph.vkt.api.dto.PublicEnrollmentAppointmentDTO;
import fi.oph.vkt.api.dto.PublicEnrollmentAppointmentUpdateDTO;
import fi.oph.vkt.api.dto.PublicEnrollmentContactCreateDTO;
import fi.oph.vkt.api.dto.PublicEnrollmentCreateDTO;
import fi.oph.vkt.api.dto.PublicEnrollmentDTO;
import fi.oph.vkt.api.dto.PublicEnrollmentInitialisationDTO;
import fi.oph.vkt.api.dto.PublicExamEventDTO;
import fi.oph.vkt.api.dto.PublicExaminerNameDTO;
import fi.oph.vkt.api.dto.PublicFreeEnrollmentBasisDTO;
import fi.oph.vkt.api.dto.PublicPersonDTO;
import fi.oph.vkt.api.dto.PublicReservationDTO;
import fi.oph.vkt.model.Enrollment;
import fi.oph.vkt.model.EnrollmentAppointment;
import fi.oph.vkt.model.ExamEvent;
import fi.oph.vkt.model.Examiner;
import fi.oph.vkt.model.ExaminerExamEvent;
import fi.oph.vkt.model.FeatureFlag;
import fi.oph.vkt.model.FreeEnrollment;
import fi.oph.vkt.model.Person;
import fi.oph.vkt.model.Reservation;
import fi.oph.vkt.model.UploadedFileAttachment;
import fi.oph.vkt.api.dto.*;
import fi.oph.vkt.model.*;
import fi.oph.vkt.model.type.EnrollmentAppointmentStatus;
import fi.oph.vkt.model.type.EnrollmentStatus;
import fi.oph.vkt.model.type.FreeEnrollmentSource;
Expand Down Expand Up @@ -627,9 +603,13 @@ private PublicEnrollmentAppointmentDTO createEnrollmentAppointmentDTO(
.builder()
.name(examiner.getNickname() + " " + examiner.getLastName())
.build();
final Municipality municipality = examEvent.getMunicipality();
final MunicipalityDTO municipalityDTO = MunicipalityDTO.builder().code(municipality.getCode()).build();
final PublicAppointmentExamDateDTO examDateDTO = PublicAppointmentExamDateDTO
.builder()
.date(examEvent.getDate())
.examTime(examEvent.getExamTime())
.municipality(municipalityDTO)
.location(examEvent.getLocation())
.examiner(examinerNameDTO)
.language(examEvent.getLanguage())
Expand Down
4 changes: 3 additions & 1 deletion frontend/packages/vkt/public/i18n/fi-FI/public.json
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@
"examEvent": "Tutkinto",
"examLanguage": "Tutkinnon kieli",
"examLevel": "Tutkinnon taso",
"examLocation": "Tutkintopaikka",
"examLocation": "Tarkemmat osoitetiedot",
"examTime": "Tutkinnon alkamisaika",
"municipality": "Tutkintopaikka",
"examiner": "Tutkinnon vastaanottaja"
},
"stepHeading": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { Text } from 'shared/components';

import { useCommonTranslation, usePublicTranslation } from 'configs/i18n';
import {
useCommonTranslation,
useKoodistoMunicipalitiesTranslation,
usePublicTranslation,
} from 'configs/i18n';
import { ExamLevel } from 'enums/app';
import { PublicExaminerExamEvent } from 'interfaces/publicExaminerExamEvent';
import { DateTimeUtils } from 'utils/dateTime';
Expand All @@ -13,9 +17,11 @@ export const PublicEnrollmentAppointmentExamEvent = ({
}) => {
const examiner = examEvent.examiner;
const translateCommon = useCommonTranslation();
const translateMunicipality = useKoodistoMunicipalitiesTranslation();
const { t } = usePublicTranslation({
keyPrefix: 'vkt.component.publicEnrollmentAppointment.examEventDetails',
});
const examTime = DateTimeUtils.parseTime(examEvent.examTime);

return (
<div className="rows">
Expand All @@ -35,17 +41,27 @@ export const PublicEnrollmentAppointmentExamEvent = ({
{': '}
<b>{examiner.name}</b>
</Text>
<Text>
{t('examDate')}
{': '}
<b>
<b>{DateTimeUtils.renderDate(examEvent.date)}</b>
</b>
</Text>
<Text>
{t('municipality')}
{': '}
<b>{translateMunicipality(examEvent.municipality.code)}</b>
</Text>
<Text>
{t('examLocation')}
{': '}
<b>{examEvent.location}</b>
</Text>
<Text>
{t('examDate')}
{t('examTime')}
{': '}
<b>
<b>{DateTimeUtils.renderDate(examEvent.date)}</b>
</b>
<b>{DateTimeUtils.renderTime(examTime)}</b>
</Text>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ import { Dayjs } from 'dayjs';
import { WithId } from 'shared/interfaces';

import { ExamLanguage } from 'enums/app';
import { MunicipalityCode } from 'interfaces/municipality';
import { PublicExaminer } from 'interfaces/publicExaminer';

export interface PublicExaminerExamEvent extends WithId {
examiner: PublicExaminer;
language: Exclude<ExamLanguage, ExamLanguage.ALL>;
date: Dayjs;
examTime: string;
municipality: MunicipalityCode;
location: string;
registrationCloses: Dayjs;
openings: number;
Expand Down

0 comments on commit f3fdc7c

Please sign in to comment.