Update activated_at when activate request received for a previously activated instance

Problem

As discussed in this discussion thread, an instance could fluctuate between the type of license used for their subscription. They could start with a license file, then use a cloud license, back to a license file, and so on. When a customer activates an instance for the first time, the activated_at timestamp is set to the current datetime. However, if the instance had previously been activated (IOW. a SelfManagedInstanceActivation already exists for the activation_code and instance_identifier, the activated_at isn't updated but it probably should be since the instance is activating again.

Proposal

In the ActivateService, update the activated_at timestamp to the current time if the self_managed_instance_activation record already exists. Also, make sure the new license generated after the activated_at is updated contains this change so that when synced to the instance the "Activated On" reflects the current time.

Availability & Testing

Adding this new logic to the activation service, to update the timestamp, a simple test should be added to ensure that this timestamp is updated to the appropriate time. It is not enough to validate that the activated_at column has changed, but we must also validate the value.

Edited Sep 13, 2021 by Dan Davison
Assignee Loading
Time tracking Loading