Task #3108
closed
Create a notification of work position changes
Added by Tomáš Doischer over 2 years ago.
Updated over 2 years ago.
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
- % 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.
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.
- Status changed from In Progress to Needs feedback
- Assignee changed from Tomáš Doischer to Roman Kučera
- % Done changed from 60 to 90
- 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.
- 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?
- Status changed from Needs feedback to Resolved
- Assignee changed from Roman Kučera to Tomáš Doischer
Thx, LGTM, merged into develop
- Status changed from Resolved to Closed
- % Done changed from 90 to 100
Also available in: Atom
PDF