Project

General

Profile

Actions

Task #2993

closed

LRT notification for new contracts/accounts

Added by Roman Kučera over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Roman Kučera
Target version:
Start date:
11/05/2021
Due date:
% Done:

100%

Estimated time:
Owner:

Description

It's similar task to LastContractEndNotificationTask but only for creation

LRT params:
  • Number of days before contract is valid 0=now, -X=afte valid contract X=before valid contract
  • Recipient, by role(selectbox), manager(checkbox), directly to the user(checkbox)
  • name of topic
  • Select box with systems - if no system is selected all accounts will be shown
  • checkbox if you want only contracts - no accounts, only contracts will be shown
  • Type of user - form projection

params for notification same as in LastContractEndNotificationTask

Actions #1

Updated by Roman Kučera over 2 years ago

  • Description updated (diff)
Actions #2

Updated by Roman Kučera over 2 years ago

  • % Done changed from 0 to 60

implementation https://github.com/bcvsolutions/czechidm-extras/tree/2993-lrt-contract-start-notif

implemented all params for lrt and for template
did some basic testing

TODO
unit test
more testing
doc

Actions #3

Updated by Roman Kučera over 2 years ago

  • % Done changed from 60 to 80
Actions #4

Updated by Roman Kučera over 2 years ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Roman Kučera to Tomáš Doischer
Actions #5

Updated by Tomáš Doischer over 2 years ago

  • Status changed from Needs feedback to In Progress
  • Assignee changed from Tomáš Doischer to Roman Kučera

Thank you for this feature. This review is also for #2612.

I really like the use of negative numbers in configuration!

  1. are you sure removing the contract from the queue is desirable in ContractStartNotificationTask? I know that validFrom of contract can potentially change but is it really necessary to send the notification again if that happens? It is needed in LastContractEndNotificationTask but it does have performance impact.
  2. in both tasks, I would expect that tree node selection is used recursively, i. e., I will see users with contract on selected position and on those below it
  3. unused imports in ContractStartNotificationTask and LastContractEndNotificationTask
  4. Sonar has some issues (using boolean instead of Boolean)
  5. null pointer on line ContractStartNotificationTask:290 - validFrom can be null when called from getContractItemFromQueue()

Otherwise it looks great, I tested a few basic UCs and it works well.

Actions #6

Updated by Roman Kučera over 2 years ago

Tomáš Doischer wrote in #note-5:

  1. are you sure removing the contract from the queue is desirable in ContractStartNotificationTask? I know that validFrom of contract can potentially change but is it really necessary to send the notification again if that happens? It is needed in LastContractEndNotificationTask but it does have performance impact.

The removing was implemented for use case if user will start working in company (notification is send) then he leave the company and he starts working there again. So we want to send the notification again. But when I am thinking about it now, I am not sure if he will have still the same contract. Because if if get a new contract then notification will be send anyway.

  1. in both tasks, I would expect that tree node selection is used recursively, i. e., I will see users with contract on selected position and on those below it

Yeah I thought that to. I will confirm this behavior with customer, or maybe some additional switch would be nice to choose if you want recursion or no.

  1. unused imports in ContractStartNotificationTask and LastContractEndNotificationTask
  2. Sonar has some issues (using boolean instead of Boolean)
  3. null pointer on line ContractStartNotificationTask:290 - validFrom can be null when called from getContractItemFromQueue()

I'll fix it thx.

Actions #7

Updated by Roman Kučera over 2 years ago

Unused imports, sonar and null pointer is already fixed.

Actions #8

Updated by Tomáš Doischer over 2 years ago

Fixes look great, thanks.

The other points I will leave up to you to decide whether to implement them or not.

Actions #9

Updated by Roman Kučera over 2 years ago

@doischert Could you please look at this last commit https://github.com/bcvsolutions/czechidm-extras/commit/cae885a7de060d8acfb660ea44ab1f4d2c4ad4e2 ?
I added down recursion by default, so the behavior by tree node will be similar as in other LRT.
I also changed the name of two template properties to correct names.

Actions #10

Updated by Tomáš Doischer over 2 years ago

LGTM, thank you for the fixes!

Actions #11

Updated by Roman Kučera over 2 years ago

  • Status changed from In Progress to Closed
  • Target version set to 3.3.0
  • % Done changed from 80 to 100
Actions

Also available in: Atom PDF