[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
- Needing to use inefficient and indirect queries to find licenses owned by a specific
TrialAccount- Ex: Matching
name,companyandemailto theTrialAccount, or going through the license's associatedCloudActivation, etc.
- Ex: Matching
- Possible data discrepancies between a
TrialAccountand the account data saved to theLicensedirectly- Ex: If we allow a user to manage or update their trial account in the future, the license also needs to be updated separately
- 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
TrialAccountin theLicensemodel - Update the
build_from_trialmethod in theLicensemodel to also save atrial_account_idin its attributes