Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OY-4699 API and functionality for updating all form koodisto values #1518

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vaeinoe
Copy link
Contributor

@vaeinoe vaeinoe commented Mar 6, 2024

API and service code to update all code sets to latest ones in a single form - creating a new version of the form with same key.

Adds and removes values if necessary, updates labels. Fails in case any followups would be erased accidentally, or if there are any applications submitted already.

(Bonus points: might be worth it to check if the application period has already been started even if no applications have been submitted yet, to avoid possible issues with last minute fixes, but couldn't find an easy mechanism for that, so maybe this will serve as a Minimum Viable Feature...)

(let [form (form-store/fetch-by-key form-key)
has-applications? (form-store/form-has-applications form-key)
updated-form (koodisto/populate-form-koodisto-fields koodisto-cache form true)]
(when has-applications? (throw (user-feedback-exception (str "Lomakkeella " (:key form) " on hakemuksia."))))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tän vois varmaan tehdä jo ennen tota lettiä?

tarjonta-service:stä pitäisi saada haun tiedot ja löytyy myös koodia missä niitä hakuaikoja tarkastellaan, jos haluaa senkin implementoida tähän.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants