Skip to content

Commit

Permalink
feat: Add fields related to custom expiration messaging to CustomerAg…
Browse files Browse the repository at this point in the history
…reement
  • Loading branch information
jajjibhai008 committed Sep 19, 2024
1 parent 26112bf commit 544885e
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 1 deletion.
4 changes: 4 additions & 0 deletions license_manager/apps/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@ class Meta:
model = CustomerAgreement
fields = MinimalCustomerAgreementSerializer.Meta.fields + [
'subscriptions',
'has_custom_license_expiration_messaging',
'disabled_enroll_reason_override_for_expired_licenses',
'includes_b2c_marketing_website_cta',
'expired_subscription_modal_messaging',
]

@property
Expand Down
6 changes: 5 additions & 1 deletion license_manager/apps/subscriptions/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,11 @@ class CustomerAgreementAdmin(admin.ModelAdmin):
'default_enterprise_catalog_uuid',
'disable_expiration_notifications',
'license_duration_before_purge',
'disable_onboarding_notifications'
'disable_onboarding_notifications',
'has_custom_license_expiration_messaging',
'disabled_enroll_reason_override_for_expired_licenses',
'includes_b2c_marketing_website_cta',
'expired_subscription_modal_messaging',
)
custom_fields = ('subscription_for_auto_applied_licenses',)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Generated by Django 4.2.16 on 2024-09-19 08:17

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('subscriptions', '0069_alter_customeragreement_disable_expiration_notifications_and_more'),
]

operations = [
migrations.AddField(
model_name='customeragreement',
name='disabled_enroll_reason_override_for_expired_licenses',
field=models.CharField(blank=True, help_text='Custom message shown when a learner’s subscription expires and they can no longer enroll.', max_length=255, null=True),
),
migrations.AddField(
model_name='customeragreement',
name='expired_subscription_modal_messaging',
field=models.CharField(blank=True, help_text='The content of a modal that provides instructions on how learners can continue their journey on the B2C site with a discount code.', max_length=255, null=True),
),
migrations.AddField(
model_name='customeragreement',
name='has_custom_license_expiration_messaging',
field=models.BooleanField(default=False, help_text='Indicates if the customer has a unique license expiration experience, instead of the standard one.'),
),
migrations.AddField(
model_name='customeragreement',
name='includes_b2c_marketing_website_cta',
field=models.BooleanField(default=True, help_text='If checked, a link to the B2C course page will be appended to the expired license messaging.'),
),
migrations.AddField(
model_name='historicalcustomeragreement',
name='disabled_enroll_reason_override_for_expired_licenses',
field=models.CharField(blank=True, help_text='Custom message shown when a learner’s subscription expires and they can no longer enroll.', max_length=255, null=True),
),
migrations.AddField(
model_name='historicalcustomeragreement',
name='expired_subscription_modal_messaging',
field=models.CharField(blank=True, help_text='The content of a modal that provides instructions on how learners can continue their journey on the B2C site with a discount code.', max_length=255, null=True),
),
migrations.AddField(
model_name='historicalcustomeragreement',
name='has_custom_license_expiration_messaging',
field=models.BooleanField(default=False, help_text='Indicates if the customer has a unique license expiration experience, instead of the standard one.'),
),
migrations.AddField(
model_name='historicalcustomeragreement',
name='includes_b2c_marketing_website_cta',
field=models.BooleanField(default=True, help_text='If checked, a link to the B2C course page will be appended to the expired license messaging.'),
),
]
33 changes: 33 additions & 0 deletions license_manager/apps/subscriptions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,39 @@ class CustomerAgreement(TimeStampedModel):
),
)

has_custom_license_expiration_messaging = models.BooleanField(
default=False,
help_text=_(
"Indicates if the customer has a unique license expiration experience, instead of the standard one."
)
)

disabled_enroll_reason_override_for_expired_licenses = models.CharField(
max_length=255,
blank=True,
null=True,
help_text=_(
"Custom message shown when a learner’s subscription expires and they can no longer enroll."
)
)

includes_b2c_marketing_website_cta = models.BooleanField(
default=True,
help_text=_(
"If checked, a link to the B2C course page will be appended to the expired license messaging."
)
)

expired_subscription_modal_messaging = models.CharField(
max_length=255,
blank=True,
null=True,
help_text=_(
"The content of a modal that provides instructions on how learners can continue their journey on "
"the B2C site with a discount code."
)
)

history = HistoricalRecords()

@property
Expand Down

0 comments on commit 544885e

Please sign in to comment.