Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add models to associate an opportunity id with a subscription license #523

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

muhammad-ammar
Copy link
Contributor

@muhammad-ammar muhammad-ammar commented Sep 15, 2023

Description

Add models to capture source of license assignment.

Link to the associated ticket: https://2u-internal.atlassian.net/browse/ENT-7641

Testing considerations

  • Include instructions for any required manual tests, and any manual testing that has
    already been performed.
  • Include unit and a11y tests as appropriate
  • Consider performance issues.
  • Check that Database migrations are backwards-compatible

Post-review

Squash commits into discrete sets of changes

@muhammad-ammar muhammad-ammar marked this pull request as draft September 15, 2023 07:34
@muhammad-ammar muhammad-ammar force-pushed the ammar/associate-opportunity-id-with-licenses branch 5 times, most recently from 65b6ca6 to 399420e Compare September 18, 2023 13:07
@muhammad-ammar muhammad-ammar changed the title feat: associate an opportunity id with a subscription license feat: add models to associate an opportunity id with a subscription license Sep 18, 2023
@muhammad-ammar muhammad-ammar force-pushed the ammar/associate-opportunity-id-with-licenses branch from 399420e to c5416bf Compare September 18, 2023 13:09
@muhammad-ammar muhammad-ammar marked this pull request as ready for review September 18, 2023 13:40
@muhammad-ammar muhammad-ammar force-pushed the ammar/associate-opportunity-id-with-licenses branch from c5416bf to 67eca35 Compare September 18, 2023 13:42
Copy link
Contributor

@iloveagent57 iloveagent57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one minor suggestion.

return "SubscriptionLicenseSourceType: Name: {name}, Slug: {slug}".format(name=self.name, slug=self.slug)


class SubscriptionLicenseSource(TimeStampedModel):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestion: you might want HistoricalRecords on this model.

related_name='source',
on_delete=models.CASCADE,
)
source_id = models.CharField(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking we should align the naming of these fields to what we use in subsidy: https://github.com/openedx/enterprise-subsidy/blob/main/enterprise_subsidy/apps/subsidy/models.py#L156-L176

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Playing devil's advocate a bit, having source_ in these names may make sense here given the model names both include Source (i.e., SubscriptionLicenseSource and SubscriptionLicenseSourceType)?

related_name='source',
on_delete=models.CASCADE,
)
source_id = models.CharField(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Playing devil's advocate a bit, having source_ in these names may make sense here given the model names both include Source (i.e., SubscriptionLicenseSource and SubscriptionLicenseSourceType)?

@muhammad-ammar muhammad-ammar force-pushed the ammar/associate-opportunity-id-with-licenses branch from 67eca35 to d7d0714 Compare September 19, 2023 06:49
@muhammad-ammar muhammad-ammar force-pushed the ammar/associate-opportunity-id-with-licenses branch from 55119e2 to f9367ed Compare September 21, 2023 05:35
@muhammad-ammar muhammad-ammar merged commit 9e8d68b into master Sep 21, 2023
7 checks passed
@muhammad-ammar muhammad-ammar deleted the ammar/associate-opportunity-id-with-licenses branch September 21, 2023 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants