Project

General

Profile

bug #7995

Registration.registrationDate not set when status is set PUBLISHED

Added by Andreas Kohlbecker 4 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Highest
Category:
cdm-vaadin
Target version:
Start date:
01/15/2019
Due date:
% Done:

100%

Severity:
critical
Found in Version:
Tags:

Description

The Registration.registrationDate should be set to now when the status is set to PUBLISHED.
When status changes from PUBLISHED to something else the registrationDate should be resetted to null.

Per definition the registrationDate this the timestamp for when the registration has been published, so it makes most sense to implement this rule into the setter Registration.status. There might be rare use cases in which the registrationDate needs to be different. In these cases setting the data explicitly is needed anyway.


Related issues

Related to Edit - feature request #6655: Implement a RegistrationManager with state machine Rejected 05/19/2017

Associated revisions

Revision f33a82a7 (diff)
Added by Andreas Kohlbecker 4 months ago

fix #7995 set and unset registrationDate when registration status changes

Revision 3c845507 (diff)
Added by Andreas Kohlbecker 4 months ago

ref #7995 set and unset registrationDate when registration status changes - doc

Revision 6321fa37 (diff)
Added by Andreas Kohlbecker 4 months ago

ref #7995 extra method to manage the registration date when the status is set, setStatus reverted

Revision 603abeca (diff)
Added by Andreas Kohlbecker 4 months ago

ref #7995 using updateStatusAndDate to set the registration status

Revision 11012a24 (diff)
Added by Andreas Kohlbecker 4 months ago

ref #7995 adapting test to use updateStatusAndDate

Revision 3f010594 (diff)
Added by Andreas Kohlbecker 4 months ago

ref #7995 invoking Registration.updateStatusAndDate() also in RegistrationPopupEditor on status changes

Revision b0339f85 (diff)
Added by Andreas Kohlbecker 4 months ago

ref #7995 invoking Registration.updateStatusAndDate() from RegistrationEditorPresenter

History

#1 Updated by Andreas Kohlbecker 4 months ago

#2 Updated by Andreas Kohlbecker 4 months ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50

#3 Updated by Andreas Müller 4 months ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Andreas Müller to Andreas Kohlbecker

This is dangerous behaviour. For phycobank it might be correct as we edit the data within the database. However, for handling external registrations it is not correct. For the later usecase the user/developer must know that setting the date should be done after setting the state which is hidden knowledge only available in Javadoc or so which is dangerous. Also when accidentally changing the state and change it back to PUBLISHED the date is changed without realizing by the user maybe.

So I strongly recommend to implement this on application side if it is a wanted feature for phycobank but remove it from cdmlib-model. We could add a method in service layer if you want to encapsulate it within one operation. This method should have an according name, e.g. setStatusAndDate

#4 Updated by Andreas Kohlbecker 4 months ago

So I strongly recommend to implement this on application side

So this means implementing it in cdm-vaadin and in the registration controller methods (cdmlib-remote) which allow state changes. Especially in the remote layer it is crucial for the digital workflow that the registrationDate is always set to now when status is set PUBLISHED.

#5 Updated by Andreas Müller 4 months ago

Andreas Kohlbecker wrote:

So I strongly recommend to implement this on application side

So this means implementing it in cdm-vaadin and in the registration controller methods (cdmlib-remote) which allow state changes. Especially in the remote layer it is crucial for the digital workflow that the registrationDate is always set to now when status is set PUBLISHED.

sounds reasonable

#6 Updated by Andreas Kohlbecker 4 months ago

  • Status changed from Feedback to Resolved

There is now a updateStatusAndDate(RegistrationStatus status) method in Registration which can be used if needed. The algorithm is centralized that way.

#7 Updated by Andreas Kohlbecker 4 months ago

  • Status changed from Resolved to Closed
  • % Done changed from 50 to 100

works now also in the RegistrationPopupEditor

#8 Updated by Andreas Müller 3 months ago

  • Category changed from cdmlib to cdm-vaadin

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)