Skip to content

Commit

Permalink
VKT(Backend & Frontend): Merge fixes & database dump update
Browse files Browse the repository at this point in the history
  • Loading branch information
jrkkp committed Nov 7, 2024
1 parent 15c2573 commit e361bed
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 22 deletions.
11 changes: 10 additions & 1 deletion backend/vkt/db/1_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ CREATE TABLE public.enrollment_appointment (
country text,
person_id bigint,
first_name text,
last_name text
last_name text,
examiner_id bigint
);


Expand Down Expand Up @@ -986,6 +987,14 @@ ALTER TABLE ONLY public.email
ADD CONSTRAINT fk_email_email_type FOREIGN KEY (email_type) REFERENCES public.email_type(name);


--
-- Name: enrollment_appointment fk_enrollment_appointment_examiner_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.enrollment_appointment
ADD CONSTRAINT fk_enrollment_appointment_examiner_id FOREIGN KEY (examiner_id) REFERENCES public.examiner(examiner_id);


--
-- Name: enrollment fk_enrollment_exam_event; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
Expand Down
1 change: 1 addition & 0 deletions backend/vkt/db/3_liquibase.sql
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ COPY public.databasechangelog (id, author, filename, dateexecuted, orderexecuted
2024-10-15-exam_level-new-value pkoivisto migrations.xml 2024-11-06 13:14:31.909788 36 EXECUTED 9:8faf60b4438613d90a29a860678bf66e insert tableName=exam_level \N 4.29.1 \N \N 0891671690
2024-10-15-unique-exam-event-language-level-date-examiner-on-psql pkoivisto migrations.xml 2024-11-06 13:14:31.915393 37 EXECUTED 9:b69bb176a254f507ddeb877153d6b162 sql \N 4.29.1 \N \N 0891671690
2024-11-04-add-enrollment_appointment-missing-fields jrkkp migrations.xml 2024-11-06 13:14:31.922772 38 EXECUTED 9:b982dffea40ebba3a547a1afd7a3ca6a addColumn tableName=enrollment_appointment \N 4.29.1 \N \N 0891671690
2024-11-07-add-enrollment_appointment-missing-fields-2 jrkkp migrations.xml 2024-11-07 13:17:52.164316 39 EXECUTED 9:a5aa107cb7c4dce06ff0e2bff24ed2f8 addColumn tableName=enrollment_appointment; addForeignKeyConstraint baseTableName=enrollment_appointment, constraintName=fk_enrollment_appointment_examiner_id, referencedTableName=examiner \N 4.29.1 \N \N 0978272132
\.


Expand Down
23 changes: 11 additions & 12 deletions backend/vkt/db/4_init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -392,18 +392,17 @@ SELECT exam_event_id, (SELECT max(person_id) FROM person),
'[email protected]', '0404040404', null, null, null, null
FROM exam_event;

-- Insert enrollment appointment
-- INSERT INTO enrollment_appointment(person_id,
-- skill_oral, skill_textual, skill_understanding,
-- partial_exam_speaking, partial_exam_speech_comprehension, partial_exam_writing, partial_exam_reading_comprehension,
-- status, digital_certificate_consent, email, phone_number, street, postal_code, town, country)
-- VALUES (SELECT max(person_id) FROM person),
-- true, true, true,
-- true, true, true, true,
-- 'COMPLETED', true,
-- '[email protected]', '0404040404', null, null, null, null;


-- Insert enrollment appointment
INSERT INTO examiner(version, oid, email, phone_number, last_name, first_name, nickname, exam_language_finnish, exam_language_swedish, is_public)
VALUES (1, '1.2.246.init-1', '[email protected]', '04040404040', 'Tessilä', 'Testi', 'Tessa', true, true, true);

-- Insert enrollment appointment
INSERT INTO enrollment_appointment(person_id, examiner_id,
skill_oral, skill_textual, skill_understanding,
partial_exam_speaking, partial_exam_speech_comprehension, partial_exam_writing, partial_exam_reading_comprehension,
status, digital_certificate_consent, email, phone_number, street, postal_code, town, country)
VALUES (null, 1,
true, true, true,
true, true, true, true,
'CONTACT_CREATED', true,
'[email protected]', '0404040404', null, null, null, null);
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,8 @@ public class EnrollmentAppointment extends EnrollmentCommon {

@OneToMany(mappedBy = "enrollmentAppointment")
private List<Payment> payments = new ArrayList<>();

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "examiner_id", referencedColumnName = "examiner_id")
private Examiner examiner;
}
11 changes: 11 additions & 0 deletions backend/vkt/src/main/resources/db/changelog/db.changelog-1.0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1067,4 +1067,15 @@
<column name="last_name" type="TEXT" />
</addColumn>
</changeSet>
<changeSet id="2024-11-07-add-enrollment_appointment-missing-fields-2" author="jrkkp">
<addColumn tableName="enrollment_appointment">
<column name="examiner_id" type="BIGINT" />
</addColumn>
<addForeignKeyConstraint
baseTableName="enrollment_appointment"
baseColumnNames="examiner_id"
constraintName="fk_enrollment_appointment_examiner_id"
referencedTableName="examiner"
referencedColumnNames="examiner_id"/>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export const PublicEnrollmentContactExaminer = ({
{': '}
<b>
{examiner.examDates.map((date) => (
<b key={`examiner-date-${DateTimeUtils.renderDate(date)}`}>
{DateTimeUtils.renderDate(date)}
<b key={`examiner-date-${DateTimeUtils.renderDate(date.examDate)}`}>
{DateTimeUtils.renderDate(date.examDate)}
</b>
))}
</b>
Expand Down
5 changes: 0 additions & 5 deletions frontend/packages/vkt/src/enums/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,11 @@ export enum AppRoutes {
'/:examinerId/valmis',

// Routes for clerk user
ClerkHomePage = '/vkt/virkailija',
ClerkExamEventCreatePage = '/vkt/virkailija/tutkintotilaisuus/luo',
ClerkExamEventOverviewPage = '/vkt/virkailija/tutkintotilaisuus/:examEventId',
ClerkEnrollmentOverviewPage = '/vkt/virkailija/tutkintotilaisuus/:examEventId/ilmoittautuminen',
ClerkEnrollmentContactRequestPage = '/vkt/virkailija/yhteydenottopyynto/:enrollmentContactRequestId',
ClerkEnrollmentAppointmentPage = '/vkt/virkailija/ilmoittautuminen/:enrollmentAppointmentId',
ClerkLocalLogoutPage = '/vkt/cas/localLogout',

// Routes for good and satisfactory level - TODO
PublicGoodAndSatisfactoryLevelLanding = goodAndSatisfactoryLevelRoutePrefix,
ClerkRoot = '/vkt/virkailija/',
// Routes for clerk user / excellent level
ClerkExcellentLevelPage = clerkExcellentLevelRoutePrefix,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const BackButton = () => {

return (
<CustomButtonLink
to={AppRoutes.ClerkHomePage}
to={AppRoutes.ClerkRoot}
variant={Variant.Text}
startIcon={<ArrowBackIosOutlinedIcon />}
className="color-secondary-dark"
Expand Down
1 change: 0 additions & 1 deletion frontend/packages/vkt/src/redux/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ const reducer = combineReducers({
publicEnrollmentAppointment: publicEnrollmentAppointmentReducer,
publicEnrollmentContact: publicEnrollmentContactReducer,
publicExaminer: publicExaminerReducer,
publicExaminer: publicExaminerReducer,
examinerDetails: examinerDetailsReducer,
examinerDetailsInit: examinerDetailsInitReducer,
examinerDetailsUpsert: examinerDetailsUpsertReducer,
Expand Down

0 comments on commit e361bed

Please sign in to comment.