-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'OK-774-peruutusmahdollisuus-ja-excel' of github.com:Ope…
…tushallitus/ataru into koski-tutkinnot-dev # Conflicts: # oph-configuration/config.edn.template # resources/ataru-oph.properties # resources/less/editor.less # resources/less/hakija.less # resources/templates/astu_decision_email_template.html # resources/templates/email_edit_confirmation_template_fi.html # resources/templates/email_kk_payment_link_en.html # resources/templates/email_kk_payment_link_fi.html # resources/templates/email_kk_payment_link_sv.html # resources/templates/email_kk_payment_reminder_en.html # resources/templates/email_kk_payment_reminder_fi.html # resources/templates/email_kk_payment_reminder_sv.html # spec/ataru/forms/form_access_control_spec.clj # spec/ataru/kk_application_payment/kk_application_payment_maksut_poller_job_spec.clj # spec/ataru/kk_application_payment/kk_application_payment_spec.clj # spec/ataru/kk_application_payment/kk_application_payment_status_updater_job_spec.clj # spec/ataru/kk_application_payment/kk_application_payment_store_spec.clj # spec/ataru/kk_application_payment/utils_spec.clj # spec/ataru/person_service/person_integration_spec.clj # spec/ataru/util_spec.clj # spec/ataru/virkailija/virkailija_routes_spec.clj # src/clj/ataru/applications/application_service.clj # src/clj/ataru/applications/filtering.clj # src/clj/ataru/background_job/maksut_poller_job.clj # src/clj/ataru/email/application_email.clj # src/clj/ataru/forms/form_access_control.clj # src/clj/ataru/forms/form_payment_info.clj # src/clj/ataru/hakija/hakija_application_service.clj # src/clj/ataru/hakija/validator.clj # src/clj/ataru/kk_application_payment/kk_application_payment.clj # src/clj/ataru/kk_application_payment/kk_application_payment_maksut_poller_job.clj # src/clj/ataru/kk_application_payment/kk_application_payment_module_job.clj # src/clj/ataru/kk_application_payment/kk_application_payment_status_updater_job.clj # src/clj/ataru/kk_application_payment/kk_application_payment_store.clj # src/clj/ataru/kk_application_payment/utils.clj # src/clj/ataru/koski/koski_service.clj # src/clj/ataru/person_service/person_integration.clj # src/clj/ataru/virkailija/virkailija_routes.clj # src/cljc/ataru/application/review_states.cljc # src/cljc/ataru/component_data/kk_application_payment_module.cljc # src/cljc/ataru/component_data/koski_tutkinnot_module.cljc # src/cljc/ataru/schema/form_properties_schema.cljc # src/cljc/ataru/schema/form_schema.cljc # src/cljc/ataru/schema/maksut_schema.cljc # src/cljc/ataru/translations/texts.cljc # src/cljc/ataru/tutkinto/tutkinto_util.cljc # src/cljc/ataru/util.cljc # src/cljs/ataru/hakija/application_form_components.cljs # src/cljs/ataru/hakija/application_handlers.cljs # src/cljs/ataru/hakija/application_tutkinto_handlers.cljs # src/cljs/ataru/hakija/application_view.cljs # src/cljs/ataru/hakija/components/tutkinnot.cljs # src/cljs/ataru/hakija/hakija_readonly.cljs # src/cljs/ataru/hakija/subs.cljs # src/cljs/ataru/virkailija/application/application_list/virkailija_application_list_view.cljs # src/cljs/ataru/virkailija/application/application_review_view.cljs # src/cljs/ataru/virkailija/application/handlers.cljs # src/cljs/ataru/virkailija/application/payment/payment_handlers.cljs # src/cljs/ataru/virkailija/application/payment/payment_subs.cljs # src/cljs/ataru/virkailija/application/payment/payment_view.cljs # src/cljs/ataru/virkailija/editor/component.cljs # src/cljs/ataru/virkailija/editor/handlers.cljs # src/cljs/ataru/virkailija/editor/view.cljs
- Loading branch information
Showing
27 changed files
with
10,538 additions
and
85 deletions.
There are no files selected for viewing
10,003 changes: 10,003 additions & 0 deletions
10,003
dev-resources/koski/application-with-koski-tutkinnot.json
Large diffs are not rendered by default.
Oops, something went wrong.
111 changes: 111 additions & 0 deletions
111
resources/db/migration/V20242110000000__refactor_kk_application_payment_tables.sql
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,111 @@ | ||
-- NOTE: the migration datestamp is reverse (YYYYDDMM instead of YYYYMMDD) and slightly misdated on purpose: | ||
-- some of the previous migrations from 2024 were accidentally added that way, and we need to run this after those | ||
-- to use the last modified procedure. | ||
|
||
-- The original migration was removed before going forward to QA and production, but drop the tables just in case | ||
-- if they still exist and aren't cleaned up manually. | ||
|
||
DROP TABLE IF EXISTS kk_application_payment_events; | ||
DROP TABLE IF EXISTS kk_application_payment_states; | ||
|
||
-- Store payment info related to individual applications. | ||
-- Use history table with automatic update triggers. | ||
|
||
CREATE TABLE kk_application_payments | ||
( | ||
id serial PRIMARY KEY, | ||
application_key varchar(40) UNIQUE, | ||
state text NOT NULL, | ||
reason text, | ||
due_date date, | ||
total_sum text, | ||
maksut_secret text, | ||
required_at timestamp with time zone, | ||
reminder_sent_at timestamp with time zone, | ||
approved_at timestamp with time zone, | ||
created_at timestamp with time zone DEFAULT now(), | ||
modified_at timestamp with time zone DEFAULT now() | ||
); | ||
|
||
COMMENT ON TABLE kk_application_payments IS 'Korkeakouluhakujen hakemusmaksujen tila hakemuksittain'; | ||
|
||
-- Automatic modification timestamps for the main table | ||
CREATE OR REPLACE FUNCTION update_payment_modified_at() RETURNS trigger AS $$ | ||
BEGIN | ||
NEW.modified_at := now(); | ||
RETURN NEW; | ||
END; | ||
$$ LANGUAGE plpgsql; | ||
|
||
CREATE TRIGGER sync_lastmod | ||
BEFORE UPDATE ON kk_application_payments | ||
FOR EACH ROW EXECUTE PROCEDURE update_payment_modified_at(); | ||
|
||
-- Also update application modified at in sync whenever payment data changes | ||
CREATE TRIGGER set_application_modified_time_on_kk_application_payment_update | ||
AFTER INSERT OR UPDATE OR DELETE | ||
ON kk_application_payments | ||
FOR EACH ROW | ||
EXECUTE PROCEDURE update_application_modified_time(); | ||
|
||
-- Automatic audit history for payment changes. | ||
CREATE TABLE kk_application_payments_history | ||
( | ||
id serial PRIMARY KEY, | ||
application_key varchar(40), | ||
state text NOT NULL, | ||
reason text, | ||
due_date date, | ||
total_sum text, | ||
maksut_secret text, | ||
required_at timestamp with time zone, | ||
reminder_sent_at timestamp with time zone, | ||
approved_at timestamp with time zone, | ||
created_at timestamp with time zone DEFAULT now(), | ||
modified_at timestamp with time zone DEFAULT now() | ||
); | ||
|
||
COMMENT ON TABLE kk_application_payments IS 'Korkeakouluhakujen hakemusmaksujen tilahistoria hakemuksittain'; | ||
|
||
CREATE OR REPLACE FUNCTION kk_application_payments_history_trigger() RETURNS TRIGGER AS | ||
$$ | ||
begin | ||
insert into kk_application_payments_history ( | ||
application_key, | ||
state, | ||
reason, | ||
due_date, | ||
total_sum, | ||
maksut_secret, | ||
required_at, | ||
reminder_sent_at, | ||
approved_at, | ||
created_at, | ||
modified_at | ||
) values ( | ||
old.application_key, | ||
old.state, | ||
old.reason, | ||
old.due_date, | ||
old.total_sum, | ||
old.maksut_secret, | ||
old.required_at, | ||
old.reminder_sent_at, | ||
old.approved_at, | ||
old.created_at, | ||
old.modified_at | ||
); | ||
return null; | ||
end; | ||
$$ language plpgsql; | ||
|
||
CREATE TRIGGER update_kk_application_payments | ||
AFTER UPDATE ON kk_application_payments | ||
FOR EACH ROW | ||
EXECUTE PROCEDURE kk_application_payments_history_trigger(); | ||
|
||
CREATE TRIGGER delete_kk_application_payments | ||
AFTER DELETE ON kk_application_payments | ||
FOR EACH ROW | ||
EXECUTE PROCEDURE kk_application_payments_history_trigger(); | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title></title> | ||
</head> | ||
<body style="margin: 0; font-family: 'Open Sans', Arial, sans-serif;"> | ||
<table style="width: 100%;"> | ||
<tr> | ||
<td style="padding-left: 20px; padding-top: 40px;"> | ||
Kiitos hakemusmaksun maksamisesta (en) | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="padding-top: 50px;"></td> | ||
</tr> | ||
</table> | ||
</body> | ||
</html> |
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,19 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title></title> | ||
</head> | ||
<body style="margin: 0; font-family: 'Open Sans', Arial, sans-serif;"> | ||
<table style="width: 100%;"> | ||
<tr> | ||
<td style="padding-left: 20px; padding-top: 40px;"> | ||
Kiitos hakemusmaksun maksamisesta (fi) | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="padding-top: 50px;"></td> | ||
</tr> | ||
</table> | ||
</body> | ||
</html> |
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,19 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title></title> | ||
</head> | ||
<body style="margin: 0; font-family: 'Open Sans', Arial, sans-serif;"> | ||
<table style="width: 100%;"> | ||
<tr> | ||
<td style="padding-left: 20px; padding-top: 40px;"> | ||
Kiitos hakemusmaksun maksamisesta (sv) | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="padding-top: 50px;"></td> | ||
</tr> | ||
</table> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(ns ataru.tutkinto.tutkinto-util-spec | ||
(:require [speclj.core :refer :all] | ||
[cheshire.core :as json] | ||
[ataru.tutkinto.tutkinto-util :as tutkinto-util])) | ||
|
||
(defn- read-application-json [file-name] | ||
(:application (json/parse-string (slurp (str "dev-resources/koski/" file-name)) true))) | ||
|
||
(describe "Finding tutkinto-data from application" | ||
(tags :unit) | ||
(it "should detect tutkinto id fields in application" | ||
(should= true (tutkinto-util/koski-tutkinnot-in-application? (read-application-json "application-with-koski-tutkinnot.json"))) | ||
)) |
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
Oops, something went wrong.