-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adding LicenseLifecycle data event (#36)
Related to https://openedx.atlassian.net/browse/ARCHBOM-2005 ticket Archbom is implementing an event bus kafka producer in license-manager. The types implemented in this PR are necessary for that work.
- Loading branch information
Showing
7 changed files
with
102 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
more information about the project. | ||
""" | ||
|
||
__version__ = "0.7.0" | ||
__version__ = "0.7.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env python3 | ||
|
||
""" | ||
Package where events related to the enterprise subdomain are implemented. | ||
The enterprise subdomain corresponds to {Architecture Subdomain} defined in | ||
the OEP-41. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
""" | ||
Data attributes for events within the architecture subdomain `enterprise`. | ||
These attributes follow the form of attr objects specified in OEP-49 data | ||
pattern. | ||
""" | ||
import attr | ||
|
||
|
||
@attr.s(frozen=True) | ||
class LicenseLifecycle: | ||
""" | ||
Event to track changes to subscriptsion.License records. | ||
Arguments: | ||
license_uuid (str): The UUID linked to this license and storing in the License Manager DB. | ||
This value is always present. | ||
license_activation_key (str): | ||
previous_license_uuid (str): The UUID linked to the previous license that this license is | ||
a renewal for. Non-empty only on after the | ||
edx.server.license-manager.license-lifecycle.renewed event has occurred. | ||
assigned_date (str): Formatted ISO-8601 Date String representing the date | ||
this license was most recently assigned to the assigned_email. | ||
May be empty. | ||
activation_date (str): Formatted ISO-8601 Date String this license was most recently activated | ||
for the assigned_email. | ||
May be empty. | ||
assigned_lms_user_id (str): The LMS User id of the user that this license 'belongs to'. | ||
May be empty if this license is not activated yet. | ||
assigned_email (str): The email assigned to this license. | ||
Will be empty if this license is not assigned to a learner yet. | ||
expiration_processed (bool): Boolean value of License 'expiration_processed' field, may be True or False. | ||
True means a license is expired. | ||
auto_applied (bool): | ||
enterprise_customer_uuid (str): UUID used to internally represent an enterprise | ||
enterprise_customer_slug (str): Short name of an enterprise used in the URLs and other places | ||
for display purposes. | ||
enterprise_customer_name (str): Long Name of an enterprise customer. Used for display and reporting | ||
customer_agreement_uuid (str): The active Customer Agreement UUID that this license is linked to. | ||
""" | ||
|
||
license_uuid = attr.ib(type=str) | ||
license_activation_key = attr.ib(type=str) | ||
previous_license_uuid = attr.ib(type=str) | ||
assigned_date = attr.ib(type=str) | ||
activation_date = attr.ib(type=str) | ||
assigned_email = attr.ib(type=str) | ||
expiration_processed = attr.ib(type=bool) | ||
assigned_lms_user_id = attr.ib(type=int, default=None) | ||
auto_applied = attr.ib(type=bool, default=False) | ||
enterprise_customer_uuid = attr.ib(type=str, default=None) | ||
enterprise_customer_slug = attr.ib(type=str, default=None) | ||
enterprise_customer_name = attr.ib(type=str, default=None) | ||
customer_agreement_uuid = attr.ib(type=str, default=None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
""" | ||
Custom signals definitions that representing the Open edX platform events. | ||
All signals defined in this module must follow the name and versioning | ||
conventions specified in docs/decisions/0002-events-naming-and-versioning.rst | ||
They also must comply with the payload definition specified in | ||
docs/decisions/0003-events-payload.rst | ||
""" | ||
|
||
from openedx_events.enterprise.data import LicenseLifecycle | ||
from openedx_events.tooling import OpenEdxPublicSignal | ||
|
||
# .. event_type: org.openedx.enterprise.subscription.license.modified.v1 | ||
# .. event_name: LICENSE_CREATED | ||
# .. event_description: emitted with Subscription.License is created. | ||
# .. event_data: LicenseLifecycle | ||
LICENSE_CREATED = OpenEdxPublicSignal( | ||
event_type="org.openedx.enterprise.subscription.license.created.v1", | ||
data={ | ||
"lifecycle": LicenseLifecycle, | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[bumpversion] | ||
current_version = 0.7.0 | ||
current_version = 0.7.1 | ||
commit = True | ||
tag = True | ||
|
||
|