[SM Cloud Licensing Trials] Add TrialAccount Association to License Model

Problem

Follow-up from https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/12078#note_2381042663

In [SM Cloud Licensing Trials] Add logic to build ... (#12295 - closed), we introduced the ability to create a license record from a Trial and its associated TrialAccount for SM online cloud licensing trials.

However, the License model currently does not have a direct association to a TrialAccount, and because trials are not stored in Zuora, there would also be no associated BillingAccount

Similar to how we save legacy trial licenses today, the License record instead saves attributes like company, name and email to the license directly. In the case of online cloud licensing trials, this is just duplicated data from a TrialAccount.

This could lead to potential problems in the future such as

  1. Needing to use inefficient and indirect queries to find licenses owned by a specific TrialAccount
    • Ex: Matching name, company and email to the TrialAccount, or going through the license's associated CloudActivation, etc.
  2. Possible data discrepancies between a TrialAccount and the account data saved to the License directly
    • Ex: If we allow a user to manage or update their trial account in the future, the license also needs to be updated separately
  3. More overhead and complexity in trying to understand our data model

Proposal

Important: The proposal here could change depending on the outcome of [SM Cloud Licensing Trials] `TrialAccount` and ... (#12394 - closed)

  • Add an optional association to a TrialAccount in the License model
  • Update the build_from_trial method in the License model to also save a trial_account_id in its attributes
Edited by Valerie Burton