Prevent future-dated licenses from being considered the "current" license
Problem
When a self-managed customer renews their subscription, the customer receives a license immediately which they can apply to their instance. When applied, they immediately start to use the license, even before the start date.
Proposal
Currently, when the user uploads the renewal license, the instance accepts this license as the "current" license and moves the existing license to history. The logic behind the scenes for this is quite simple; just take the last license uploaded as the "current". The new desired behavior is to move the renewal/future-dated license to history (IOW don't consider it the "current" license) until the day it is within the licensed date range.
The simplest way to handle this would be to adjust the query/logic that pulls the "current" license. Instead of using the most recent license, find the most recently uploaded license where the current date is within the licensed date range.
As part of this change, we should also update the License History table to show all licenses, with some distinctions between any future licenses and the current license. A simple background color change might be sufficient. The table currently shows all licenses from the DB minus the most recently uploaded license. We will also likely need to update some messaging around license creation. It currently states that an uploaded license is active, but that won't always be the case now. There may be other small changes like this that are necessary as well.
It will also be important to test that true-up and user validations don't block the future-dated license from being applied. See this thread for more information.
Result
Prevent the use of future-dated licenses in self-managed instances.
Next steps (if any)
Improve the UX for the License History table to allow for deleting of specific licenses.