Task #3108
closedCreate a notification of work position changes
100%
Description
The task should check changes in the audit in the last X days in contract attributes and EAV attributes.
It should have this configuration:- number of days to go back in the audit
- codes of basic contract attributes to check
- definition + code of EAV attributes to check
- notification recipient
- by role
- to superior
- to the user
- notification topic
- check manually blocked
- system select - if a system is selected, the notification is sent only if the user has an account in a system
- tree node - if a tree node is selected, the notification is sent only if the user has the contract position there
Updated by Tomáš Doischer over 2 years ago
- % Done changed from 0 to 60
I have the basic implementation ready. One issue was with tests that didn't support audits properly. I tried copying a test from core-impl which works in the module to extras, and it failed in extras. I changed the application.properties in the test resources to application-test.properties (which is what I think it should be called) and added the following properties from the same file in core-impl:
# is necessary configure strategy and modified flag and suffix also for test spring.jpa.properties.org.hibernate.envers.audit_strategy=eu.bcvsolutions.idm.core.model.repository.listener.IdmAuditStrategy spring.jpa.properties.org.hibernate.envers.global_with_modified_flag=true spring.jpa.properties.org.hibernate.envers.modified_flag_suffix=_m
It works well now.
Still, a lot of testing is ahead + documentation is needed.
Updated by Tomáš Doischer over 2 years ago
The condition that the contract must be created X days before makes testing difficult, this property is read-only. I will instead add condition to the main task that the task is running in test and skip this check. This is not exactly best practice.
Updated by Tomáš Doischer over 2 years ago
- Status changed from In Progress to Needs feedback
- Assignee changed from Tomáš Doischer to Roman Kučera
- % Done changed from 60 to 90
Implementation is finished.
PR: https://github.com/bcvsolutions/czechidm-extras/pull/77
Documentation:
https://wiki.czechidm.com/devel/documentation/modules_extras#notification_about_the_change_of_identity_s_contract
https://wiki.czechidm.com/tutorial/adm/notification_-_identity_s_contract_was_changed
@kucerar, can you please give me feedback?
Updated by Roman Kučera over 2 years ago
- Status changed from Needs feedback to In Progress
- Assignee changed from Roman Kučera to Tomáš Doischer
Thx for implementation.
I added some comments to PR.
It would be nice to add info about the format of the multivalued attributes for attributes and EAV (separators).
Otherwise LGTM, I like the builder solution.
I test it and it works nicely.
Updated by Tomáš Doischer over 2 years ago
- Status changed from In Progress to Needs feedback
- Assignee changed from Tomáš Doischer to Roman Kučera
Thank you, I fixed the issues. Can you take a look at it again please?
Updated by Roman Kučera over 2 years ago
- Status changed from Needs feedback to Resolved
- Assignee changed from Roman Kučera to Tomáš Doischer
Thx, LGTM, merged into develop
Updated by Peter Štrunc over 2 years ago
- Status changed from Resolved to Closed
- % Done changed from 90 to 100